Stellet 7 Odesláno: 27. Prosinec, 2014 Share Odesláno: 27. Prosinec, 2014 Ahoj chtěl bych se zeptat jak udělat když admin udělá /ulozp tak to uloží port a hráči můžou /port Děkuju Link to comment Share on other sites More sharing options...
0 Lusky 4 Odesláno: 27. Prosinec, 2014 Share Odesláno: 27. Prosinec, 2014 Vytvor si premennú v ktorej uložíš pozíciu admina a potom vytvor príkaz ktorý teleportuje hráča k tej pozícii. Link to comment Share on other sites More sharing options...
0 Stellet 7 Odesláno: 27. Prosinec, 2014 Author Share Odesláno: 27. Prosinec, 2014 To fakt nevím jak na to Link to comment Share on other sites More sharing options...
0 Lusky 4 Odesláno: 27. Prosinec, 2014 Share Odesláno: 27. Prosinec, 2014 /* Je možné, že to nebude fungovať, robil som to narýchlo a z hlavy. Ak bude nejaký problém alebo potrebuješ ešte niečo, tak napíš. */ static Float:pP[3]; // Globálna premenná /* Do OnPlayerCommandText */ if(!strcmp(cmdtext, "/savep", true)) // Uloží pozíciu, môžeš pridať podmienku či je admin, môžeš povoliť port atď.. { GetPlayerPos(playerid, pP[0], pP[1], pP[2]); return 1; } if(!strcmp(cmdtext, "/gotoport", true)) // Teleportuje hráča na pozíciu { SetPlayerPos(playerid, pP[0], pP[1], pP[2]); return 1; } Link to comment Share on other sites More sharing options...
0 Stellet 7 Odesláno: 27. Prosinec, 2014 Author Share Odesláno: 27. Prosinec, 2014 Mám ještě prosbu, když uložím port tak aby jsem dal /porton a nebo /portoff jako že se portnout můžou a že ne děkuji moc Link to comment Share on other sites More sharing options...
0 Lusky 4 Odesláno: 27. Prosinec, 2014 Share Odesláno: 27. Prosinec, 2014 static bool PortState; // Globálna booleanová premenná if(!strcmp(cmdtext, "/porton", true)) { if(PortState == false) PortState = true; // Dovolíme hráčom použiť port if(PortState == true) PortState = false; // Zakážeme hráčom použiť port return 1; } /* Tým pádom sme urobili z dvoch príkazov jeden. */ /* Samozrejme musíme upraviť príkaz pomocou ktorého sa hráči teleportujú. */ if(!strcmp(cmdtext, "/gotoport", true)) // Teleportuje hráča na pozíciu { if(PortState == true) SetPlayerPos(playerid, pP[0], pP[1], pP[2]); // Teleportuje hráča ak je port povolený else SendClientMessage(playerid, -1, "Port nie je povolený"); // Ak nie, tak mu to napíše správu return 1; } Link to comment Share on other sites More sharing options...
0 Stellet 7 Odesláno: 27. Prosinec, 2014 Author Share Odesláno: 27. Prosinec, 2014 if(!strcmp(cmdtext, "/porton", true)){if(PortState == false) PortState = true; // Dovolíme hráčom použiť portif(PortState == true) PortState = false; // Zakážeme hráčom použiť portreturn 1;} Tím pádem ve hře dám jen /porton a pak znovu a je vyplej ? pomocí jednoho příkazu ? Link to comment Share on other sites More sharing options...
0 Lusky 4 Odesláno: 27. Prosinec, 2014 Share Odesláno: 27. Prosinec, 2014 Pokiaľ je vypnutý a ty napíšeš ten príkaz, tak sa zapne. Pokiaľ je zapnutý a ty napíšeš ten príkaz, tak sa vypne. Takže áno. Link to comment Share on other sites More sharing options...
0 Stellet 7 Odesláno: 27. Prosinec, 2014 Author Share Odesláno: 27. Prosinec, 2014 A mám errory Link to comment Share on other sites More sharing options...
0 Lusky 4 Odesláno: 27. Prosinec, 2014 Share Odesláno: 27. Prosinec, 2014 Tak ich sem napíš. Link to comment Share on other sites More sharing options...
0 Stellet 7 Odesláno: 27. Prosinec, 2014 Author Share Odesláno: 27. Prosinec, 2014 public OnPlayerText(playerid, text[]) { return 1; } static Float:pP[3]; static bool PortState; public OnPlayerCommandText(playerid, cmdtext[]) { if (strcmp("/ulozport", cmdtext, true, 10) == 0) { GetPlayerPos(playerid, pP[0], pP[1], pP[2]); return 1; } if (strcmp("/aport", cmdtext, true, 10) == 0) { if(PortState == true) SetPlayerPos(playerid, pP[0], pP[1], pP[2]); else SendClientMessage(playerid, -1, "Admin Port je vypnut"); } if (strcmp("/aporton", cmdtext, true, 10) == 0) { if(PortState == false) PortState = true; if(PortState == true) PortState = false; return 1; } return 0; } Errory: C:\Documents and Settings\User\Plocha\Samp map editor 0.3e v1.2\pawno\port.pwn(90) : error 001: expected token: ";", but found "-identifier-" C:\Documents and Settings\User\Plocha\Samp map editor 0.3e v1.2\pawno\port.pwn(90) : error 010: invalid function or declaration C:\Documents and Settings\User\Plocha\Samp map editor 0.3e v1.2\pawno\port.pwn(101) : error 017: undefined symbol "PortState" C:\Documents and Settings\User\Plocha\Samp map editor 0.3e v1.2\pawno\port.pwn(106) : error 017: undefined symbol "PortState" C:\Documents and Settings\User\Plocha\Samp map editor 0.3e v1.2\pawno\port.pwn(106) : error 017: undefined symbol "PortState" C:\Documents and Settings\User\Plocha\Samp map editor 0.3e v1.2\pawno\port.pwn(106) : warning 215: expression has no effect C:\Documents and Settings\User\Plocha\Samp map editor 0.3e v1.2\pawno\port.pwn(107) : error 017: undefined symbol "PortState" C:\Documents and Settings\User\Plocha\Samp map editor 0.3e v1.2\pawno\port.pwn(107) : error 017: undefined symbol "PortState" C:\Documents and Settings\User\Plocha\Samp map editor 0.3e v1.2\pawno\port.pwn(107) : warning 215: expression has no effect C:\Documents and Settings\User\Plocha\Samp map editor 0.3e v1.2\pawno\port.pwn(247) : warning 203: symbol is never used: "bool" Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase 7 Errors. Link to comment Share on other sites More sharing options...
0 Lusky 4 Odesláno: 27. Prosinec, 2014 Share Odesláno: 27. Prosinec, 2014 static bool:PortState; // Pridaj dvojbodku Zabudol som pridať dvojbodku, sorry Link to comment Share on other sites More sharing options...
0 Stellet 7 Odesláno: 27. Prosinec, 2014 Author Share Odesláno: 27. Prosinec, 2014 Tady jsou Ta tam je hned na public OnPlayerCommandText(playerid, cmdtext[]) Je to tam v code Link to comment Share on other sites More sharing options...
0 Lusky 4 Odesláno: 27. Prosinec, 2014 Share Odesláno: 27. Prosinec, 2014 static Float:pP[3]; static bool:PortState; public OnPlayerCommandText(playerid, cmdtext[]) { if (strcmp("/ulozport", cmdtext, true, 10) == 0) { GetPlayerPos(playerid, pP[0], pP[1], pP[2]); return 1; } if (strcmp("/aport", cmdtext, true, 10) == 0) { if(PortState == true) SetPlayerPos(playerid, pP[0], pP[1], pP[2]); else SendClientMessage(playerid, -1, "Admin Port je vypnut"); } if (strcmp("/aporton", cmdtext, true, 10) == 0) { if(PortState == false) PortState = true; if(PortState == true) PortState = false; return 1; } return 0; } Toto ti musí fungovať, mne to funguje. Link to comment Share on other sites More sharing options...
0 Mort 29 Odesláno: 27. Prosinec, 2014 Share Odesláno: 27. Prosinec, 2014 Takovej tip: if(PortState == false) PortState = true; else if(PortState == true) PortState = false; se dá zkrátit na: PortState = !PortState; Link to comment Share on other sites More sharing options...
0 Stellet 7 Odesláno: 27. Prosinec, 2014 Author Share Odesláno: 27. Prosinec, 2014 Už jde děkuju Link to comment Share on other sites More sharing options...
Dotaz
Stellet 7
Ahoj chtěl bych se zeptat jak udělat když admin udělá /ulozp tak to uloží port a hráči můžou /port
Děkuju
Link to comment
Share on other sites
15 odpovědí na tuto otázku
Recommended Posts