INVALID_PLAYER_ID
#6

Then you should check if they are spawned I think.


PHP Code:
public OnPlayerSpawn(playerid)
{
    if(
GetPVarInt(playerid"is_connected")==0SetPVarInt(playerid"is_connected"1); // set the pvar to 1 for the check later
    
return 1;
}

IsPlayerConnectedEx(playerid)
{
    if (
IsPlayerConnected(playerid)&&GetPVarInt(playerid"is_connected")==1&&playerid!=INVALID_PLAYER_ID) return 1;
    return 
0;
}

CMD:gotoplayer(playeridparams[])
{
    new 
IDstring[128];

    if(
sscanf(params"u"ID))
        return 
errormessage(playerid,"/gotoplayer -ID-");

    if(!
IsPlayerConnectedEx(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 
1;

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)