Mikoo 8 Odesláno: 2. Duben, 2016 Share Odesláno: 2. Duben, 2016 (upraveno) Zdravím, Dnes som si chcel spraviť, že keď hráč príde na server tak mu to dá pred meno Titul, ale ako som to skúšal nejde mi to... [/font] public OnPlayerText(playerid, text[]) { new str[144],name[24]; GetPlayerName(playerid, name, 24); format(str, sizeof (str), "[DriftLife] %s [%d]%s",name,playerid,text); SendClientMessageToAll(plyerid, str); return 0; } Edited 2. Duben, 2016 by Mikoo Link to comment Share on other sites More sharing options...
0 Scydo 397 Odesláno: 2. Duben, 2016 Share Odesláno: 2. Duben, 2016 ~> Ve formátování máš 3 specifikátory, ale dosazuješ za ně pouze 2 proměnné. Link to comment Share on other sites More sharing options...
0 Mikoo 8 Odesláno: 2. Duben, 2016 Author Share Odesláno: 2. Duben, 2016 Takže to "name" tam nemá byť ? Alebo ja nechapem ptm. Link to comment Share on other sites More sharing options...
0 Amenadiel 286 Odesláno: 2. Duben, 2016 Share Odesláno: 2. Duben, 2016 (upraveno) už nic.. pozdě jsem napsal.. Edited 2. Duben, 2016 by Steam wallet Link to comment Share on other sites More sharing options...
0 Scydo 397 Odesláno: 2. Duben, 2016 Share Odesláno: 2. Duben, 2016 ~> Teď po editaci to máš správně, ale v SCMTA není 1. parametr id hráče ale hex barvy. Link to comment Share on other sites More sharing options...
0 Mikoo 8 Odesláno: 2. Duben, 2016 Author Share Odesláno: 2. Duben, 2016 Aha, takže teraz by to už malo isť ? Link to comment Share on other sites More sharing options...
0 Scydo 397 Odesláno: 2. Duben, 2016 Share Odesláno: 2. Duben, 2016 ~> Ale neeee... proč jsi to mazal? Teď se ti ta zpráva neodešle už vůbec... Link to comment Share on other sites More sharing options...
0 Mikoo 8 Odesláno: 3. Duben, 2016 Author Share Odesláno: 3. Duben, 2016 (upraveno) Ja som stoho maďar .. najprv treba nastaviť titul,farbu, nick, id a text ? Helpne mi stím niekdo ? Edited 2. Duben, 2016 by Mikoo Link to comment Share on other sites More sharing options...
0 Scydo 397 Odesláno: 3. Duben, 2016 Share Odesláno: 3. Duben, 2016 ale v SCMTA není 1. parametr id hráče ale hex barvy. Link to comment Share on other sites More sharing options...
0 Quiter 99 Odesláno: 3. Duben, 2016 Share Odesláno: 3. Duben, 2016 SendClientMessageToAll(GetPlayerColor(playerid), str); // Ak som správne čítal na wikine, tak musíš pri pripojení hráča udať jeho farbu (SetPlayerColor) inak to bude odosielať nesprávnu farbu! Link to comment Share on other sites More sharing options...
0 BTomas 0 Odesláno: 3. Duben, 2016 Share Odesláno: 3. Duben, 2016 onplayertext.. new string[128]; GetPlayerName(playerid, pname, sizeof(pname)); format(string, sizeof(string), "[DriftLife] %s(%d): %s", pname, playerid, params); SCMTA(Player, string); nejsem si jistý.. Link to comment Share on other sites More sharing options...
0 Lukasz 336 Odesláno: 3. Duben, 2016 Share Odesláno: 3. Duben, 2016 Kdyz si nejses jisty, tak radeji nic nepis, protoze je to bs. 2 Link to comment Share on other sites More sharing options...
0 Invouk 91 Odesláno: 3. Duben, 2016 Share Odesláno: 3. Duben, 2016 (upraveno) new str[144],name[24]; GetPlayerName(playerid, name, 24); format(str, sizeof (str), "[DriftLife] %s [%d]%s",name,playerid,text); SendClientMessageToAll(-1, str); Skus to takto, SCMTA, odkedy má SprávaVšetkým obsahovať playerid ? /wiki/Function:SendClientMessageToAll Edited 3. Duben, 2016 by eXpresS Link to comment Share on other sites More sharing options...
0 Amenadiel 286 Odesláno: 3. Duben, 2016 Share Odesláno: 3. Duben, 2016 new str[144],name[24]; GetPlayerName(playerid, name, 24); format(str, sizeof (str), "[DriftLife] %s [%d]%s",name,playerid,text); SendClientMessageToAll(-1, str); Skus to takto, SCMTA, odkedy má SprávaVšetkým obsahovať playerid ? /wiki/Function:SendClientMessageToAll i když tam bude playerid je to pořád jen číslo.. jako tvoje -1. tak to bude mít nejspíše černou barvu Link to comment Share on other sites More sharing options...
0 Scydo 397 Odesláno: 3. Duben, 2016 Share Odesláno: 3. Duben, 2016 i když tam bude playerid je to pořád jen číslo.. jako tvoje -1. tak to bude mít nejspíše černou barvu Bílou. Link to comment Share on other sites More sharing options...
0 Amenadiel 286 Odesláno: 3. Duben, 2016 Share Odesláno: 3. Duben, 2016 Bílou. špatně jsem to napsal.. myslel jsem to playerid že nejspíše bude mít černou. Link to comment Share on other sites More sharing options...
0 Mikoo 8 Odesláno: 3. Duben, 2016 Author Share Odesláno: 3. Duben, 2016 Skúšal som tam aj to SendClientMessageToAll(-1,string); ale ani neodoslalo správu len v server logu bola napisana, ale furt to je tak ako som to skúšal aj ja .. Tu je screen: http://m.imgur.com/a2QOAJD Link to comment Share on other sites More sharing options...
0 Scydo 397 Odesláno: 3. Duben, 2016 Share Odesláno: 3. Duben, 2016 public OnPlayerText(playerid, text[]) { new sString[144 + 1], sNick[MAX_PLAYER_NAME + 1]; GetPlayerName(playerid, sNick, sizeof(sNick)); format(sString, sizeof(sString), "[DriftLife] %s [%d]%s", sNick, playerid, text); SendClientMessageToAll(GetPlayerColor(playerid), sString); return false; } ~> A konec dohadů snad už... Link to comment Share on other sites More sharing options...
0 Mikoo 8 Odesláno: 3. Duben, 2016 Author Share Odesláno: 3. Duben, 2016 Skúšal som aj to, ale stale to iste.. Link to comment Share on other sites More sharing options...
0 Quiter 99 Odesláno: 3. Duben, 2016 Share Odesláno: 3. Duben, 2016 Skúšal som aj to, ale stale to iste.. nemôže ti to robiť to isté... Skopíruj si celý kód od SiBiga a skús to... Ak máš v OnPlayerText ešte iné skripty, postni ich sem pretože boh vie s čím to ty kombinuješ... Ten RETURN FALSE na konci má svoj zmysel, tak sa pozri či tam nemáš TRUE Link to comment Share on other sites More sharing options...
0 Mikoo 8 Odesláno: 3. Duben, 2016 Author Share Odesláno: 3. Duben, 2016 (upraveno) Nemám tam žiadne iné scripty a return false tam mám.. A spravil som to podla SkiBig18.. + tu je screen: http://imgur.com/jHYPgE7 Edited 3. Duben, 2016 by Mikoo Link to comment Share on other sites More sharing options...
0 rEf 53 Odesláno: 3. Duben, 2016 Share Odesláno: 3. Duben, 2016 (upraveno) Celkem zbytečné tohle dávat před nick už je s toho důvodu že to krade zbytečně znaky v chatu. Ale když už tak systém který by dovolil nastavit a měnit tituly a ukládal je po případě je dát na label nad hráčovo postavu. :-) Za pár kaček bych to udělal během dne buď s ukládáním do MYSQL nebo souboru po případě že by si chtěl vytváření hodností. No dneska si málo kdo zaplatí ty dvě tři stovky za plně funkční systém. :-D Edited 3. Duben, 2016 by rEf Link to comment Share on other sites More sharing options...
0 Mikoo 8 Odesláno: 3. Duben, 2016 Author Share Odesláno: 3. Duben, 2016 To nevadi, že to kradne znaky v chate, ale chcel by som to tam mať.. Len nejak sa nedari.. Link to comment Share on other sites More sharing options...
0 rEf 53 Odesláno: 3. Duben, 2016 Share Odesláno: 3. Duben, 2016 stock PlayerName(playerid){ // stock new name[MAX_PLAYER_NAME]; // new a string GetPlayerName(playerid, name, sizeof(name)); // zjištění jména dle id a zapsání na name return name; // vypíše jméno stock } public OnPlayerText(playerid, text[]){ new s[128]; // new a string format(s, sizeof(s), "[DriftLife] %s(%d): %s", PlayerName(playerid), playerid, text); // format SendClientMessageToAll(-1, s); // pošle zprávu všem hráčům -1 je barva můžeš nahradit GetPlayerColor return false; // false tam je aby to nepsalo 2x do chatu } Link to comment Share on other sites More sharing options...
0 Mikoo 8 Odesláno: 3. Duben, 2016 Author Share Odesláno: 3. Duben, 2016 Stále nič... A to som skúšal aj na samotnom FS.. Link to comment Share on other sites More sharing options...
0 rEf 53 Odesláno: 3. Duben, 2016 Share Odesláno: 3. Duben, 2016 No moment :-D Ale ve scriptu problém není je to celkem dost easy věc. Spíš by mě zajímalo kam to dáváš a jakým způsobem. Link to comment Share on other sites More sharing options...
Dotaz
Mikoo 8
Zdravím,
Dnes som si chcel spraviť, že keď hráč príde na server tak mu to dá pred meno Titul, ale ako som to skúšal nejde mi to...
[/font]
Edited by MikooLink to comment
Share on other sites
45 odpovědí na tuto otázku
Recommended Posts