SA-MP Forums Archive
SSCANF update 7 error - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: SSCANF update 7 error (/showthread.php?tid=324429)



SSCANF update 7 error - Smally - 09.03.2012

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


Re: SSCANF update 7 error - Austin - 09.03.2012

Update your sscanf plugin you silly monkey.