Skin command help
#1

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;
}


Reply
#2

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
Reply
#3

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.
Reply
#4

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?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)