Skin command help - 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: Skin command help (
/showthread.php?tid=136123)
Skin command help -
FireFox_ - 23.03.2010
I know its a simple command but i have a problem when i type like /skin 289 (and i set the limit of skin 0-28
it sets the skin but it should return and send a inavlid skin id message.
CODE:
pawn Код:
stock InvalidSkinId(playerid)
{
  new skin = GetPlayerSkin(playerid);
  if(skin < 0 || skin > 288) return SendClientMessage(playerid, WHITE, "Invalid skin id");
  return 0;
}
pawn Код:
dcmd_skin(playerid, params[])
{
  new skinid;
  if(sscanf(params, "i", skinid)) return SendClientMessage(playerid, WHITE, "USAGE: /skin <skinid>");
  else if(InvalidSkinId(playerid)) return false;
  {
SetPlayerSkin(playerid, skinid);
}
return 1;
}
Re: Skin command help -
Torran - 23.03.2010
Quote:
Originally Posted by <Krys>
pawn Код:
dcmd_skin(playerid, params[]) { Â Â new skinid; Â Â if(sscanf(params, "i", skinid)) return SendClientMessage(playerid, WHITE, "USAGE: /skin <skinid>"); Â Â if(InvalidSkinId(playerid)) return false;
SetPlayerSkin(playerid, skinid); return 1; }
|
Try that ive edited it
Re: Skin command help -
FireFox_ - 23.03.2010
Nope its the same. I type /skin 289 and it sets cj skin and when i try again like /skin 50 or whatever number it says invalid skin id.
Re: Skin command help -
adsy - 23.03.2010
pawn Код:
dcmd_skin(playerid, params[])
{
 new skinid;
 skinid=strval(params);
 if(skinid < 0 && skinid > 288) {
  SendClientMessage(playerid, WHITE, "Invalid skin id");
 }
 else {
  SetPlayerSkin(playerid, skinid);
 }
 return 1;
}
any better?