Jurajvocny 0 Odesláno: 7. Listopad, 2015 Share Odesláno: 7. Listopad, 2015 Čaute. Ja by som sa chcel opytať ze ako by sa dali spraviť titul. Teraz to mám takto. public OnPlayerText(plaerid, text[]) { if(PlayerInfo[playerid][pAdminLevel] == 0) { new s[200]; format(s,200,""COL_YELLOW"[ Hráč ] %s "COLOR_WHITE": %s",PlayerName(playerid),text); SendClientMessageToAll(-1,s)- return 0; } return 1; } Teraz to je tak ze [ Hráč ] a meno hráča je žlté a text bieli. Ale ja to chcem taj aby [ Hráč ] bolo žltím a meno hráča farbou ktoru ma a môže si ju zmeniť. Ďakujem. Ps: pisal som to na mobili tak sa ospravedlnujem za chiby. Link to comment Share on other sites More sharing options...
0 Amenadiel 286 Odesláno: 7. Listopad, 2015 Share Odesláno: 7. Listopad, 2015 if(PlayerInfo[playerid][pAdminLevel] == 0) { new s[200]; format(s,200,""COL_YELLOW"[ Hráč ] %s "COLOR_WHITE": %s",PlayerName(playerid),text); SendClientMessageToAll(-1,s)- return 0; } if(PlayerInfo[playerid][pAdminLevel] == 1) { new s[200]; format(s,200,""COL_YELLOW"[ OhOhMyGod! Level One!] %s "COLOR_WHITE": %s",PlayerName(playerid),text); SendClientMessageToAll(-1,s)- return 0; } Link to comment Share on other sites More sharing options...
0 Scydo 397 Odesláno: 7. Listopad, 2015 Share Odesláno: 7. Listopad, 2015 (upraveno) ~> Ach jo, to šetření si práce a paměti... to šetření... if (!PlayerInfo[playerid][pAdminLevel]) { new sString[144 + 1]; format(sString, sizeof(sString), "[ Hráč ] %s {FFFFFF}: %s",PlayerName(playerid), text); SendClientMessageToAll(0xFFFF0000, sString); return false; } /* :-----------------------------: */ if (PlayerInfo[playerid][pAdminLevel]) { new sString[144 + 1]; format(sString, sizeof(sString), "[ OhOhMyGod! Level One!] %s {FFFFFF}: %s",PlayerName(playerid), text); SendClientMessageToAll(0xFFFF0000, sString); return false; } ~> Pro další levely u druhé podmínky jen přidáš operátory a čísla. A ani jeden z vas mu neponuze s cim chce pomoct format(s, 200, ""COL_YELLOW"[ Hráč ] {%06x}%s "COLOR_WHITE": %s", PlayerName(playerid), GetPlayerColor(playerid) >>> 8, text); if (!PlayerInfo[playerid][pAdminLevel]) { new sString[144 + 1]; format(sString, sizeof(sString), "[ Hráč ] {%06x}%s {FFFFFF}: %s", GetPlayerColor(playerid) >>> 8, PlayerName(playerid), text); SendClientMessageToAll(0xFFFF0000, sString); return false; } Edited 7. Listopad, 2015 by SkiBig18 Link to comment Share on other sites More sharing options...
0 Lukasz 336 Odesláno: 7. Listopad, 2015 Share Odesláno: 7. Listopad, 2015 (upraveno) A ani jeden z vas mu nepomuze s cim chce pomoct format(s, 200, ""COL_YELLOW"[ Hráč ] {%06x}%s "COLOR_WHITE": %s", GetPlayerColor(playerid) >>> 8, PlayerName(playerid), text); //EDIT: ups Edited 8. Listopad, 2015 by Lukasz Link to comment Share on other sites More sharing options...
0 Scydo 397 Odesláno: 7. Listopad, 2015 Share Odesláno: 7. Listopad, 2015 (upraveno) A ani jeden z vas mu neponuze s cim chce pomoct ~> Já pomáhal ušetřit . btw prohození Edited 7. Listopad, 2015 by SkiBig18 Link to comment Share on other sites More sharing options...
0 Amenadiel 286 Odesláno: 8. Listopad, 2015 Share Odesláno: 8. Listopad, 2015 ~> Ach jo, to šetření si práce a paměti... to šetření... if (!PlayerInfo[playerid][pAdminLevel]) { new sString[144 + 1]; format(sString, sizeof(sString), "[ Hráč ] %s {FFFFFF}: %s",PlayerName(playerid), text); SendClientMessageToAll(0xFFFF0000, sString); return false; } /* :-----------------------------: */ if (PlayerInfo[playerid][pAdminLevel]) { new sString[144 + 1]; format(sString, sizeof(sString), "[ OhOhMyGod! Level One!] %s {FFFFFF}: %s",PlayerName(playerid), text); SendClientMessageToAll(0xFFFF0000, sString); return false; } ~> Pro další levely u druhé podmínky jen přidáš operátory a čísla. if (!PlayerInfo[playerid][pAdminLevel]) { new sString[144 + 1]; format(sString, sizeof(sString), "[ Hráč ] {%06x}%s {FFFFFF}: %s", GetPlayerColor(playerid) >>> 8, PlayerName(playerid), text); SendClientMessageToAll(0xFFFF0000, sString); return false; } když už mluvíš o šetření. dá se tam udělat i jenom jedna proměna se stringem. Link to comment Share on other sites More sharing options...
0 Scydo 397 Odesláno: 8. Listopad, 2015 Share Odesláno: 8. Listopad, 2015 když už mluvíš o šetření. dá se tam udělat i jenom jedna proměna se stringem. ~> Já vím. Já pracoval s tím, co jsem dostal. A když už tom tak pěkně mluvíš, proč jsi to rovnou neudělal sám? . Link to comment Share on other sites More sharing options...
0 Amenadiel 286 Odesláno: 8. Listopad, 2015 Share Odesláno: 8. Listopad, 2015 ~> Já vím. Já pracoval s tím, co jsem dostal. A když už tom tak pěkně mluvíš, proč jsi to rovnou neudělal sám? . platí mě snad zato ? nebudu jim tu dávat 420 MLG PRO optimalizovanej code Link to comment Share on other sites More sharing options...
0 Jurajvocny 0 Odesláno: 8. Listopad, 2015 Author Share Odesláno: 8. Listopad, 2015 OK. Ďakujem všetkým. Link to comment Share on other sites More sharing options...
Dotaz
Jurajvocny 0
Čaute. Ja by som sa chcel opytať ze ako by sa dali spraviť titul.
Teraz to mám takto.
public OnPlayerText(plaerid, text[])
{
if(PlayerInfo[playerid][pAdminLevel] == 0)
{
new s[200];
format(s,200,""COL_YELLOW"[ Hráč ] %s "COLOR_WHITE": %s",PlayerName(playerid),text);
SendClientMessageToAll(-1,s)-
return 0;
}
return 1;
}
Teraz to je tak ze [ Hráč ] a meno hráča je žlté a text bieli.
Ale ja to chcem taj aby [ Hráč ] bolo žltím a meno hráča farbou ktoru ma a môže si ju zmeniť.
Ďakujem.
Ps: pisal som to na mobili tak sa ospravedlnujem za chiby.
Link to comment
Share on other sites
8 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