Command Problem
#1

pawn Код:
CMD:goto(playerid, params[])
{
    new Float:pX,Float:pY,Float:pZ, id;

    if(sscanf(params, "u", id)) SendClientMessage(playerid, LIGHTBLUE, "USAGE: {FFFFFF}/goto [playerid]");
    else if(id == INVALID_PLAYER_ID) SendClientMessage(playerid, ORANGERED, "ERROR: Invalid PlayerID");
    else
    {
        if (GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
        {
            GetPlayerPos(id,pX,pY,pZ);
            SetVehiclePos(GetPlayerVehicleID(playerid),pX,pY,pZ+2);
        }
        else
        {
            GetPlayerPos(id,pX,pY,pZ);
            SetPlayerPos(playerid,pX,pY,pZ+2);
        }
        SetPlayerInterior(playerid,GetPlayerInterior(id));
    }
    return 1;
}
I get no error from this code, but if i enter an invalid player id it doesent say Invalid PlayerID yet it teleports me somwhere in the map. I use zcmd and sscanf2 plugin for the command. Please help
Reply


Messages In This Thread
Command Problem - by Chris' - 20.03.2012, 18:22
Re: Command Problem - by Daddy Yankee - 20.03.2012, 18:27
Re: Command Problem - by Skribblez - 20.03.2012, 18:32
Re: Command Problem - by Chris' - 20.03.2012, 18:50
Re: Command Problem - by Skribblez - 20.03.2012, 18:58
Re: Command Problem - by Chris' - 20.03.2012, 19:17

Forum Jump:


Users browsing this thread: 1 Guest(s)