chytrak 14 Odesláno: 28. Červenec, 2008 Share Odesláno: 28. Červenec, 2008 Na hodně forech jsem viděl jak jsi udělat povolani, ale vsechny byli tak zakladni, a nedovysvetlene, tak sem si pripravil vlastni.. Definice pick upu Nejdříve si musíme nadefinovat pickup, viz tutorial od mavericka Pickup by Maverick po nadefinovani pickupu si vytvorime promenou,kterou budeme pouzivat v celem modu Zakladni promene nahoru do modu dame new iPlayerRole[MAX_PLAYERS]; poznamka: misto "iPlayerRole" muzeme dat cokoliv, napr: povolani,tym atd.. Varovani pokud zmenite promenou v definici musite ji zmenit i v mode do publicu public OnPlayerConnect(playerid) si dáme kod iPlayerRole[playerid]=0; 0 je vychozi povolani, rikejte si tomu jak chcete napr. nezamestnany,socka atd Vstup do pick upu v nadefinovaneml pick upu, ve kterem se ma hraci zprava psat viz tutorial od mavericka , vyse v tutorialu public OnPlayerPickUpPickup(playerid, pickupid) { if(pickupid == Pickup[0]) { SendClientMessage(playerid,COLOR_YELLOW,"Napis /join nebo /pridat aby si se pridal k DOPLNTE."); } Nadefinovany funkce, kterou budem zjistovat zda je hrac v pick upu nahoru do modu forward IsPlayerInSphere(playerid,Float:x,Float:y,Float:z,radius); forward GetPlayerDistanceToPointEx(playerid,Float:x,Float:y,Float:z); uplne dolu do modu nakonec public IsPlayerInSphere(playerid,Float:x,Float:y,Float:z,radius) { if(GetPlayerDistanceToPointEx(playerid,x,y,z) < radius){ return 1; } return 0; } public GetPlayerDistanceToPointEx(playerid,Float:x,Float:y,Float:z) { new Float:x1,Float:y1,Float:z12,Float:tmpdis; GetPlayerPos(playerid,x1,y1,z12); tmpdis = floatsqroot(floatpower(floatabs(floatsub(x,x1)), 2)+floatpower(floatabs(floatsub(y,y1)), 2)+floatpower(floatabs(floatsub(z,z12)),2)); return floatround(tmpdis); } Prikaz do publicu public OnPlayerCommandText(playerid, cmdtext[]) dame prikaz na pridani do povolani if((strcmp(cmdtext,"/join", true)==0)||(strcmp(cmdtext, "/pridat", true)==0)) //vyvolani prikazu join nebo pridat { new string[256]; if(IsPlayerInAnyVehicle(playerid)) // podminka kdyz je hrac v aute { RemovePlayerFromVehicle(playerid); //odstrani hrace z auta } if (IsPlayerInSphere(playerid,Float:X,Float:Y,Float:Z,Radius) == 1) { // kdyz je hrac v x,y,z (pozice pickupu) , radius = jak daleko nejvic muze byt od pick upu vzdalen, ja davam2 if(iPlayerRole[playerid]==PROMENA){ // kdyz uz v povolani je SendClientMessage(playerid,BARVA_ZPRAVY," Již jsi zaměstnán u tohoto povolani."); //zprava o tom ze uz v tom povolani pracuje } else { //opak podminky ze uz pracuje new pname[MAX_PLAYER_NAME]; // definice jmena GetPlayerName(playerid, pname, MAX_PLAYER_NAME); // zjisteni hracova jmena format(string, sizeof(string), "Hráč %s se přidal k DOPLNTE.", pname); // format zpravy SendClientMessageToAll(BARVA_ZPRAVY, string);// odesle zpravu vsem SetPlayerColor(playerid,BARVA_HRACE); //nastavi hraci barvu SetSpawnInfo(playerid,1,ID SKINU,Float:X,Float:Y,Float:Z,0,0,0,0,0,0); //nastavi hraci spawn info,id kinu, souradnice SetPlayerInterior(playerid,0); //Nastavi hraci interior 0 aby se predeslo bugum SpawnPlayer(playerid);// Spawne hrace iPlayerRole[playerid]=PROMENA; }} // ukonceni podminek return 1; //zakonceni prikazu } * PROMENA = Cislo povolani, pro kazde nove povolani pouzijete novou promenou pro vychozi povolani pouzijeme 0, pro dalsi 1 dalsi 2 dalsi 3 atd. takze nase promena pri prvnim povolani bude 1, protoze je to prvni povolani poznamka: jak zjistit x,y,z nadefinovaneho pick upu, kdyz mame nadefinovaný pick up, kde chceme aby se příkaz zadával příklad //pick up ve, kterem pujde zadat prikaz Pickup[0] = CreatePickup(1274, 1,1519.4808,1053.7301,10.8203); Pickup[0] = CreatePickup(id , typ,X ,Y ,Z); Spawn Nyní si nastavíme co se bude dít po spawnu hrace s novým povolanim do publicu public OnPlayerSpawn(playerid) dáme if (iPlayerRole[playerid] == 1)// podminka kdyz tym hrace rovna se promene { //co se bude dit kdyz ma hrac promenou 1 SetPlayerPos(playerid,X,Y,Z); // kde chcete, aby se po spawnu objevil ResetPlayerWeapons(playerid); //vymaze hraci zbrane GivePlayerWeapon(playerid, id zbrane, pocet naboju); // da hraci zbran } // zakonceni podminky id zbraní naleznete zde Link to comment Share on other sites More sharing options...
Frajtr 8 Odesláno: 10. Říjen, 2009 Share Odesláno: 10. Říjen, 2009 good Link to comment Share on other sites More sharing options...
癌癌癌 1 Odesláno: 10. Říjen, 2009 Share Odesláno: 10. Říjen, 2009 good Sice je to stary toipic ale budiž... Link to comment Share on other sites More sharing options...
Psychedelic 13 Odesláno: 10. Říjen, 2009 Share Odesláno: 10. Říjen, 2009 good Sice je to stary toipic ale budiž... j ale je to tut ten slouží dobu po napsání Link to comment Share on other sites More sharing options...
Guest Calebs Odesláno: 15. Říjen, 2009 Share Odesláno: 15. Říjen, 2009 Chtěl bych se zeptat, jestli by se dalo do toho pickup dát příkaz /uniforma a že by tam byly v kodu 3 skiny, ale pokaždé by se to měnilo jednou by dostal uniformu třeba policajta a podruhou třeba fbi, ale musela by tam být podmínka aby to /uniforma mohl dát jen účastník daného povolání Link to comment Share on other sites More sharing options...
Mikser 0 Odesláno: 15. Říjen, 2009 Share Odesláno: 15. Říjen, 2009 Jasně že by šlo, jen tam hodit casy a bude to fakat , ten způsob na to najdeš někde v tutech, jen hledat Link to comment Share on other sites More sharing options...
Jean 0 Odesláno: 15. Říjen, 2009 Share Odesláno: 15. Říjen, 2009 Lepsi a prehlednej si je podle mne menu(na ktery sem tu taky nasel par dobrych tutu) To Calebs >>> Hledej v tutech "random" Link to comment Share on other sites More sharing options...
Mikser 0 Odesláno: 15. Říjen, 2009 Share Odesláno: 15. Říjen, 2009 Jean - v menu je to pěkný, ale k ničemu když to chce náhodně Link to comment Share on other sites More sharing options...
Guest Calebs Odesláno: 15. Říjen, 2009 Share Odesláno: 15. Říjen, 2009 No právě jsem to hledal a nenašel jsem to, jen to že tam je jeden skin, zkusím to povolání udělat přez menu, ale jak jsem se dívla, tak tam byl jen jeden skin a ještě k tomu tam nebyla položka uniforma s více skinama Link to comment Share on other sites More sharing options...
tbx 7 Odesláno: 18. Říjen, 2009 Share Odesláno: 18. Říjen, 2009 Kde najdu nadefinovani toho pickupu ?? ten tut od mavericka uz nefunguje Link to comment Share on other sites More sharing options...
Wonder_kakajda 0 Odesláno: 18. Říjen, 2009 Share Odesláno: 18. Říjen, 2009 tuna máš Pickupi http://www.pawno.cz/viewtopic.php?f=8&t=3632&start=0 Link to comment Share on other sites More sharing options...
tbx 7 Odesláno: 25. Říjen, 2009 Share Odesláno: 25. Říjen, 2009 mam problem C:\Documents and Settings\***\Plocha\***.pwn(299) : error 017: undefined symbol "X" C:\Documents and Settings\***\Plocha\***.pwn(309) : error 017: undefined symbol "X" radek 299> if (IsPlayerInSphere(playerid,Float:X,Float:Y,Float:Z,Radius) == 1) radek 309 > SetSpawnInfo(playerid,1,280,Float:X,Float:Y,Float:Z,0,0,0,0,0,0); co je špatně ? Link to comment Share on other sites More sharing options...
Guest Frodo Odesláno: 25. Říjen, 2009 Share Odesláno: 25. Říjen, 2009 Zrejmne by si tam mel napsat souradnice nebo nejaky cisla Link to comment Share on other sites More sharing options...
tbx 7 Odesláno: 25. Říjen, 2009 Share Odesláno: 25. Říjen, 2009 pise mi to "undefined symbol "X" " tak asi nemam neco nadefinovany (ten tut od mavericka nefunguje) Link to comment Share on other sites More sharing options...
Guest Crazy[Man] Odesláno: 29. Listopad, 2009 Share Odesláno: 29. Listopad, 2009 Mam Problem: Zakladni promene nahoru do modu dame Kód: new iPlayerRole[MAX_PLAYERS]; To Je Toto ? public OnGameModeInit() { // Don't use these lines if it's a filterscript SetGameModeText("Blank Script"); AddPlayerClass(0,-1972.5594,297.0089,35.1719,89.5753,0,0,0,0,0,0); return 1; } public OnGameModeExit() Kdyz tak Pls Jak To Tam Ma Byt Pls Dik Honza :opera: Link to comment Share on other sites More sharing options...
Guest lama Odesláno: 29. Listopad, 2009 Share Odesláno: 29. Listopad, 2009 #include new iPlayerRole[MAX_PLAYERS]; public OnGameModeInit() { // Don't use these lines if it's a filterscript SetGameModeText("nazev modut"); AddPlayerClass(0,-1972.5594,297.0089,35.1719,89.5753,0,0,0,0,0,0); return 1; } Link to comment Share on other sites More sharing options...
Guest Crazy[Man] Odesláno: 29. Listopad, 2009 Share Odesláno: 29. Listopad, 2009 pls co tam mam napsat kdyz jich chci udelat treba 16 Link to comment Share on other sites More sharing options...
Guest lama Odesláno: 29. Listopad, 2009 Share Odesláno: 29. Listopad, 2009 ":xz38b185]pls co tam mam napsat kdyz jich chci udelat treba 16 #include new iPlayerRole[MAX_PLAYERS]; new iPlayerRole2[MAX_PLAYERS]; new iPlayerRole3[MAX_PLAYERS]; Ale musis pak u toho scriptu zmenit iPlayerRole na ten co mas v new treba new polda[MAX_PLAYERS]; new swat[MAX_PLAYERS]; if(polda[playerid] == 1) { SendClientMessage(playerid, COLOR_RED, "Nejsi polda!!!"); if(swat[playerid] == 1) { SendClientMessage(playerid, COLOR_RED, "Nejsi swat!!!"); Link to comment Share on other sites More sharing options...
AvestX 5 Odesláno: 29. Listopad, 2009 Share Odesláno: 29. Listopad, 2009 ":1akreoca]pls co tam mam napsat kdyz jich chci udelat treba 16 IsPlayerRole[playerid] = 1; IsPlayerRole[playerid] = 2; IsPlayerRole[playerid] = 3; IsPlayerRole[playerid] = 4; IsPlayerRole[playerid] = 5; IsPlayerRole[playerid] = 6; IsPlayerRole[playerid] = 7; IsPlayerRole[playerid] = 8; IsPlayerRole[playerid] = 9; IsPlayerRole[playerid] = 10; IsPlayerRole[playerid] = 11; IsPlayerRole[playerid] = 12; IsPlayerRole[playerid] = 13; IsPlayerRole[playerid] = 14; IsPlayerRole[playerid] = 15; IsPlayerRole[playerid] = 16; IsPlayerRole[playerid] = 17; IsPlayerRole[playerid] = 18; IsPlayerRole[playerid] = 19; IsPlayerRole[playerid] = 20; IsPlayerRole[playerid] = 21; a tak dál Link to comment Share on other sites More sharing options...
Guest lama Odesláno: 29. Listopad, 2009 Share Odesláno: 29. Listopad, 2009 Aveste takhle by to mel kdyby to chtel na povolani, aby kdyz z povolani 1 prijde na povolani 2 aby se mu vymazala podminka 1. Ja mu to chtel vysvetlit rovnou kdyby delal nejake podminky Link to comment Share on other sites More sharing options...
AvestX 5 Odesláno: 29. Listopad, 2009 Share Odesláno: 29. Listopad, 2009 Je to kokotina co si napsal a když už tak at: new IsPlayerRoe[MAX_PLAYERS][20]; //třeba a pak dává IsPlayerRole[playerid][0] = 1; IsPlayerRole[playerid][1] = 1; a td ale de to do 19 ! Link to comment Share on other sites More sharing options...
zpatecnik 0 Odesláno: 29. Listopad, 2009 Share Odesláno: 29. Listopad, 2009 Tomu nerozumim: if(polda[playerid] == 1) //pokud je polda { SendClientMessage(playerid, COLOR_RED, "Nejsi polda!!!");//napis nejsi polda Jinak aveste on jich chtel 16!!! Nemusis se pradvadet Link to comment Share on other sites More sharing options...
AvestX 5 Odesláno: 29. Listopad, 2009 Share Odesláno: 29. Listopad, 2009 no nevadí xD aspon to nebude muset psát. ale nedávejte new IsPlayerRole1[MAX_PLAYERS]; new IsPlayerRole2[MAX_PLAYERS]; new IsPlayerRole3[MAX_PLAYERS]; new IsPlayerRole4[MAX_PLAYERS]; new IsPlayerRole5[MAX_PLAYERS]; new IsPlayerRole6[MAX_PLAYERS]; new IsPlayerRole7[MAX_PLAYERS]; new IsPlayerRole8[MAX_PLAYERS]; new IsPlayerRole9[MAX_PLAYERS]; new IsPlayerRole10[MAX_PLAYERS]; new IsPlayerRole11[MAX_PLAYERS]; new IsPlayerRole12[MAX_PLAYERS]; new IsPlayerRole13[MAX_PLAYERS]; new IsPlayerRole14[MAX_PLAYERS]; new IsPlayerRole15[MAX_PLAYERS]; new IsPlayerRole16[MAX_PLAYERS]; ale stačí new IsPlayerRole[MAX_PLAYERS][16]; Link to comment Share on other sites More sharing options...
Guest lama Odesláno: 29. Listopad, 2009 Share Odesláno: 29. Listopad, 2009 Rikam ze nemyslim povolani ale treba vic promen new ridicak[MAX_PLAYERS]; new letecak[MAX_PLAYERS]; new pas[MAX_PLAYERS]; Uz jsem mu to chtel rict jak na zakladni promeny a az potom by se ucil to co si tu vypisoval Link to comment Share on other sites More sharing options...
Guest Crazy[Man] Odesláno: 29. Listopad, 2009 Share Odesláno: 29. Listopad, 2009 Mam Tam Nejake Chybky Toto Tam Mam: --> #include new ochranka Letiste[MAX_PLAYERS] new popelar[MAX_PLAYERS] new osobni Ochranka[MAX_PLAYERS] new taxikar[MAX_PLAYERS] new opravar[MAX_PLAYERS] new pumpar[MAX_PLAYERS] new vojak[MAX_PLAYERS] new policajt[MAX_PLAYERS] new ridic Autobusu[MAX_PLAYERS] new bezdomec[MAX_PLAYERS] new lodni Sluzba[MAX_PLAYERS] new zachranar[MAX_PLAYERS] new ochranka[MAX_PLAYERS] new zahradnik[MAX_PLAYERS] new pohrebni sluzba[MAX_PLAYERS] new dealer aut[MAX_PLAYERS] A toto Jsou Chyby: --> C:\Users\Honza\Desktop\Untitled.pwn(2) : error 001: expected token: ";", but found "-identifier-" C:\Users\Honza\Desktop\Untitled.pwn(4) : error 001: expected token: ";", but found "new" C:\Users\Honza\Desktop\Untitled.pwn(6) : error 001: expected token: ";", but found "new" C:\Users\Honza\Desktop\Untitled.pwn(7) : error 001: expected token: ";", but found "new" C:\Users\Honza\Desktop\Untitled.pwn(8) : error 001: expected token: ";", but found "new" C:\Users\Honza\Desktop\Untitled.pwn(9) : error 001: expected token: ";", but found "new" C:\Users\Honza\Desktop\Untitled.pwn(10) : error 001: expected token: ";", but found "new" C:\Users\Honza\Desktop\Untitled.pwn(12) : error 001: expected token: ";", but found "new" C:\Users\Honza\Desktop\Untitled.pwn(14) : error 001: expected token: ";", but found "new" C:\Users\Honza\Desktop\Untitled.pwn(15) : error 021: symbol already defined: "ochranka" C:\Users\Honza\Desktop\Untitled.pwn(16) : error 001: expected token: ";", but found "new" C:\Users\Honza\Desktop\Untitled.pwn(17) : error 001: expected token: ";", but found "-identifier-" C:\Users\Honza\Desktop\Untitled.pwn(194) : warning 203: symbol is never used: "bezdomec" C:\Users\Honza\Desktop\Untitled.pwn(194) : warning 203: symbol is never used: "dealer" C:\Users\Honza\Desktop\Untitled.pwn(194) : warning 203: symbol is never used: "lodni" C:\Users\Honza\Desktop\Untitled.pwn(194) : warning 203: symbol is never used: "ochranka" C:\Users\Honza\Desktop\Untitled.pwn(194) : warning 203: symbol is never used: "opravar" C:\Users\Honza\Desktop\Untitled.pwn(194) : warning 203: symbol is never used: "osobni" C:\Users\Honza\Desktop\Untitled.pwn(194) : warning 203: symbol is never used: "pohrebni" C:\Users\Honza\Desktop\Untitled.pwn(194) : warning 203: symbol is never used: "policajt" C:\Users\Honza\Desktop\Untitled.pwn(194) : warning 203: symbol is never used: "popelar" C:\Users\Honza\Desktop\Untitled.pwn(194) : warning 203: symbol is never used: "pumpar" C:\Users\Honza\Desktop\Untitled.pwn(194) : warning 203: symbol is never used: "ridic" C:\Users\Honza\Desktop\Untitled.pwn(194) : warning 203: symbol is never used: "taxikar" C:\Users\Honza\Desktop\Untitled.pwn(194) : warning 203: symbol is never used: "vojak" C:\Users\Honza\Desktop\Untitled.pwn(194) : warning 203: symbol is never used: "zachranar" C:\Users\Honza\Desktop\Untitled.pwn(194) : warning 203: symbol is never used: "zahradnik" Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 12 Errors. Pls Jak To Ma Bejt Zprávně Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now