public OnPlayerText(playerid, text[])
{
if(Police[1])
{
if(strval(text) == 2)
{
SetPlayerArmour(playerid, 100);
SendClientMessage(playerid, COLOR_GREEN, "Your armour is now 100%");
}
if(strval(text) == 4)
{
SetPlayerHealth(playerid, 100);
SendClientMessage(playerid, COLOR_GREEN, "Your health is now 100%");
}
if(strval(text) == 3)
{
TextDrawHideForPlayer(playerid, Textdraw11);
TextDrawHideForPlayer(playerid, Textdraw12);
TextDrawHideForPlayer(playerid, Textdraw13);
TextDrawHideForPlayer(playerid, Textdraw14);
TextDrawHideForPlayer(playerid, Textdraw15);
TextDrawHideForPlayer(playerid, Textdraw16);
TextDrawHideForPlayer(playerid, Textdraw17);
TextDrawHideForPlayer(playerid, Textdraw18);
TextDrawHideForPlayer(playerid, Textdraw19);
TextDrawHideForPlayer(playerid, Textdraw20);
TextDrawHideForPlayer(playerid, Textdraw21);
TextDrawShowForPlayer(playerid, Textdraw22);
TextDrawShowForPlayer(playerid, Textdraw23);
TextDrawShowForPlayer(playerid, Textdraw24);
TextDrawShowForPlayer(playerid, Textdraw25);
TextDrawShowForPlayer(playerid, Textdraw26);
TextDrawShowForPlayer(playerid, Textdraw27);
TextDrawShowForPlayer(playerid, Textdraw28);
TextDrawShowForPlayer(playerid, Textdraw29);
if(strval(text) == 1) return GivePlayerWeapon(playerid, 24, 100);
if(strval(text) == 2) return GivePlayerWeapon(playerid, 31, 100);
if(strval(text) == 3) return GivePlayerWeapon(playerid, 34, 50);
}
if(strval(text) == 4)
{
SendClientMessage(playerid, COLOR_GOLD, "Coming Soon");
}
}
return 1;
}
if(Police[1])
if(faction[playerid]==1)
new Employment[MAX_PLAYERS]=0; // Not a cop
if(Employment[playerid] != 1) return SendClientMessage(playerid, -1, " You Not Police");
if(Employment[playerid] == 1)
// Code
Why are you using this in public OnPlayerText It is used to make tags in the chat or 3 d label texts and the variable is wrong to use
PHP код:
PHP код:
|
Do you even know how to even use arrays
FFS don't post up BROKEN NON-WORKING code.... This is as good as a tutorial from someone who doesn't have a clue on how to even do what they're trying to teach... |
Sorry I was not thinking straight I've already corrected the code.
|
Still not correct. You've even made the exact same mistake as you did with the prior code.
|
if(strval(text) == 3)
{
TextDrawHideForPlayer(playerid, Textdraw11);
TextDrawHideForPlayer(playerid, Textdraw12);
TextDrawHideForPlayer(playerid, Textdraw13);
TextDrawHideForPlayer(playerid, Textdraw14);
TextDrawHideForPlayer(playerid, Textdraw15);
TextDrawHideForPlayer(playerid, Textdraw16);
TextDrawHideForPlayer(playerid, Textdraw17);
TextDrawHideForPlayer(playerid, Textdraw18);
TextDrawHideForPlayer(playerid, Textdraw19);
TextDrawHideForPlayer(playerid, Textdraw20);
TextDrawHideForPlayer(playerid, Textdraw21);
TextDrawShowForPlayer(playerid, Textdraw22);
TextDrawShowForPlayer(playerid, Textdraw23);
TextDrawShowForPlayer(playerid, Textdraw24);
TextDrawShowForPlayer(playerid, Textdraw25);
TextDrawShowForPlayer(playerid, Textdraw26);
TextDrawShowForPlayer(playerid, Textdraw27);
TextDrawShowForPlayer(playerid, Textdraw28);
TextDrawShowForPlayer(playerid, Textdraw29);
if(strval(text) == 1) return GivePlayerWeapon(playerid, 24, 100);
if(strval(text) == 2) return GivePlayerWeapon(playerid, 31, 100);
if(strval(text) == 3) return GivePlayerWeapon(playerid, 34, 50);
switch(strval(text))
{
case 1:
{
//shit
}
case etc...
}