CMD:sendtols Error, doesn't work?
#1

pawn Код:
CMD:sls(playerid, params[])
{
        new giveplayerid, string[256];
        if(PlayerInfo[playerid][pAdmin] <= 2) return SendClientMessage(playerid, COLOR_LIGHTRED, "NICE!!! You can't use this command!");
        if(sscanf(params,"i",giveplayerid)) return SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /sls [playerid/PartOfName]");
        if(PlayerInfo[playerid][pAdmin] >= 3)
        {
            if(giveplayerid != INVALID_PLAYER_ID)
            {
                if (GetPlayerState(giveplayerid) == 2)
                {
                    new tmpcar = GetPlayerVehicleID(giveplayerid);
                    SetVehiclePos(tmpcar, 1529.6,-1691.2,13.3);
                    TelePos[giveplayerid][0] = 0.0;TelePos[giveplayerid][1] = 0.0;
                    LinkVehicleToInterior(tmpcar, 0);
                    SafeSetPlayerInterior(giveplayerid, 0);
                    SetPlayerVirtualWorld(giveplayerid, 0);
                    OnPlayerExitFood(giveplayerid);
                    new y, m, d;
                    new h,mi,s;
                    getdate(y,m,d);
                    gettime(h,mi,s);
                }
            }
            else
            {
                SafeSetPlayerPos(giveplayerid, 1529.6,-1691.2,13.3);
                SafeSetPlayerInterior(giveplayerid, 0);
                SetPlayerVirtualWorld(giveplayerid, 0);
            }
            ABroadCast(COLOR_LIGHTRED,string, 5);
            SafeSetPlayerInterior(giveplayerid,0);
            SetPlayerVirtualWorld(giveplayerid, 0);
            DisablePlayerCheckpoint(giveplayerid);
            new y, m, d;
            new h,mi,s;
            getdate(y,m,d);
            gettime(h,mi,s);
        }
        else
        {
            format(string, sizeof(string), "[SERVER]: PlayerID-%d is not an active player/playerid.", giveplayerid);
            SendClientMessage(playerid, COLOR_WHITE, string);
        }
    }
    return 1;
}
do you know why this doesn't work?
Reply
#2

The "i" specifier only get's the ID use the "u" specifier
pawn Код:
if(sscanf(params,"u",giveplayerid))
Reply
#3

Quote:
Originally Posted by DaRk_RaiN
Посмотреть сообщение
The "i" specifier only get's the ID use the "u" specifier
pawn Код:
if(sscanf(params,"u",giveplayerid))
That wouldn't cause the command to not work.

How exactly doesn't it work? Does it show unknown cmd?
Reply
#4

Fixed it.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)