SA-MP Forums Archive
[HELP] Skin Change - 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: [HELP] Skin Change (/showthread.php?tid=113797)



[HELP] Skin Change - joeri55 - 15.12.2009

Hello,

I've got a problem. I've made a command where I can change the clothes of a character with.

Код:
	if(strcmp(cmd, "/clothes", true) == 0)
	{
	  if(IsPlayerConnected(playerid))
	  {
	    if(PlayerInfo[playerid][pMember] >= 1)
	    {
	      if(IsAtClothShop(playerid))
				{
         // What must I set here?
				}
				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))
	      {
          // What must I set here?
	      }
	    }
	  }
	  return 1;
	}
I want that if people /clothes 132 for example they get the skin 132.
Does anyone has a idea how to fix that?

If so.. Please give me a hint or advice how to script it.


Re: [HELP] Skin Change - Cezar - 15.12.2009

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


Re: [HELP] Skin Change - BP13 - 15.12.2009

What? You can't change your characters clothes in game. Do you mean skin change?


Re: [HELP] Skin Change - Cezar - 15.12.2009

Quote:
Originally Posted by [SU
BP13 ]
What? You can't change your characters clothes in game. Do you mean skin change?
Yes you can...if he means skin and by the title I think he means skin.