Jump to content

Veškerá aktivita

Tento obsah se sám aktualizuje

  1. Dnes
  2. Ďakujem vyskúšal som a chybu som našiel nenačítalo mi dáta preto lebo som mal v načítavani dát - INI_Int(" pZbran2naboje ",PlayerInfo[playerid][pZbran2naboje]); ale do dát som ukladal len Zbrane2 atd.. INI_WriteInt(File, "Zbran2", 0); INI_WriteInt(File, "Zbran2naboje", 0); ... do budúcna určite dobrá vec na zistenie problému, dakujem
  3. Je na čase skúsiť si ladenie programu (debugging). V Pawn sa to rieši vypisovaním správ do konzole (print, printf) / chatu (SendClientMessageToAll). V tvojom prípade chceme overiť nasledovné: 1. Načítajú sa dáta po pripojení správne? 2. Neresetujú sa dáta náhodou v OnPlayerSpawn? 3. Volá sa GivePlayerWeapon v OnPlayerSpawn so správnymi dátami? Poďme overiť bod 1... do LoadUser_data hneď za riadok INI_Int("pZbran2naboje",PlayerInfo[playerid][pZbran2naboje]); vlož výpis načítaných dát. Napríklad: print("Výpis načítaných zbraní:") printf("zbran0: %d", PlayerInfo[playerid][pZbran0]); printf("zbran0naboje: %d", PlayerInfo[playerid][pZbran0naboje]); printf("zbran1: %d", PlayerInfo[playerid][pZbran1]); printf("zbran1naboje: %d", PlayerInfo[playerid][pZbran1naboje]); printf("zbran2: %d", PlayerInfo[playerid][pZbran2]); printf("zbran2naboje: %d", PlayerInfo[playerid][pZbran2naboje]); Potom sa v hre prihlás a v server logu by si mal uvidieť, aké dáta sa načítali. Ak tam uvidíš správne dáta, musíš patrať ďalej... Bod 2... V OnPlayerSpawn skontroluj, či sa ti náhodou zbrane neresetujú if(Deathreset[playerid] == 1) { PlayerInfo[playerid][pZbran0] = 0; PlayerInfo[playerid][pZbran0naboje] = 0; PlayerInfo[playerid][pZbran1] = 0; PlayerInfo[playerid][pZbran1naboje] = 0; PlayerInfo[playerid][pZbran2] = 0; PlayerInfo[playerid][pZbran2naboje] = 0; print("Reset hráčových zbraní"); // do server logu SendClientMessageToAll(-1, "Reset hráčových zbraní"); // alebo priamo v hre do chatu, aby si to hneď videl } Keď sa spawneš a uvidíš v chate "Reset hráčových zbraní" bez toho, že by predtým zomrel, tak vieš, že je chyba v tejto časti kódu. Bod 3... V OnPlayerSpawn tesne pred tým, ako hráčovi givneš zbrane, znova skontroluj hodnoty pZbran0, pZbran0naboje, ... print("Výpis zbraní pred givnutím:") printf("zbran0: %d", PlayerInfo[playerid][pZbran0]); printf("zbran0naboje: %d", PlayerInfo[playerid][pZbran0naboje]); printf("zbran1: %d", PlayerInfo[playerid][pZbran1]); printf("zbran1naboje: %d", PlayerInfo[playerid][pZbran1naboje]); printf("zbran2: %d", PlayerInfo[playerid][pZbran2]); printf("zbran2naboje: %d", PlayerInfo[playerid][pZbran2naboje]); Skontroluj, či to vypíše správne dáta do konzole (server logu).
  4. new Deathreset[MAX_PLAYERS]; Deathreset[playerid] = 1; // toto mam len v onplayerdeath Ale skúsal som odstraniť ten Deathreset a vyskúšat to bez neho ale zbrane mi to stale nedá
  5. Aká je funkcia toho Deathresetu? Nebolo by jednoduchšie nastaviť pZbran0, pZbran0naboje, pZbran1, ... na 0 priamo v OnPlayerDeath a v OnPlayerSpawn to potom už neriešiť? Myslím, že vtedy by si Deathreset vôbec nepotreboval. Ukáž ešte prosím všetky miesta, kde pracuješ s Deathreset.
  6. Zdravim Chalani vedel by mi niekto pomôct s načítanim zbrani ? .. ukladanie mi funguje ale nechce mi ich načítať ked sa spawnem. v OnPlayerConnect resetujem dáta ak sa prihlási nový uživatel.. v OnPlayerSpawn to mam takto skúsal som to aj inak aj cez podmienku či už existuje ale stale mi to nešlo.. (Deathreset mám ked zomrie aby sa vyresetovali zbrane lebo zozaciatku mi to išlo ale pri umrti mi zbrane stale čítali zo súboru že ich stale mam) OnPlayerDisconnect Potom ešte v registracii mam aby sa vytvorilo v zlozle "Zbran1 - (hodnota) , zbran1naboje - (hodnota) Ale ukladanie do súboru mi funguje lebo ked pridem na server a cez prikaz si vlozim .. - Boxer,basbalku a desert eagle.. a odhlasim sa ukazuje mi to takto Zbran2naboje = 100 Zbran2 = 24 Zbran1naboje = 1 Zbran1 = 5 Zbran0naboje = 1 Zbran0 = 1 Ale ked sa prihlasim už mi ich nenačíta samozrejme potom sa odstrania pri dalsom disconnecte kedze už nemam žiadne zbrane..
  7. Včera
  8. Ďakujem vemi pekne ATomasi odskúšané a funguje to velmi dobre
  9. Dovolil jsem si mensi optimalizaci #include <a_samp> enum e_info { pVodickyB, pVodickyC } new PlayerInfo[MAX_PLAYERS][e_info]; new autoskolacarb; new autoskolab[MAX_PLAYERS]; new autoskolac[MAX_PLAYERS]; new PlayerText:akotskolabkonec[MAX_PLAYERS][18]; new PlayerText:autoskolabtd[MAX_PLAYERS][12]; new PlayerText:autoskolatd[MAX_PLAYERS][12]; new PlayerText:preukazvlastni[MAX_PLAYERS]; new PlayerText:preukazvlastni1[MAX_PLAYERS]; new PlayerText:nedostatokpenazi[MAX_PLAYERS]; new PlayerText:nedostatokpenazi1[MAX_PLAYERS]; new autoskolacarc; new autoskolacarcnaves; enum { DIALOG_AUTOSKOLA } //----------------------------------------------------------------------------// #define CP 1 #define CCP 16 new Float:CPAutoskolaB[][] = { {-2047.6212,-78.2796,34.7413,5.0}, {-2026.7949,-156.6074,35.3203,5.0}, {-2045.3695,-173.9235,37.7754,5.0}, {-2058.1487,-162.0910,35.3203,5.0}, {-2058.2043,-126.9359,35.3227,5.0}, {1148.3583,1376.4371,10.5468,7.0}, {1103.7428,1376.0496,10.5468,5.0}, {1007.2051,1382.1805,10.5751,7.0}, {1006.8726,1716.1813,10.6523,7.0}, {1007.9291,1810.5002,10.7037,7.0}, {1224.1656,1813.0670,13.6591,7.0}, {1272.4874,1743.7592,9.0676,7.0}, {1217.2009,1442.5193,6.5797,7.0}, {1174.1589,1376.4054,10.6933,7.0} }; new Float:CPAutoskolaC[][] = { {1142.7788,1264.6090,11.4266,5.0}, {1125.2251,1232.4261,11.4270,5.0}, {1111.6285,1258.4397,11.4275,5.0}, {1110.7295,1299.6412,11.4267,5.0} }; public OnPlayerEnterCheckpoint(playerid) { switch(autoskolab[playerid]) { case CP .. CP + sizeof(CPAutoskolaB): { if(autoskolab[playerid] >= sizeof(CPAutoskolaB)) { PlayerInfo[playerid][pVodickyB]++; SetPlayerVirtualWorld(playerid, 0); DisablePlayerCheckpoint(playerid); SetPlayerPos(playerid, 1170.7604,1353.1532,10.9219); SetPlayerFacingAngle(playerid, 89.9102); SetPlayerInterior(playerid, 0); SetCameraBehindPlayer(playerid); TogglePlayerControllable(playerid,0); SetTimerEx("AntifreezeAutoSkola", 5000, false, "i", playerid); SetTimerEx("TextDrawAutoskola", 5000, false, "i", playerid); for(new i;i<sizeof(akotskolabkonec[]);i++) PlayerTextDrawShow(playerid, akotskolabkonec[playerid][i]); } else { SetPlayerCheckpoint(playerid,CPAutoskolaB[autoskolab[playerid]][0],CPAutoskolaB[autoskolab[playerid]][1],CPAutoskolaB[autoskolab[playerid]][2],CPAutoskolaB[autoskolab[playerid]][3]); autoskolab[playerid]++; if(autoskolab[playerid] == 6) { LinkVehicleToInterior(autoskolacarb,0); SetPlayerInterior(playerid,0); SetCameraBehindPlayer(playerid); SetVehicleZAngle(autoskolacarb,149.2382); SetVehiclePos(autoskolacarb,1163.3914,1380.4377,10.5469); TogglePlayerControllable(playerid,0); SetTimerEx("AntifreezeAutoSkola", 8000, false, "i", playerid); SetTimerEx("TextDrawAutoskola", 8000, false, "i", playerid); for(new i;i<sizeof(autoskolabtd[]);i++) PlayerTextDrawShow(playerid, autoskolabtd[playerid][i]); } } } case CCP .. CCP + sizeof(CPAutoskolaC): { SetPlayerCheckpoint(playerid,CPAutoskolaC[autoskolac[playerid]][0],CPAutoskolaC[autoskolac[playerid]][1],CPAutoskolaC[autoskolac[playerid]][2],CPAutoskolaC[autoskolac[playerid]][3]); autoskolac[playerid]++; } } return 1; } public OnDialogResponse(playerid,dialogid,response,listitem,inputtext[]) { if(dialogid == DIALOG_AUTOSKOLA) { if(!response) { SetPlayerPos(playerid,1170.7604,1353.1532,10.9219); return 1; } switch (listitem) { case 0: { if(PlayerInfo[playerid][pVodickyB] == 1) { SetTimerEx("preukazy", 5000, false, "i", playerid); PlayerTextDrawShow(playerid, preukazvlastni1[playerid]); PlayerTextDrawShow(playerid, preukazvlastni[playerid]); SetPlayerPos(playerid,1170.7604,1353.1532,10.9219); } else if(GetPlayerMoney(playerid) < 10000) { SetTimerEx("Nedostatokpenazi", 5000, false, "i", playerid); PlayerTextDrawShow(playerid, nedostatokpenazi[playerid]); PlayerTextDrawShow(playerid, nedostatokpenazi1[playerid]); SetPlayerPos(playerid,1170.7604,1353.1532,10.9219); } else //když splňuje podmínky { GivePlayerMoney(playerid,-10000); //vezmem mu peníze autoskolab[playerid] = CP; autoskolacarb = CreateVehicle(565, -2042.4133,-112.9670,35.2057,179.9765, random(100), random(100), 1000); //vytvoříme vozidlo (ID) a souřdnice kde se spawne PutPlayerInVehicle(playerid, autoskolacarb,0); SetVehicleVirtualWorld(autoskolacarb, 10); SetPlayerVirtualWorld(playerid, 10); SetPlayerCheckpoint(playerid,-2037.4709,-127.8062,35.2436,7.0); TogglePlayerControllable(playerid,0); SetTimerEx("AntifreezeAutoSkola", 8000, false, "i", playerid); //textdrawsautoskolaCVICISKO SetTimerEx("TextDrawAutoskola", 8000, false, "i", playerid); for(new i;i<sizeof(autoskolatd[]);i++) PlayerTextDrawShow(playerid, autoskolatd[playerid][i]); } } case 1: { if(PlayerInfo[playerid][pVodickyC] == 1) { SetTimerEx("preukazy", 5000, false, "i", playerid); PlayerTextDrawShow(playerid, preukazvlastni1[playerid]); PlayerTextDrawShow(playerid, preukazvlastni[playerid]); SetPlayerPos(playerid,1170.7604,1353.1532,10.9219); } else if(GetPlayerMoney(playerid) < 9999) { SetTimerEx("Nedostatokpenazi", 5000, false, "i", playerid); PlayerTextDrawShow(playerid, nedostatokpenazi[playerid]); PlayerTextDrawShow(playerid, nedostatokpenazi1[playerid]); SetPlayerPos(playerid,1170.7604,1353.1532,10.9219); } else //když splňuje podmínky { GivePlayerMoney(playerid,-10000); //vezmem mu peníze autoskolac[playerid] = CCP; autoskolacarc = CreateVehicle(403, 1139.6000000,1342.1000000,11.5000000,180.0000000, random(100), random(100), 1000); autoskolacarcnaves = CreateVehicle(435, 1139.6000000,1351.0000000,11.5000000,180.0000000, random(100), random(100), 1000); AttachTrailerToVehicle(autoskolacarcnaves, autoskolacarc); PutPlayerInVehicle(playerid, autoskolacarc,0); SetPlayerCheckpoint(playerid,1142.4054,1314.2500,11.4265,5.0); } } } } return 1; }
  10. Last week
  11. Dakujem vám chalani moc za pomoc teraz si sice pripadam jak primitív ale snažil som sa to robit z hlavy 😅 už som to prerobil 😅
  12. Earlier
  13. milous sa ti snažil naznačiť, že chyba je tu: case CCP1: { DisablePlayerCheckpoint(playerid); SetPlayerCheckpoint(playerid,1142.7788,1264.6090,11.4266,5.0); autoskolac[playerid] = CCP1; } AK hráč vezme 1. checkpoint Cčka, do autoskolac ukladáš zase 1. checkpoint Cčka. Chceš tam autoskolac[playerid] = CCP2 a podobne to posunúť všade (v Cčku). Čo sa týka returnu, skús si najskôr prečítať ako funguje napríklad tu: https://sampwiki.blast.hk/wiki/Control_Structures#return Pamätám si, že keď som sa učil pawn (moja prvá skúsenosť s programovaním), tak som return dlho nechápal, až kým som nenarazil na tento článok.
  14. Jasne rozumiem, skúsal som to aj takto switch(autoskolac[playerid]) { case CCP1: { DisablePlayerCheckpoint(playerid); SetPlayerCheckpoint(playerid,1142.7788,1264.6090,11.4266,5.0); autoskolac[playerid] = CCP1; } case CCP2: { DisablePlayerCheckpoint(playerid); SetPlayerCheckpoint(playerid,1125.2251,1232.4261,11.4270,5.0); autoskolac[playerid] = CCP2; } case CCP3: { DisablePlayerCheckpoint(playerid); SetPlayerCheckpoint(playerid,1111.6285,1258.4397,11.4275,5.0); autoskolac[playerid] = CCP3; } case CCP4: { DisablePlayerCheckpoint(playerid); SetPlayerCheckpoint(playerid,1110.7295,1299.6412,11.4267,5.0); autoskolac[playerid] = CCP4; } } return 1; } case 1: { if (PlayerInfo[playerid][pVodickyC] == 1) { SetTimerEx("preukazy", 5000, false, "i", playerid); PlayerTextDrawShow(playerid, preukazvlastni1[playerid]); PlayerTextDrawShow(playerid, preukazvlastni[playerid]); SetPlayerPos(playerid,1170.7604,1353.1532,10.9219); } else if(GetPlayerMoney(playerid) < 9999) { SetTimerEx("Nedostatokpenazi", 5000, false, "i", playerid); PlayerTextDrawShow(playerid, nedostatokpenazi[playerid]); PlayerTextDrawShow(playerid, nedostatokpenazi1[playerid]); SetPlayerPos(playerid,1170.7604,1353.1532,10.9219); } else //když splňuje podmínky { GivePlayerMoney(playerid,-10000); //vezmem mu peníze autoskolac[playerid] = CCP1; autoskolacarc = CreateVehicle(403, 1139.6000000,1342.1000000,11.5000000,180.0000000, random(100), random(100), 1000); autoskolacarcnaves = CreateVehicle(435, 1139.6000000,1351.0000000,11.5000000,180.0000000, random(100), random(100), 1000); AttachTrailerToVehicle(autoskolacarcnaves, autoskolacarc); PutPlayerInVehicle(playerid, autoskolacarc,0); SetPlayerCheckpoint(playerid,1142.4054,1314.2500,11.4265,5.0); // prvy CHECKPOINT } } aj v dialogu som prehodil ale stále mi ide len prvy ale ten další zobrazi ale ked na neho vejdem už nereaguje.. ešte sa chcem spýtať či za tým prvým switchom nema byť return??.. v navode tu na fore bolo písane od autora " ja ho tam nedávam " .. nemôže to byť koli tomu ? - každopadne chalani dakujem za pomoc
  15. Namiesto case 1, 2, 3... Používaj vo switchi tie svoje definície a podobné chyby uvidíš v budúcnosti ľahšie
  16. Čaute prosim vas vedel by mi niekto pomocť s tymto problemom v autoškole? Mám vytvorenu skupinu B .. pri ktorej mi funguje uplne všetko aj ukladanie atd. Problem nastáva ked chcem vytvorit dalšie checkpointy určené len pre Skupinu C.. funguje mi iba prvý checkpoint ale další ktory mam už v onplayerentercheckpoint tak neurobi nič.. Dakujem za pomoc.. define... #define CP1 1 #define CP2 2 #define CP3 3 #define CP4 4 #define CP5 5 #define CP6 6 #define CP7 7 #define CP8 8 #define CP9 9 #define CP10 10 #define CP11 11 #define CP12 12 #define CP13 13 #define CP14 14 #define CP15 15 #define CCP1 16 #define CCP2 17 #define CCP3 18 #define CCP4 19 // Onplayerentercheckpoint public OnPlayerEnterCheckpoint(playerid) { //============================================================================== switch(autoskolab[playerid]) { case 1: { DisablePlayerCheckpoint(playerid); SetPlayerCheckpoint(playerid,-2047.6212,-78.2796,34.7413,5.0); autoskolab[playerid] = CP2; } case 2: { DisablePlayerCheckpoint(playerid); SetPlayerCheckpoint(playerid,-2026.7949,-156.6074,35.3203,5.0); autoskolab[playerid] = CP3; } case 3: { DisablePlayerCheckpoint(playerid); SetPlayerCheckpoint(playerid,-2045.3695,-173.9235,37.7754,5.0); autoskolab[playerid] = CP4; } case 4: { DisablePlayerCheckpoint(playerid); SetPlayerCheckpoint(playerid,-2058.1487,-162.0910,35.3203,5.0); autoskolab[playerid] = CP5; } case 5: { DisablePlayerCheckpoint(playerid); SetPlayerCheckpoint(playerid,-2058.2043,-126.9359,35.3227,5.0); autoskolab[playerid] = CP6; } case 6: { DisablePlayerCheckpoint(playerid); SetPlayerCheckpoint(playerid,1148.3583,1376.4371,10.5468,7.0); autoskolab[playerid] = CP7; LinkVehicleToInterior(autoskolacarb,0); SetPlayerInterior(playerid,0); SetCameraBehindPlayer(playerid); SetVehicleZAngle(autoskolacarb,149.2382); SetVehiclePos(autoskolacarb,1163.3914,1380.4377,10.5469); TogglePlayerControllable(playerid,0); SetTimerEx("AntifreezeAutoSkola", 8000, false, "i", playerid); SetTimerEx("TextDrawAutoskola", 8000, false, "i", playerid); PlayerTextDrawShow(playerid, autoskolab1[playerid]); PlayerTextDrawShow(playerid, autoskolab2[playerid]); PlayerTextDrawShow(playerid, autoskolab3[playerid]); PlayerTextDrawShow(playerid, autoskolab4[playerid]); PlayerTextDrawShow(playerid, autoskolab5[playerid]); PlayerTextDrawShow(playerid, autoskolab6[playerid]); PlayerTextDrawShow(playerid, autoskolab7[playerid]); PlayerTextDrawShow(playerid, autoskolab8[playerid]); PlayerTextDrawShow(playerid, autoskolab9[playerid]); PlayerTextDrawShow(playerid, autoskolab10[playerid]); PlayerTextDrawShow(playerid, autoskolab11[playerid]); } case 7: { DisablePlayerCheckpoint(playerid); SetPlayerCheckpoint(playerid,1103.7428,1376.0496,10.5468,5.0); autoskolab[playerid] = CP8; } case 8: { DisablePlayerCheckpoint(playerid); SetPlayerCheckpoint(playerid,1007.2051,1382.1805,10.5751,7.0); autoskolab[playerid] = CP9; } case 9: { DisablePlayerCheckpoint(playerid); SetPlayerCheckpoint(playerid,1006.8726,1716.1813,10.6523,7.0); autoskolab[playerid] = CP10; } case 10: { DisablePlayerCheckpoint(playerid); SetPlayerCheckpoint(playerid,1007.9291,1810.5002,10.7037,7.0); autoskolab[playerid] = CP11; } case 11: { DisablePlayerCheckpoint(playerid); SetPlayerCheckpoint(playerid,1224.1656,1813.0670,13.6591,7.0); autoskolab[playerid] = CP12; } case 12: { DisablePlayerCheckpoint(playerid); SetPlayerCheckpoint(playerid,1272.4874,1743.7592,9.0676,7.0); autoskolab[playerid] = CP13; } case 13: { DisablePlayerCheckpoint(playerid); SetPlayerCheckpoint(playerid,1217.2009,1442.5193,6.5797,7.0); autoskolab[playerid] = CP14; } case 14: { DisablePlayerCheckpoint(playerid); SetPlayerCheckpoint(playerid,1174.1589,1376.4054,10.6933,7.0); autoskolab[playerid] = CP15; } case 15: { if(autoskolab[playerid]) PlayerInfo[playerid][pVodickyB]++; SetPlayerVirtualWorld(playerid, 0); DisablePlayerCheckpoint(playerid); SetPlayerPos(playerid, 1170.7604,1353.1532,10.9219); SetPlayerFacingAngle(playerid, 89.9102); SetPlayerInterior(playerid, 0); SetCameraBehindPlayer(playerid); TogglePlayerControllable(playerid,0); SetTimerEx("AntifreezeAutoSkola", 5000, false, "i", playerid); SetTimerEx("TextDrawAutoskola", 5000, false, "i", playerid); PlayerTextDrawShow(playerid, akotskolabkonec0[playerid]); PlayerTextDrawShow(playerid, akotskolabkonec1[playerid]); PlayerTextDrawShow(playerid, akotskolabkonec2[playerid]); PlayerTextDrawShow(playerid, akotskolabkonec3[playerid]); PlayerTextDrawShow(playerid, akotskolabkonec4[playerid]); PlayerTextDrawShow(playerid, akotskolabkonec5[playerid]); PlayerTextDrawShow(playerid, akotskolabkonec6[playerid]); PlayerTextDrawShow(playerid, akotskolabkonec7[playerid]); PlayerTextDrawShow(playerid, akotskolabkonec8[playerid]); PlayerTextDrawShow(playerid, akotskolabkonec9[playerid]); } } switch(autoskolac[playerid]) { case 16: { DisablePlayerCheckpoint(playerid); SetPlayerCheckpoint(playerid,1142.7788,1264.6090,11.4266,5.0); autoskolac[playerid] = CCP1; } case 17: { DisablePlayerCheckpoint(playerid); SetPlayerCheckpoint(playerid,1125.2251,1232.4261,11.4270,5.0); autoskolac[playerid] = CCP2; } case 18: { DisablePlayerCheckpoint(playerid); SetPlayerCheckpoint(playerid,1111.6285,1258.4397,11.4275,5.0); autoskolac[playerid] = CCP3; } case 19: { DisablePlayerCheckpoint(playerid); SetPlayerCheckpoint(playerid,1110.7295,1299.6412,11.4267,5.0); autoskolac[playerid] = CCP4; } } return 1; } a dialog.... if (dialogid == DIALOG_AUTOSKOLA) { if(!response) // If they clicked 'Select' or double-clicked a weapon { SetPlayerPos(playerid,1170.7604,1353.1532,10.9219); return 1; } switch (listitem) { case 0: { if (PlayerInfo[playerid][pVodickyB] == 1) { SetTimerEx("preukazy", 5000, false, "i", playerid); PlayerTextDrawShow(playerid, preukazvlastni1[playerid]); PlayerTextDrawShow(playerid, preukazvlastni[playerid]); SetPlayerPos(playerid,1170.7604,1353.1532,10.9219); } else if(GetPlayerMoney(playerid) < 9999) { SetTimerEx("Nedostatokpenazi", 5000, false, "i", playerid); PlayerTextDrawShow(playerid, nedostatokpenazi[playerid]); PlayerTextDrawShow(playerid, nedostatokpenazi1[playerid]); SetPlayerPos(playerid,1170.7604,1353.1532,10.9219); } else //když splňuje podmínky { GivePlayerMoney(playerid,-10000); //vezmem mu peníze autoskolab[playerid] = 2; autoskolacarb = CreateVehicle(565, -2042.4133,-112.9670,35.2057,179.9765, random(100), random(100), 1000); //vytvoříme vozidlo (ID) a souřdnice kde se spawne PutPlayerInVehicle(playerid, autoskolacarb,0); SetVehicleVirtualWorld(GetPlayerVehicleID(playerid), 10); SetPlayerVirtualWorld(playerid, 10); SetPlayerCheckpoint(playerid,-2037.4709,-127.8062,35.2436,7.0); TogglePlayerControllable(playerid,0); SetTimerEx("AntifreezeAutoSkola", 8000, false, "i", playerid); //textdrawsautoskolaCVICISKO SetTimerEx("TextDrawAutoskola", 8000, false, "i", playerid); PlayerTextDrawShow(playerid, autoskola1[playerid]); PlayerTextDrawShow(playerid, autoskola2[playerid]); PlayerTextDrawShow(playerid, autoskola3[playerid]); PlayerTextDrawShow(playerid, autoskola4[playerid]); PlayerTextDrawShow(playerid, autoskola5[playerid]); PlayerTextDrawShow(playerid, autoskola6[playerid]); PlayerTextDrawShow(playerid, autoskola7[playerid]); PlayerTextDrawShow(playerid, autoskola8[playerid]); PlayerTextDrawShow(playerid, autoskola9[playerid]); PlayerTextDrawShow(playerid, autoskola10[playerid]); PlayerTextDrawShow(playerid, autoskola11[playerid]) } } case 1: { if (PlayerInfo[playerid][pVodickyC] == 1) { SetTimerEx("preukazy", 5000, false, "i", playerid); PlayerTextDrawShow(playerid, preukazvlastni1[playerid]); PlayerTextDrawShow(playerid, preukazvlastni[playerid]); SetPlayerPos(playerid,1170.7604,1353.1532,10.9219); } else if(GetPlayerMoney(playerid) < 9999) { SetTimerEx("Nedostatokpenazi", 5000, false, "i", playerid); PlayerTextDrawShow(playerid, nedostatokpenazi[playerid]); PlayerTextDrawShow(playerid, nedostatokpenazi1[playerid]); SetPlayerPos(playerid,1170.7604,1353.1532,10.9219); } else //když splňuje podmínky { GivePlayerMoney(playerid,-10000); //vezmem mu peníze autoskolac[playerid] = 16; autoskolacarc = CreateVehicle(403, 1139.6000000,1342.1000000,11.5000000,180.0000000, random(100), random(100), 1000); autoskolacarcnaves = CreateVehicle(435, 1139.6000000,1351.0000000,11.5000000,180.0000000, random(100), random(100), 1000); AttachTrailerToVehicle(autoskolacarcnaves, autoskolacarc); PutPlayerInVehicle(playerid, autoskolacarc,0); SetPlayerCheckpoint(playerid,1142.4054,1314.2500,11.4265,5.0); } } case 2: { } } } return 1; // We handled a dialog, so return 1. Just like OnPlayerCommandText. }
  17. No dokud si nezajistíš souhlas autora, tak do toho nikdo soudný nepůjde
  18. To logo malo jeden web, lenže ten už nejde. A chcel by som ho vektorové.
  19. ahá, já jsem tyjo nedělal pawn tak strašně dlouho, že už nevím jak to reaguje.
  20. To logo je tvoje ? Máš na něj práva ? Aby to nebylo jen kradení cizího loga. Taky zmiňuješ jak .psd tak .ai, z čehož plyne, že tak úplně nevíš, co přesně chceš. Chceš to logo vektorově, nebo bitmapově ? Nebo opravdu chceš to logo kreslit dvakrát, jednou tak a jednou tak ?
  21. presne tak, open,mp je uplne nový projekt kodovany od začiatku, nasledovník sa-mp, ktorý sa už vlasnte nevyvíja otázkou je ale, prečo sú dve verzie najnovšieho samp klienta (rozdiel je vo velkosti a tá prvá má MP v názve) prvá tu: https://www.sa-mp.mp/downloads/ druhá napr. tu: https://www.moddb.com/mods/san-andreas-multiplayer/downloads/sa-mp-037-r5
  22. Aha jasne Dakujem 😉 spravím urcite takto nakoľko tých preukazov plánujem viac
  23. Tento istý stock nie, pretože v ňom "natvrdo" používaš "pVodickyB". Ideálne by si mal spraviť stock, ktorý dostane ako parameter číslo 0/1 reprezentujúce, či hráč vlastní/nevlastní daný preukaz, a vráti text "Vlastni"/"Nevlastni". Napríklad: stock VlastniPreukaz(vlastni) { new text[10]; if (vlastni) text = "Vlastni"; else text = "Nevlastni"; return text; } // Použitie v kóde: VlastniPreukaz(PlayerInfo[playerid][pVodickyB]) // Alebo pre iný preukaz: VlastniPreukaz(PlayerInfo[playerid][pZbrojny])
  24. Ánoo, bez warningu... Ďakujem velmi pekne btw. tento isty stock môžem kludne využívat aj na dalšie preukazy priklad? .. alebo pri kazdom podobnom pripade novy stock ?
  25. Warning je spôsobený tým, že lokálna premenná "autoskolabb" má rovnaký názov ako stock "autoskolabb". Jedno z nich premenuj a warning by ti mal zmiznúť. K Hipovej odpovedi: Pawn compiler poskytnutý v zipe so serverom od sa-mp teamu má problémy s vracaním "string literal" - prestane reagovať. Mám pocit, že to je už vyriešené v compileri od Zeexa, ale nie som si istý.
  26. Aha, lenže pri tomto mi prestane reagovat pawno čím by to mohlo byt?
  27. funkce ti může vrátit null a zároveň autoskolabb není potřeba: stock autoskolabb(playerid) { if(IsPlayerConnected(playerid)) { if(PlayerInfo[playerid][pVodickyB] == 0) { return "Nevlastni"; } else { return "Vlastni"; } } }
  28. Čaute chalani už som písal v predchadzajucom topicu že by som potreboval pomôct s premenou hodnoty na text. Nakoniec som sa dva dni trápil xD a spravil niečo takéto .. stock autoskolabb(playerid) { new autoskolabb[25]; if(IsPlayerConnected(playerid)) { if(PlayerInfo[playerid][pVodickyB] == 0) autoskolabb = "Nevlastni"; if(PlayerInfo[playerid][pVodickyB] == 1) autoskolabb = "Vlastni"; } return autoskolabb; } ... Nakoniec to aj funguje ale stale mi to píše tento warning .. vedel by niekto čo s tym? C:\Users\42195\OneDrive\Plocha\Nový priečinok (3)\gamemodes\moj.pwn(126) : warning 219: local variable "autoskolabb" shadows a variable at a preceding level Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase 1 Warning.
  1. Load more activity
×
×
  • Create New...