(Makes posibilty to Police can locate player, set marker on last players location so he can easly find him) if someone have part of code for /locate for police i will be grateful, thanks to all in advance
PHP код:
#include <a_samp>
#include sscanf
#include zcmd
new Float:CorX,Float:CorY,Float:CorZ;
new bool:GPS[MAX_PLAYERS];
new pname[MAX_PLAYER_NAME];
forward AtualizeLocal(playerid);
TimerAtualize[MAX_PLAYERS];
new str[60];
CMD:locate(playerid, params[])
{
new id;
if(GPS[playerid]== true)
{
DisablePlayerCheckpoint(playerid);
KillTimer(TimerAtualize[playerid]);
GPS[playerid]=false;
}
//variable PD
if(sscanf(params, "u", id))return SendClientMessage(playerid,-1,"/locate [id]");
if(!IsPlayerConnected(id))return SendClientMessage(playerid,-1,"ERROR! player off.");
GetPlayerPos(id, CorX, CorY, CorZ);
SetPlayerCheckpoint(playerid, CorX, CorY, -570.0, 1.0);
GetPlayerName(id, pname, 23);
format(str, sizeof(str), "[PD]: You found player %s[%d]!", pname, id);
SendClientMessage(playerid,-1,str);
TimerAtualize[id] = SetTimerEx("AtualizeLocal", 1000, true, "i", playerid);
GPS[playerid]=true;
return 1;
}
public AtualizeLocal(playerid)
{
DisablePlayerCheckpoint(playerid);
GetPlayerPos(playerid, CorX, CorY, CorZ);
SetPlayerCheckpoint(playerid, CorX, CorY, -570.0, 0.0);
return 1;
}