SSCANF issues 0.3D
#1

Ever since i updated to 0.3D SSCANF keeps think that the ID im trying to go to is my ID. For an example.

My ID is 0.

I do

/goto 1 . It just brings it me to my self and it goes for every command.

Hes some Examples.

pawn Код:
CMD:boxhead(playerid,params[])
{
    if(PlayerInfo[playerid][pAdmin] >=5)
    {
        new Float:x, Float:y, Float:z;
        GetPlayerPos(playerid, x, y, z);
        AttachObjectToPlayer(BoxHead, playerid, x, y, z, 0, 0, 0 );
        SetPlayerAttachedObject(playerid, 3, 3800, 1);
    }
    return 1;
}
Reply
#2

This code doesn't make sense at all. :S
Reply
#3

Fuck, Wrong one.

Sorry lol

here

pawn Код:
CMD:setadmin(playerid,params[])
{
    if(PlayerInfo[playerid][pAdmin] >=10)
    {
        new id,level,n[MAX_PLAYER_NAME],on[MAX_PLAYER_NAME],string[128],string2[128];
        if (unformat(params,"ud[128]",id,level)) return SendClientMessage(playerid,COLOR_RED,"Usage:/setadmin [ID] [Admin Level]");
        if (id == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_RED, "System: Invalid ID");
        else
        {
            PlayerInfo[playerid][pAdmin] = level;
            GetPlayerName(playerid,n,sizeof(n));
            GetPlayerName(id,on,sizeof(on));
            format(string,sizeof(string),"Your Admin Level Has Been Set To %d By %s ",level,n);
            SendClientMessage(id,COLOR_ORANGE,string);
            format(string2, sizeof(string), "You have set %s Admin Level To %d",on,level);
            SendClientMessage(playerid,COLOR_ORANGE,string2);
            PlayerInfo[playerid][pAdmin] = level;
        }
    }
    return 1;
}
Reply
#4

You need to update the sscanf plugin every time you update your SA-MP server version. You can download the latest version from its release thread.
Reply
#5

I have used the

http://dl.dropbox.com/u/21683085/sscanf-0.3d.rar

Code.

(Update 4)
Reply
#6

Are you using 0.3d R2?
Reply
#7

pawn Код:
CMD:setadmin(playerid,params[])
{
    new id,level,n[MAX_PLAYER_NAME],on[MAX_PLAYER_NAME],string[128];
    if(PlayerInfo[playerid][pAdmin] < 10) return 1;
    if (sscanf(params,"ud",id,level)) return SendClientMessage(playerid,COLOR_RED,"Usage:/setadmin [ID] [Admin Level]");
    if (!IsPlayerConnected(id)) return SendClientMessage(playerid, COLOR_RED, "System: Invalid ID");
    PlayerInfo[id][pAdmin] = level;//Here you had playerid instead of id
    GetPlayerName(playerid,n,sizeof(n));
    GetPlayerName(id,on,sizeof(on));
    format(string,sizeof(string),"Your Admin Level Has Been Set To %d By %s ",level,n);
    SendClientMessage(id,COLOR_ORANGE,string);
    format(string, sizeof(string), "You have set %s Admin Level To %d",on,level);
    SendClientMessage(playerid,COLOR_ORANGE,string);
    //you had one additional Level setting here :S
    return 1;
}
Read comments
Reply
#8

I was screwing around with it and was able to make SSCANF work with some of the commands. Now it just makes it so i cannot use a command on myself
Reply


Forum Jump:


Users browsing this thread: 4 Guest(s)