Tente dessa maneira:
Topo do GameMode
pawn Код:
new timer[500];
forward Procurar(playerid,give);
public Procurar(playerid,give)
{
if(!IsPlayerConnected(give)) {
KillTimer(timer[playerid]);
return SendClientMessage(playerid, COR_BRANCO, "O Player Desconecto");
}
static Float:X,Float:Y,Float:Z;
GetPlayerPos(give,X,Y,Z);
SetPlayerCheckpoint(playerid, X,Y,Z, 6);
return true;
}
Na
public OnPlayerCommandText()
pawn Код:
new cmd[128], idx;
cmd = strtok(cmdtext, idx);
if(strcmp(cmd,"/procurar",true) == 0)
{
new tmp[128];
new giveplayerid;
tmp = strtok(cmdtext, idx);
giveplayerid = strval(tmp);
if(!strlen(tmp)) return SendClientMessage(playerid,COR_BRANCO,"USO: /procurar [id]");
if(!IsPlayerConnected(giveplayerid)) return SendClientMessage(playerid, COR_BRANCO, "id invalido.");
new Float:X,Float:Y,Float:Z;
GetPlayerPos(giveplayerid, X,Y,Z);
SetPlayerCheckpoint(playerid, X,Y,Z, 6);
timer[playerid] = SetTimerEx("Procurar",4000,true,"ii",playerid,giveplayerid);
return 1;
}
Crйditos: [FeK]DraKiNs
Ou Tente dessa outra maneira
Topo do GameMode
pawn Код:
forward Checar(giveplayerid);
Na
public OnPlayerCommandText()
pawn Код:
if(strcmp(cmd, "/procurar", true) == 0)
{
if(IsPlayerConnected(playerid))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COR_CTP, "/procurar [Nick/ID]");
return 1;
}
giveplayerid = ReturnUser(tmp);
if(IsPlayerConnected(giveplayerid))
{
if(giveplayerid != INVALID_PLAYER_ID)
{
if(giveplayerid == playerid) { SendClientMessage(playerid, COLOR_GREY, "Vocк nгo pode se procurar!"); return 1; }
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
new Float:X,Float:Y,Float:Z;
GetPlayerPos(giveplayerid, X,Y,Z);
SetPlayerCheckpoint(playerid, X,Y,Z, 6);
SetTimer("Checar", 100, true);
ProcurarChecka[playerid] = 1;
}
}
else
{
SendClientMessage(playerid, COLOR_CTP, "Nome ou ID invalido");
}
}
return 1;
}
public Checar(giveplayerid)
{
static Float:X,Float:Y,Float:Z;
GetPlayerPos(giveplayerid, X,Y,Z);
SetPlayerCheckpoint(playerid, X,Y,Z, 6);
return true;
}
Crйditos: [Full]Garfield[XDB]