Unkown Command
#1

Hello, Me again. Im using /giveskin to set players skin, Now I wanted to save it for if a player goes on duty or something,

But ingame it gives me unknown command.
Code:

PHP код:
CMD:giveskin(playeridparams[])
{
    new 
name[MAX_PLAYER_NAME];
    new 
id;
    new 
skin;
    if(
IsPlayerConnected(id))
    {
        if(
PlayerInfo[playerid][AdminLevel] >= 2)
        {
            if(!
sscanf(params"ui"idskin))
            {
                if((
skin >= && skin <= 300))
                {
                    
GetPlayerName(playerid,name);
                    
format(file,sizeof(file),"realityrp/users/%s.ini",name);
                    new 
string[64];
                    new 
name[MAX_PLAYER_NAME];
                    
GetPlayerName(playeridnamesizeof(name));
                    
format(stringsizeof(string), "%s"skin);
                    
SetPlayerSkin(idskin);
                    
format(string2sizeof(string), "%s"skin);
                    
dini_IntSet(file"Skin",PlayerInfo[playerid][Skin] = skin);
                    return 
1;
                }
                else return 
SendClientMessage(playerid0xD8D8D8FF"Skin ID must be >1   300<");
            }
            else return 
SendClientMessage(playerid0xD8D8D8FF"USAGE: /giveskin [PlayerId/PartOfName] [Skin ID]");
        }
        else return 
SendClientMessage(playerid0xD8D8D8FF"You are not allowed to use this command");
    }
    else return 
SendClientMessage(playerid0xD8D8D8FF"Player Is Not Connected");

Reply
#2

you arepbbly using 2 command proccessor in the same gamemode
Reply
#3

no, I made this gamemode from scratch and im using zcmd + sscanf all the time
Reply
#4

you sure you put sscanf plugin whenyou load server.cfg
Reply
#5

yeah.. Every other command works.. just this one gives me this error
Reply
#6

pawn Код:
CMD:giveskin(playerid, params[])
{
    new name[MAX_PLAYER_NAME];
    new id;
    new skin;
    if(IsPlayerConnected(id))
    {
        if(PlayerInfo[playerid][AdminLevel] >= 2)
        {
            if(!sscanf(params, "ui", id, skin))
            {
                if((skin >= 1 && skin <= 300))
                {
                    GetPlayerName(playerid,name);
                    format(file,sizeof(file),"realityrp/users/%s.ini",name);
                    new string[64];
                    new name[MAX_PLAYER_NAME];
                    GetPlayerName(playerid, name, sizeof(name));
                    format(string, sizeof(string), "%s", skin);
                    SetPlayerSkin(id, skin);
                    format(string2, sizeof(string), "%s", skin);
                    dini_IntSet(file, "Skin",PlayerInfo[playerid][Skin] = skin);
                    return 1;
                }
                else return SendClientMessage(playerid, 0xD8D8D8FF, "Skin ID must be >1   300<");
            }
            else return SendClientMessage(playerid, 0xD8D8D8FF, "USAGE: /giveskin [PlayerId/PartOfName] [Skin ID]");
        }
        else return SendClientMessage(playerid, 0xD8D8D8FF, "You are not allowed to use this command");
    }
    else return SendClientMessage(playerid, 0xD8D8D8FF, "Player Is Not Connected");
    return 1; // MISSED IT HERE :)
}
Reply
#7

I thought i'd post this to save you some hassle later on with invalid skin ID's....


pawn Код:
if(skin < 0 || skin > 299 || skin == 74) return SendClientMessage(playerid, Dred, "Invalid skin.");
Reply


Forum Jump:


Users browsing this thread: 4 Guest(s)