30.04.2013, 14:52
the hfind variable is global, and can be used by 1 player at a time only. i suggest to add
...to make a variable for each player. then you need to change each hfind by f.ex. hfind[playerid]:
can you please explain how the system is supposed to do? how does it work? especially the timer "findPlayer".
btw, there was a "possible unintented assignment" in if(hfind[playerid] = true), its supposed to be == for comparing values.
edit: editing my post, since i get what you want, i hope. done.
one trick for modifying a bollean (hfind), is to simply subtract it from 1.
1-0=1 and 1-1=0 an endless loop...
the question remains: whats the timer containing? is it removing the checkpoint?
pawn Код:
new hfind[MAX_PLAYERS];
pawn Код:
CMD:hfind(playerid,params[])
{
if(!IsPlayerAdmin(playerid)) return 1;//Rcon admin
hfind[playerid]=1-hfind[playerid];//this will trigger 1-0-1-0-1 etc.
if(hfind[playerid] == true)
{
new targetid; new Float:x, Float:y, Float:z;
if(sscanf(params,"u", targetid)) return SendClientMessage(playerid, -1, "Usage: /hfind (ID) ");
GetPlayerPos(targetid, x, y, z);
SetPlayerCheckpoint(playerid, x, y, z, 6.0);
SetTimerEx("findPlayer", 1000, 1, "ii", targetid, playerid);
}
else // if(hfind[playerid] == false)//not required, since the first "if" checks for the only truth. else its false here.
{
DisablePlayerCheckpoint(playerid);
}
return 1;
}
btw, there was a "possible unintented assignment" in if(hfind[playerid] = true), its supposed to be == for comparing values.
edit: editing my post, since i get what you want, i hope. done.
one trick for modifying a bollean (hfind), is to simply subtract it from 1.
1-0=1 and 1-1=0 an endless loop...
the question remains: whats the timer containing? is it removing the checkpoint?