SSCANF update 7 error
#1

Hello, I want to update my server to 0.3dR2 and the only problem I've come across is SSCANF not working for playername but it works for player id. So here is one of the commands and stock that doesn't work.

pawn Код:
stock IsPlayerConnectedEx(const playerid) {
    if(IsPlayerConnected(playerid) && playerVariables[playerid][pStatus] == 1) return 1;
    return 0;
}
pawn Код:
CMD:spec(playerid, params[]) {
    if(playerVariables[playerid][pAdminLevel] >= 1) {
        new
            userID;

        if(sscanf(params, "u", userID)) {
            return SendClientMessage(playerid, COLOR_GREY, SYNTAX_MESSAGE"/spec [playerid]");
        }
        else if(!IsPlayerConnectedEx(userID)) {
            return SendClientMessage(playerid, COLOR_GREY, "The specified player is not connected, or has not authenticated.");
        }
        else {
            if(playerVariables[playerid][pSpectating] == INVALID_PLAYER_ID) { // Will only save pos/etc if they're NOT spectating. This will stop the annoying death/pos/int/VW/crash bugs everyone's experiencing...
                GetPlayerPos(playerid, playerVariables[playerid][pPos][0], playerVariables[playerid][pPos][1], playerVariables[playerid][pPos][2]);
                playerVariables[playerid][pInterior] = GetPlayerInterior(playerid);
                playerVariables[playerid][pVirtualWorld] = GetPlayerVirtualWorld(playerid);
                playerVariables[playerid][pSkin] = GetPlayerSkin(playerid);

                if(playerVariables[playerid][pAdminDuty] == 0) {
                    GetPlayerHealth(playerid, playerVariables[playerid][pHealth]);
                    GetPlayerArmour(playerid, playerVariables[playerid][pArmour]);
                }
            }
            playerVariables[playerid][pSpectating] = userID;
            TogglePlayerSpectating(playerid, true);

            SetPlayerInterior(playerid, GetPlayerInterior(userID));
            SetPlayerVirtualWorld(playerid, GetPlayerVirtualWorld(userID));

            if(IsPlayerInAnyVehicle(userID)) {
                PlayerSpectateVehicle(playerid, GetPlayerVehicleID(userID));
            }
            else {
                PlayerSpectatePlayer(playerid, userID);
            }
            if(playerVariables[userID][pTutorial] >= 1) {
                SendClientMessage(playerid, COLOR_GREY, "This player is currently in the tutorial.");
            }

            TextDrawShowForPlayer(playerid, textdrawVariables[4]);
        }
    }
    return 1;
}
Any help is really appreciated
Reply
#2

Update your sscanf plugin you silly monkey.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)