15.04.2020, 09:28
Quote:
Sometimes I get the error that the player was not found even though the player was in the game. It does this in all commands.
Command is running when the player logs in and out Please Help ![]() Code:
CMD:gotoplayer(playerid, params[]) { new ID, string[128]; if(sscanf(params, "u", ID)) return errormessage(playerid,"/gotoplayer -ID-"); if(ID == INVALID_PLAYER_ID) return errormessage(playerid,"No players found"); new Float:x, Float:y, Float:z; GetPlayerPos(ID, x, y, z); SetPlayerPos(playerid, x + 2, y, z); SendClientMessage(playerid, COLOR_ADMIN, "Teleported"); return 1; } |
PHP Code:
CMD:gotoplayer(playerid, params[])
{
new ID = strval(params);
if(ID == INVALID_PLAYER_ID)) return errormessage(playerid,"/gotoplayer -ID-");
if(!IsPlayerConnected(ID)) return errormessage(playerid,"No players found");
new Float: Pos[3];
GetPlayerPos(ID, Pos[0], Pos[1], Pos[2]);
SetPlayerPos(playerid, Pos[0] + 2, Pos[1], Pos[2]);
SendClientMessage(playerid, COLOR_ADMIN, "Teleported");
return true;
}