Unkown Command - 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: Unkown Command (
/showthread.php?tid=311290)
Unkown Command -
milanosie - 15.01.2012
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(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");
}
Re: Unkown Command -
vassilis - 15.01.2012
you arepbbly using 2 command proccessor in the same gamemode
Re: Unkown Command -
milanosie - 15.01.2012
no, I made this gamemode from scratch and im using zcmd + sscanf all the time
Re: Unkown Command -
vassilis - 15.01.2012
you sure you put sscanf plugin whenyou load server.cfg
Re: Unkown Command -
milanosie - 15.01.2012
yeah.. Every other command works.. just this one gives me this error
Re: Unkown Command -
Snowman12 - 15.01.2012
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 :)
}
Re: Unkown Command -
[ABK]Antonio - 16.01.2012
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.");