Scrash 0 Odesláno: 14. Listopad, 2009 Share Odesláno: 14. Listopad, 2009 Takze, připravil jsem si pro vás takový mini tut, jak mít ID hráče pře zprávou (normálně i v teamchatu), je to sice naprosto jednoduché, ale pro začátečníka užitečné... Do public OnPlayerText(playerid, text[]) si vložíme tento kód: if(text[0] == '!') { // ! (vykřičník) značí, čím budeme psát do teamchatu new string[256]; //Maximální proměná stringu new name[24]; //Proměná jména GetPlayerName(playerid, name, 24); //Veme hráčovo jméno format(string, sizeof(string), "[TEAM CHAT] [%d] %s: %s", playerid, name, text[1]); //Formát textu (má své uspořádání !!) for(new i = 0; i < MAX_PLAYERS; i++) { // Definice lidí na serveru if(IsPlayerConnected(i)) { // Podmínka aby nepadal server, odešle zprávu jen připojeným hráčům if(proměnáp == Proměnáp[playerid]) //Zde nastavte proměnou povolání SendClientMessage(i, GetPlayerColor(playerid), string); //Výtisk zprávy } } return 0; } else { // Načtení druhého obsahu, pokud první nevyhovuje (MUSÍ BÝT JAKO DRUHÝ !!) new string[256]; //maximální proměná stringu format(string, sizeof(string), "[%d] %s", playerid, text); //formát textu (má své uspořádání !!) SendPlayerMessageToAll(playerid, string); //výtisk textu } //Konec funkce Celé by to mělo vypadat takto: public OnPlayerText(playerid, text[]){ if(text[0] == '!') { new string[256]; new name[24]; GetPlayerName(playerid, name, 24); format(string, sizeof(string), "[TEAM CHAT] [%d] %s: %s", playerid, name, text[1]); for(new i = 0; i < MAX_PLAYERS; i++) { if(IsPlayerConnected(i)) { if(zamestnani[i] == zamestnani[playerid]) SendClientMessage(i, GetPlayerColor(playerid), string); } } return 0; } else { new string[256]; format(string, sizeof(string), "[%d] %s", playerid, text); SendPlayerMessageToAll(playerid, string); } return 0; } Link to comment Share on other sites More sharing options...
daniele_pvk 0 Odesláno: 14. Listopad, 2009 Share Odesláno: 14. Listopad, 2009 Dobrý , a jeste lepsi by bylo kdo to udelal rict ! Link to comment Share on other sites More sharing options...
Scrash 0 Odesláno: 14. Listopad, 2009 Author Share Odesláno: 14. Listopad, 2009 Ten teamchat je od chytraka, zbytek sjem dodelal sam Link to comment Share on other sites More sharing options...
daniele_pvk 0 Odesláno: 14. Listopad, 2009 Share Odesláno: 14. Listopad, 2009 JJ dobrý .. a nechtěl bys mi pomoc zlobí mi "Konverzace s NPC" Link to comment Share on other sites More sharing options...
Scrash 0 Odesláno: 14. Listopad, 2009 Author Share Odesláno: 14. Listopad, 2009 Jaj, o NPC nic moc nevim, pravě delám můj první mód a k NPC jsem se ještě nedostal, ale myslim, ze uz je tu na to nekde TuT Link to comment Share on other sites More sharing options...
SKMatoBB 0 Odesláno: 12. Říjen, 2010 Share Odesláno: 12. Říjen, 2010 ja nechcem teamchat ale len to ID pred spravou ale nejako to neviem oddelit prosim pomozte Link to comment Share on other sites More sharing options...
Guest Frodo Odesláno: 12. Říjen, 2010 Share Odesláno: 12. Říjen, 2010 ja nechcem teamchat ale len to ID pred spravou ale nejako to neviem oddelit prosim pomozte new string[256]; format(string, sizeof(string), "[%d] %s", playerid, text); SendPlayerMessageToAll(playerid, string); Link to comment Share on other sites More sharing options...
Guest Odesláno: 12. Říjen, 2010 Share Odesláno: 12. Říjen, 2010 a kde je nick hráča ? to pošle iba [0] ahoj fero [1] ahoj qwer [50] ale ktože to prišiel že fero vitaj Link to comment Share on other sites More sharing options...
SKMatoBB 0 Odesláno: 12. Říjen, 2010 Share Odesláno: 12. Říjen, 2010 ja nechcem teamchat ale len to ID pred spravou ale nejako to neviem oddelit prosim pomozte new string[256]; format(string, sizeof(string), "[%d] %s", playerid, text); SendPlayerMessageToAll(playerid, string); jj skusal som ale ono to napise do chatu toto: SKMatoBB: [0] test SKMatoBB: test Link to comment Share on other sites More sharing options...
Guest Frodo Odesláno: 12. Říjen, 2010 Share Odesláno: 12. Říjen, 2010 Ja nevim proc to ten expert cpal do jednoho scriptu Link to comment Share on other sites More sharing options...
SKMatoBB 0 Odesláno: 12. Říjen, 2010 Share Odesláno: 12. Říjen, 2010 Ja nevim proc to ten expert cpal do jednoho scriptu ja taky ne Link to comment Share on other sites More sharing options...
C3RN3J 0 Odesláno: 15. Říjen, 2010 Share Odesláno: 15. Říjen, 2010 me to haze error C:\Users\Jiří\Desktop\C3RN3J.pwn(711) : error 029: invalid expression, assumed zero C:\Users\Jiří\Desktop\C3RN3J.pwn(711) : error 029: invalid expression, assumed zero C:\Users\Jiří\Desktop\C3RN3J.pwn(719) : error 017: undefined symbol "zamestnani" C:\Users\Jiří\Desktop\C3RN3J.pwn(719) : warning 215: expression has no effect C:\Users\Jiří\Desktop\C3RN3J.pwn(719) : error 001: expected token: ";", but found "]" C:\Users\Jiří\Desktop\C3RN3J.pwn(719) : error 029: invalid expression, assumed zero C:\Users\Jiří\Desktop\C3RN3J.pwn(719) : fatal error 107: too many error messages on one line Link to comment Share on other sites More sharing options...
Danny 37 Odesláno: 15. Říjen, 2010 Share Odesláno: 15. Říjen, 2010 smula... neměl si mi hackovat server 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