29.03.2013, 14:30
hello how are you ?
i found this code in samp fourm but its work good for only 1 player if 2 player has joined and if player 1 showsup a textdraw (like /stats) and it wil shows up correctly and if player 1 use /stats again it will off but the problem is if player 1 has already used stats and if 2 at the same time shows up textdraw using /stats , and if player 1 wants to turn off textdraw and do /stats the textdraw wont off for him and player2 as well
i did used for(new i=0; i<=MAX_PLAYERS; i++) but i dont know how to use it correctly or is there any otehr way to solve it !
p.s : i will goto english class room
i found this code in samp fourm but its work good for only 1 player if 2 player has joined and if player 1 showsup a textdraw (like /stats) and it wil shows up correctly and if player 1 use /stats again it will off but the problem is if player 1 has already used stats and if 2 at the same time shows up textdraw using /stats , and if player 1 wants to turn off textdraw and do /stats the textdraw wont off for him and player2 as well
PHP код:
create a variable, like:
pawn Code:
new bool:textdrawon[MAX_PLAYERS];
OnPlayerConnect add:
pawn Code:
textdrawon[playerid] = false;
Then in your command add:
pawn Code:
if(textdrawon[playerid] == false)
{
TextDrawShowForPlayer(...);
textdrawon[playerid] = true;
}
else if(textdrawon[playerid] == true)
{
TextDrawHideForPlayer(....);
textdrawon[playerid] = false;
}
p.s : i will goto english class room