Algol 0 Odesláno: 18. Březen, 2012 Share Odesláno: 18. Březen, 2012 dobrý den mám problém chtěl sem udělat script aby se po napsání příkazu hráči přičetli životy a napsalo se o tom všem hráčům if (strcmp(cmdtext, "/zivoty", true) == 0) { SetPlayerHealth(playerid, 100); SendClientMessageToAll(0xF4F800FF, "Hrac %s si vzal zivoty"); return 1; } ale když ve hře napíšu /životy tak server spadne prosím pomozte předem děkuji Link to comment Share on other sites More sharing options...
0 XxM4st3rxX 3 Odesláno: 18. Březen, 2012 Share Odesláno: 18. Březen, 2012 if (strcmp(cmdtext, "/zivoty", true) == 0) { new zivoty[255] GetPlayerName(playerid, name, sizeof(name)); format(zivoty,sizeof(zivoty),"Hrac %s si vzal zivoty", playerid, name); SetPlayerHealth(playerid, 100); SendClientMessageToAll(0xF4F800FF, "Hrac %s si vzal zivoty"); return 1; } skus :mrgreen: :mrgreen: Link to comment Share on other sites More sharing options...
0 Mattsy 29 Odesláno: 18. Březen, 2012 Share Odesláno: 18. Březen, 2012 if (strcmp(cmdtext, "/zivoty", true) == 0) { SetPlayerHealth(playerid, 100); new string[128]; format(string, sizeof(string, "Hrac %s si vzal zivoty", PlayerName(playerid)); SendClientMessageToAll(0xF4F800FF, string); SetPlayerHealth(playerid, 100.0); return 1; } stock: stock PlayerName(playerid) { new name[MAX_PLAYER_NAME]; GetPlayerName(playerid, name, sizeof(name)); return name; } in7ive máš tam chyby :mrgreen: Link to comment Share on other sites More sharing options...
0 LYRIcS 88 Odesláno: 18. Březen, 2012 Share Odesláno: 18. Březen, 2012 dobrý den mám problém chtěl sem udělat script aby se po napsání příkazu hráči přičetli životy a napsalo se o tom všem hráčům if (strcmp(cmdtext, "/zivoty", true) == 0) { SetPlayerHealth(playerid, 100); SendClientMessageToAll(0xF4F800FF, "Hrac %s si vzal zivoty"); return 1; } ale když ve hře napíšu /životy tak server spadne prosím pomozte předem děkuji aby ti to ukazalo hracove meno musis text naformatovat if(!strcmp(cmdtext, "/zivoty", true)) { SetPlayerHealth(playerid, 100.0); new string[256], name[24]; GetPlayerName(playerid, name, 24); format(string, sizeof(string), "Hrac %s si vzal zivoty", name); SendClientMessageToAll(0xF4F800FF, string); return 1; } Link to comment Share on other sites More sharing options...
0 XxM4st3rxX 3 Odesláno: 18. Březen, 2012 Share Odesláno: 18. Březen, 2012 in7ive máš tam chyby :mrgreen: kua :mrgreen: Link to comment Share on other sites More sharing options...
0 G4NG 1 Odesláno: 18. Březen, 2012 Share Odesláno: 18. Březen, 2012 Lebo nemáš k %s priradené z čoho ma prečítať Buďto smaž %s a pridaj return alebo si sprav takto if (strcmp(cmdtext, "/zivoty", true) == 0)//podmienka ak je príkaz /zivoty { SetPlayerHealth(playerid, 100);//nastaví život na 100 new name[100];//vytvorí premennu name GetPlayerName(playerid,name,30);//zisti hráčovo meno a zapíše do premennej name SendClientMessageToAll(0xF4F800FF, "Hrac %s si vzal zivoty",name);//prečíta meno z premennej return 0;//vráti hodnotu na 0 } Link to comment Share on other sites More sharing options...
0 Algol 0 Odesláno: 18. Březen, 2012 Author Share Odesláno: 18. Březen, 2012 jsem začátečník a moc sem to nepochopil jak přesně to mam vložit? Link to comment Share on other sites More sharing options...
0 XxM4st3rxX 3 Odesláno: 18. Březen, 2012 Share Odesláno: 18. Březen, 2012 jsem začátečník a moc sem to nepochopil jak přesně to mam vložit? namiesto: if (strcmp(cmdtext, "/zivoty", true) == 0) { SetPlayerHealth(playerid, 100); SendClientMessageToAll(0xF4F800FF, "Hrac %s si vzal zivoty"); return 1; } dáš: if (strcmp(cmdtext, "/zivoty", true) == 0)//podmienka ak je príkaz /zivoty { SetPlayerHealth(playerid, 100);//nastaví život na 100 new name[100];//vytvorí premennu name GetPlayerName(playerid,name,30);//zisti hráčovo meno a zapíše do premennej name SendClientMessageToAll(0xF4F800FF, "Hrac %s si vzal zivoty",name);//prečíta meno z premennej return 0;//vráti hodnotu na 0 } :mrgreen: :mrgreen: Link to comment Share on other sites More sharing options...
0 Petr 44 Odesláno: 18. Březen, 2012 Share Odesláno: 18. Březen, 2012 Vidím, že tu je jeden expert vedle druhého. Udělej to jak píše Mattsy, ostatní píšou pičoviny. Mattsy tam akorát má 2x SetPlayerHealth, jednu z nich si smaž. Link to comment Share on other sites More sharing options...
0 Algol 0 Odesláno: 18. Březen, 2012 Author Share Odesláno: 18. Březen, 2012 to právě že nevím nevím co s tím stock Link to comment Share on other sites More sharing options...
0 Petr 44 Odesláno: 18. Březen, 2012 Share Odesláno: 18. Březen, 2012 Vlož ho někde do volného prostoru. Nechápu proč se nezeptáš hned. Link to comment Share on other sites More sharing options...
0 Algol 0 Odesláno: 18. Březen, 2012 Author Share Odesláno: 18. Březen, 2012 pod ten příkaz? pořád to nechápu začal sem s tím dnes Link to comment Share on other sites More sharing options...
0 Petr 44 Odesláno: 18. Březen, 2012 Share Odesláno: 18. Březen, 2012 Aha, tak si projdi základ Pawn. Link to comment Share on other sites More sharing options...
0 Mattsy 29 Odesláno: 18. Březen, 2012 Share Odesláno: 18. Březen, 2012 nie po príkaz, niekde mimo publicy, napr úplne na spodok módu Link to comment Share on other sites More sharing options...
0 Algol 0 Odesláno: 18. Březen, 2012 Author Share Odesláno: 18. Březen, 2012 a co teda s tím stockem? nemám ponětí kam ho dát a ten FS bych chtěl dodělat Link to comment Share on other sites More sharing options...
0 XxM4st3rxX 3 Odesláno: 18. Březen, 2012 Share Odesláno: 18. Březen, 2012 a co teda s tím stockem?nemám ponětí kam ho dát a ten FS bych chtěl dodělat nie pod príkaz, niekde mimo publicy, napr úplne na spodok módu :wtf: Link to comment Share on other sites More sharing options...
0 Algol 0 Odesláno: 18. Březen, 2012 Author Share Odesláno: 18. Březen, 2012 když dam dolů ten stock hází mi to errory když ne tak mam jen jeden v tom format(string, sizeof(string, "Hrac %s si vzal zivoty", PlayerName(playerid)); Link to comment Share on other sites More sharing options...
0 XxM4st3rxX 3 Odesláno: 18. Březen, 2012 Share Odesláno: 18. Březen, 2012 když dam dolů ten stock hází mi to errory když ne tak mam jen jeden v tom format(string, sizeof(string), "Hrac %s si vzal zivoty", PlayerName(playerid)); ak nepojde skus ten stock dat hore pod #include Link to comment Share on other sites More sharing options...
0 Algol 0 Odesláno: 18. Březen, 2012 Author Share Odesláno: 18. Březen, 2012 stock už jde ale pořád mám error v format(string, sizeof(string, "Hrac %s si vzal zivoty", PlayerName(playerid)); error 001: expected token: ")", but found "," Link to comment Share on other sites More sharing options...
0 XxM4st3rxX 3 Odesláno: 18. Březen, 2012 Share Odesláno: 18. Březen, 2012 stock už jde ale pořád mám error v format(string, sizeof(string, "Hrac %s si vzal zivoty", PlayerName(playerid)); error 001: expected token: ")", but found "," už som to písal v predošlom poste OMG format(string, sizeof(string), "Hrac %s si vzal zivoty", PlayerName(playerid)); Link to comment Share on other sites More sharing options...
0 Algol 0 Odesláno: 18. Březen, 2012 Author Share Odesláno: 18. Březen, 2012 díky všem už mi to jde Link to comment Share on other sites More sharing options...
Dotaz
Algol 0
dobrý den mám problém chtěl sem udělat script aby se po napsání příkazu hráči přičetli životy a napsalo se o tom všem hráčům
if (strcmp(cmdtext, "/zivoty", true) == 0)
{
SetPlayerHealth(playerid, 100);
SendClientMessageToAll(0xF4F800FF, "Hrac %s si vzal zivoty");
return 1;
}
ale když ve hře napíšu /životy tak server spadne
prosím pomozte předem děkuji
Link to comment
Share on other sites
20 odpovědí na tuto otázku
Recommended Posts