FrOsTy14 4 Odesláno: 6. Prosinec, 2014 Share Odesláno: 6. Prosinec, 2014 Zdravím, prosím jestli by někdo přehodil tento kod na to že půjde jedině když bude admin lvl 3,4,5: { if(strcmp("/azbranao", cmdtext, true, 10) == 0) { MoveObject(brana, -1665.7998000,1420.9004000,138.1000100, 1); SendClientMessage(playerid, 0xFF000000,"Brána je otevřena!"); } } děkuji Link to comment Share on other sites More sharing options...
0 Lusky 4 Odesláno: 6. Prosinec, 2014 Share Odesláno: 6. Prosinec, 2014 Musíš si vytvoriť premennú a potom použiť kondíciu if. Link to comment Share on other sites More sharing options...
0 FrOsTy14 4 Odesláno: 6. Prosinec, 2014 Author Share Odesláno: 6. Prosinec, 2014 Musíš si vytvoriť premennú a potom použiť kondíciu if. Bohužel s přeměnými neumím. Uděláš mi to prosím tě ? Link to comment Share on other sites More sharing options...
0 Lusky 4 Odesláno: 6. Prosinec, 2014 Share Odesláno: 6. Prosinec, 2014 static JeHracAdmin[MAX_PLAYERS]; public OnPlayerCommandText(playerid, cmdtext[]) { if(!strcmp(cmdtext, "/prikaz", true)) { if(JeHracAdmin[playerid] > 2) // pokiaľ je jeho admin level vyšší ako 2 .. { // .. tak sa vykoná nejaká akcia. } return 1; } return 0; } Nezabudni niekde nastaviť hráčovi admin level. Link to comment Share on other sites More sharing options...
0 FrOsTy14 4 Odesláno: 6. Prosinec, 2014 Author Share Odesláno: 6. Prosinec, 2014 static JeHracAdmin[MAX_PLAYERS]; public OnPlayerCommandText(playerid, cmdtext[]) { if(!strcmp(cmdtext, "/prikaz", true)) { if(JeHracAdmin[playerid] > 2) // pokiaľ je jeho admin level vyšší ako 2 .. { // .. tak sa vykoná nejaká akcia. } return 1; } return 0; } Nezabudni niekde nastaviť hráčovi admin level. error 055: start of function body without function header error 010: invalid function or declaration error 010: invalid function or declaration error 010: invalid function or declaration error 010: invalid function or declaration code: { if(!strcmp(cmdtext, "/azbranao", true)) { if(JeHracAdmin[playerid] > 3) { MoveObject(brana, -1665.7998000,1420.9004000,138.1000100, 1); SendClientMessage(playerid, 0xFF000000,"Brána je otevřena!"); } return 1; } return 0; } { if(!strcmp(cmdtext, "/azbranaz", true)) { if(JeHracAdmin[playerid] > 3) { MoveObject(brana, -1665.7998000,1420.9004000,148.1000100, 1); SendClientMessage(playerid, 0xFF000000,"Brána je zavřena!"); } return 1; } return 0; } Link to comment Share on other sites More sharing options...
0 Lusky 4 Odesláno: 6. Prosinec, 2014 Share Odesláno: 6. Prosinec, 2014 { if(!strcmp(cmdtext, "/azbranao", true)) { if(JeHracAdmin[playerid] > 3) { MoveObject(brana, -1665.7998000,1420.9004000,138.1000100, 1); SendClientMessage(playerid, 0xFF000000,"Brána je otevřena!"); } return 1; } { if(!strcmp(cmdtext, "/azbranaz", true)) { if(JeHracAdmin[playerid] > 3) { MoveObject(brana, -1665.7998000,1420.9004000,148.1000100, 1); SendClientMessage(playerid, 0xFF000000,"Brána je zavřena!"); } return 1; } Link to comment Share on other sites More sharing options...
0 FrOsTy14 4 Odesláno: 6. Prosinec, 2014 Author Share Odesláno: 6. Prosinec, 2014 { if(!strcmp(cmdtext, "/azbranao", true)) { if(JeHracAdmin[playerid] > 3) { MoveObject(brana, -1665.7998000,1420.9004000,138.1000100, 1); SendClientMessage(playerid, 0xFF000000,"Brána je otevřena!"); } return 1; } { if(!strcmp(cmdtext, "/azbranaz", true)) { if(JeHracAdmin[playerid] > 3) { MoveObject(brana, -1665.7998000,1420.9004000,148.1000100, 1); SendClientMessage(playerid, 0xFF000000,"Brána je zavřena!"); } return 1; } error 030: compound statement not closed at the end of file (started at line 94) 94: if(!strcmp(cmdtext, "/azbranaz", true)) Link to comment Share on other sites More sharing options...
0 Lusky 4 Odesláno: 6. Prosinec, 2014 Share Odesláno: 6. Prosinec, 2014 Daj celý OnPlayerCommandText Link to comment Share on other sites More sharing options...
0 The hidden face 77 Odesláno: 6. Prosinec, 2014 Share Odesláno: 6. Prosinec, 2014 error 030: compound statement not closed at the end of file (started at line 94) 94: if(!strcmp(cmdtext, "/azbranaz", true)) Pokud je /azbranaz poslední příkaz v public OnPlayerCommandText(playerid, cmdtext[]) tak to musíš uzavřít --> tedy return 0; public OnPlayerCommandText(playerid, cmdtext[]) { if(!strcmp(cmdtext, "/azbranao", true)) { if(JeHracAdmin[playerid] > 3) { MoveObject(brana, -1665.7998000,1420.9004000,138.1000100, 1); SendClientMessage(playerid, 0xFF000000,"Brána je otevřena!"); } return 1; } if(!strcmp(cmdtext, "/azbranaz", true)) { if(JeHracAdmin[playerid] > 3) { MoveObject(brana, -1665.7998000,1420.9004000,148.1000100, 1); SendClientMessage(playerid, 0xFF000000,"Brána je zavřena!"); } return 1; } return 0; } Link to comment Share on other sites More sharing options...
0 FrOsTy14 4 Odesláno: 6. Prosinec, 2014 Author Share Odesláno: 6. Prosinec, 2014 Daj celý OnPlayerCommandText public OnPlayerCommandText(playerid, cmdtext[]) { if(!strcmp(cmdtext, "/azbranao", true)) { if(adminlvl[playerid] > 3) { MoveObject(brana, -1665.7998000,1420.9004000,138.1000100, 1); SendClientMessage(playerid, 0xFF000000,"Brána je otevřena!"); return 1; } } if(!strcmp(cmdtext, "/azbranaz", true)) { if(adminlvl[playerid] > 3) { MoveObject(brana, -1665.7998000,1420.9004000,148.1000100, 1); SendClientMessage(playerid, 0xFF000000,"Brána je zavřena!"); return 1; } } return 0; } Už mi to jde dát do amx ale když to napíšu do chatu tak mi to napíše Příkaz ......... neexistuje Link to comment Share on other sites More sharing options...
0 vladasavel 26 Odesláno: 6. Prosinec, 2014 Share Odesláno: 6. Prosinec, 2014 nevím jestli to má nějakej vliv na funkci ale nemá to být místo tohoto if(!strcmp(cmdtext, "/azbranao", true)) takto if(!strcmp( "/azbranao",cmdtext, true)) ? Link to comment Share on other sites More sharing options...
0 The hidden face 77 Odesláno: 6. Prosinec, 2014 Share Odesláno: 6. Prosinec, 2014 A co toto : if(!strcmp(cmdtext, "/azbranao", true,9)) takto if(!strcmp( "/azbranaz",cmdtext, true,9)) Já s strcmp moc nepracuju, tak nevím. Ale může se to hádat třeba s módem - alespoň mi to dělá dcmd. Příkazy z FS fungují ale z módu to už ne Link to comment Share on other sites More sharing options...
0 FrOsTy14 4 Odesláno: 6. Prosinec, 2014 Author Share Odesláno: 6. Prosinec, 2014 Nejde to. OMG!!! Link to comment Share on other sites More sharing options...
0 The hidden face 77 Odesláno: 6. Prosinec, 2014 Share Odesláno: 6. Prosinec, 2014 A jsi admin s levlem 3? Dal sis vůbec ten admin lvl? Link to comment Share on other sites More sharing options...
0 FrOsTy14 4 Odesláno: 6. Prosinec, 2014 Author Share Odesláno: 6. Prosinec, 2014 A jsi admin s levlem 3? Dal sis vůbec ten admin lvl? Jsem admin levl 5 Link to comment Share on other sites More sharing options...
0 The hidden face 77 Odesláno: 6. Prosinec, 2014 Share Odesláno: 6. Prosinec, 2014 Předpokládám, že máš rze... Takže admin system je rozdílný. Něco jiného je admin system v módu a ve fs. Aby ti to šlo, tak si ho musíš nastavit i v FS - ovšem budeš muset každému dávat 2 typy admin levlů - jeden k módu a druhý k bráně... Ovšem pokud máš .pwn soubor od svého módu ,tak to nebude problém... Link to comment Share on other sites More sharing options...
0 Globální moderátor bug 131 Odesláno: 6. Prosinec, 2014 Globální moderátor Share Odesláno: 6. Prosinec, 2014 Nejde to. OMG!!! tak skúšaj preboha, ešte povedz že oni za to môžu že ti to nejde Link to comment Share on other sites More sharing options...
0 FrOsTy14 4 Odesláno: 6. Prosinec, 2014 Author Share Odesláno: 6. Prosinec, 2014 Předpokládám, že máš rze... Takže admin system je rozdílný. Něco jiného je admin system v módu a ve fs. Aby ti to šlo, tak si ho musíš nastavit i v FS - ovšem budeš muset každému dávat 2 typy admin levlů - jeden k módu a druhý k bráně... Ovšem pokud máš .pwn soubor od svého módu ,tak to nebude problém... Takže kde to mám nastavit v tom fs? pwn od rze nemám. Link to comment Share on other sites More sharing options...
0 The hidden face 77 Odesláno: 6. Prosinec, 2014 Share Odesláno: 6. Prosinec, 2014 Ano vytvoř si třeba příkaz (v tom fs) /setlvl [id] [lvl] dej tam podmínku ,že hráč bude přihlášen za rcona a pak si nastav lvl a ulož to někam. Pak by ti to mělo šlapat. Link to comment Share on other sites More sharing options...
Dotaz
FrOsTy14 4
Zdravím, prosím jestli by někdo přehodil tento kod na to že půjde jedině když bude admin lvl 3,4,5:
Link to comment
Share on other sites
18 odpovědí na tuto otázku
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