[HELP] Skin Change
#2

Use sscanf to separate command from parameters.
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
  new command[32], params[128], string[128], tmp[128], idx;
  sscanf(cmdtext,"ss",command,params);
  if(strcmp(cmd, "/clothes", true) == 0)
  {
    if(PlayerInfo[playerid][pMember] >= 1)
    {
      if(IsAtClothShop(playerid))
      {
        SetPlayerSkin(playerid, strval(params);
      }
      else
      {
        SendClientMessage(playerid, COLOR_GRAD2, "  You are not in a Clothing Shop !");
        return 1;
      }
    }
    else
    {
      if(PlayerInfo[playerid][pLeader] != 0)
      {
        SendClientMessage(playerid, COLOR_GRAD2, "  You can't change your clothes while you are a leader !");
        return 1;
      }
      if(IsAtClothShop(playerid))
      {
        SetPlayerSkin(playerid, strval(params);
      }    
    }
  }
  return 1;
}
https://sampwiki.blast.hk/wiki/Sscanf and you should consider dcmd/zcmd https://sampwiki.blast.hk/wiki/Fast_Commands
Reply


Messages In This Thread
[HELP] Skin Change - by joeri55 - 15.12.2009, 21:59
Re: [HELP] Skin Change - by Cezar - 15.12.2009, 22:17
Re: [HELP] Skin Change - by BP13 - 15.12.2009, 22:23
Re: [HELP] Skin Change - by Cezar - 15.12.2009, 22:32

Forum Jump:


Users browsing this thread: 2 Guest(s)