21.04.2017, 15:59
Tente assim, fiz isso no meio de uma partida de jogo :c
PHP код:
new Timer[MAX_PLAYERS];
new Float:Pos[3];
public OnPlayerEnterCheckpoint(playerid)
{
DisablePlayerCheckpoint(playerid);
SendClientMessage(playerid, -1, "Vocк chegou ate ele");
return 1;
}
CMD:localizar(playerid, params[])
{
new id,string[90];
if(sscanf(params), "d", id) return 1;
if(!IsPlayerConnected(id)) return 1;
format(string, sizeof(string), "Vocк localizou ID:%d",id);
GetPlayerPos(id, Pos[0], Pos[1], Pos[2]);
SetPlayerCheckpoint(playerid, Pos[0], Pos[1], Pos[2], 3.0);
Timer[playerid] = SetTimerEx("LocalizarP1", 1500, true, "i", id);
SetPVarFloat(playerid,"xpos",Pos[0]), SetPVarFloat(playerid,"ypos",Pos[1]), SetPVarFloat(playerid,"zpos",Pos[2]);
SendClientMessage(playerid,-1, string);
return 1;
}
forward LocalizarP1(playerid);
public LocalizarP1(playerid)
{
SetTimerEx("LocalizarP2", 100, false, "i", playerid);
return 1;
}
forward LocalizarP2(playerid);
public LocalizarP2(playerid)
{
SetPlayerCheckpoint(playerid, GetPVarFloat(playerid,"xpos"), GetPVarFloat(playerid,"ypos"), GetPVarFloat(playerid,"zpos"), 3.0);
return 1;
}