30.11.2011, 19:12
I tried a lot but i just can't seem to let it work.
How can i let them trace continously so a moving (red) dot on the minimap the whole time, and when his phone is off. Its gone.
How can i let them trace continously so a moving (red) dot on the minimap the whole time, and when his phone is off. Its gone.
PHP код:
if(strcmp(cmd, "/find", true) == 0)
{
if(IsPlayerConnected(playerid))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_LIGHTYELLOW2, "[USAGE:] /find [playerid]");
return 1;
}
if(TrackingPlayer[playerid] == 1)
{
SendClientMessage(playerid, COLOR_LIGHTYELLOW2, "[ERROR:] Your already finding someone.");
return 1;
}
new id = strval(tmp);
if (PlayerInfo[playerid][pFaction] != 255 && DynamicFactions[PlayerInfo[playerid][pFaction]][fType] == 1||PlayerInfo[playerid][pFaction] != 255 && DynamicFactions[PlayerInfo[playerid][pFaction]][fType] == 2||PlayerInfo[playerid][pFaction] != 255 && DynamicFactions[PlayerInfo[playerid][pFaction]][fType] == 3||PlayerInfo[playerid][pJob] == 3)
{
if(IsPlayerConnected(id))
{
if(playerid != id)
{
if(id != INVALID_PLAYER_ID)
{
if(PhoneOnline[id] == 0)
{
SendClientMessage(id, COLOR_LIGHTYELLOW2, "[INFO:] Someone is tracking you.");
format(string, sizeof(string), "[INFO:] Your tracking %s, checkpoint removed in 60 seconds.", GetPlayerNameEx(id));
SendClientMessage(playerid, COLOR_LIGHTYELLOW2, string);
new Float:x,Float:y,Float:z;
GetPlayerPos(id,x,y,z);
SetPlayerCheckpoint(playerid,x,y,z,10.0);
SetTimerEx("ClearCheckpointsForPlayer", 60000, false, "i", playerid);
TrackingPlayer[playerid] = 1;
}
else
{
SendClientMessage(id, COLOR_LIGHTYELLOW2, "[ERROR:] That players phone is not turned on! You cannot track it.");
}
}
}
else
{
SendClientMessage(id, COLOR_LIGHTYELLOW2, "[ERROR:] You can't track yourself.");
}
}
else
{
SendClientMessage(playerid, COLOR_LIGHTYELLOW2, "[ERROR:] Invalid Player ID.");
}
}
else
{
SendClientMessage(playerid, COLOR_LIGHTYELLOW2, "[ERROR:] You are not eligible to use this command!");
}
}
return 1;
}