setskin 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: setskin error (
/showthread.php?tid=214951)
setskin error -
Face9000 - 22.01.2011
pawn Код:
dcmd_setskin(playerid,params[])
{
new skin;
if (adminlevel[playerid] >= 2)
if(sscanf(params,"dd",player,skin)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /setskin [playerid] [skinid]");
if(!IsPlayerConnected(player)) return SendClientMessage(playerid, COLOR_WHITE, "Invalid Player ID.");
if(IsInvalidSkin(skin)) return SendClientMessage(playerid, COLOR_GREY, "* Invalid Skin ID");
SetPlayerSkin(player, skin);
return 1;
}
It returns me "Unknown command"
What's wrong?
Re: setskin error -
blackwave - 22.01.2011
On the callback OnPlayerCommandtext, add that line:
Also change your command for this one:
pawn Код:
dcmd_setskin(playerid,params[])
{
new skin;
if (adminlevel[playerid] < 2) return SendClientMessage(playerid,COLOR_WHITE,"You're not an admin");
if(sscanf(params,"dd",player,skin)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /setskin [playerid] [skinid]");
if(!IsPlayerConnected(player)) return SendClientMessage(playerid, COLOR_WHITE, "Invalid Player ID.");
if(IsInvalidSkin(skin)) return SendClientMessage(playerid, COLOR_GREY, "* Invalid Skin ID");
SetPlayerSkin(player, skin);
return 1;
}
Re: setskin error -
Face9000 - 22.01.2011
jajaja i've already added the dcmd(setskin
Thanks.