INVALID_PLAYER_ID
#9

Quote:
Originally Posted by Mahzen
View Post
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(playeridparams[])
{
    new 
ID strval(params);
    if(
ID == INVALID_PLAYER_ID)) return errormessage(playerid,"/gotoplayer -ID-");
    if(!
IsPlayerConnected(ID)) return errormessage(playerid,"No players found");
    new 
FloatPos[3];
    
GetPlayerPos(IDPos[0], Pos[1], Pos[2]);
    
SetPlayerPos(playeridPos[0] + 2Pos[1], Pos[2]);
    
SendClientMessage(playeridCOLOR_ADMIN"Teleported");
    return 
true;

Reply


Messages In This Thread
INVALID_PLAYER_ID - by Mahzen - 14.04.2020, 10:40
Re: INVALID_PLAYER_ID - by Runn3R - 14.04.2020, 10:42
Re: INVALID_PLAYER_ID - by Mahzen - 14.04.2020, 10:46
Re: INVALID_PLAYER_ID - by jasperschellekens - 14.04.2020, 10:48
Re: INVALID_PLAYER_ID - by Mahzen - 14.04.2020, 10:50
Re: INVALID_PLAYER_ID - by jasperschellekens - 14.04.2020, 10:52
Re: INVALID_PLAYER_ID - by Mahzen - 14.04.2020, 11:02
Re: INVALID_PLAYER_ID - by Calisthenics - 15.04.2020, 07:08
Re: INVALID_PLAYER_ID - by DmitriyShift - 15.04.2020, 09:28
Re: INVALID_PLAYER_ID - by Mahzen - 19.04.2020, 02:48

Forum Jump:


Users browsing this thread: 1 Guest(s)