SA-MP Forums Archive
[HELP] Need a cmd that changes clothes - 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] Need a cmd that changes clothes (/showthread.php?tid=110361)



[HELP] Need a cmd that changes clothes - FreddeN - 25.11.2009

The command should work like this, you need to enter the Binco shop in LS, we will use PlayerToPoint or something.
And when they are inside they may use the command that maybe can be like in GF /clothes.

Then they can use like this /clothes [skinid].

I did some experiments with SetPlayerSkin, but I dont know how to do it like that, so you can put in the skin id you want.

Thanks


Re: [HELP] Need a cmd that changes clothes - kukars22 - 25.11.2009

something like this?

Код:
if(strcmp(cmd, "/clothes", true) == 0)
	{
	  if(IsPlayerConnected(playerid))
	  {
			tmp = strtok(cmdtext, idx);
			if(!strlen(tmp))
			{
				SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /clothes [playerid/PartOfName] [skin id]");
				return 1;
			}
			new para1;
			new level;
			para1 = ReturnUser(tmp);
			tmp = strtok(cmdtext, idx);
			level = strval(tmp);
			if(level > 299 || level < 1) { SendClientMessage(playerid, COLOR_GREY, "Wrong skin ID!"); return 1; }
			if (PlayerInfo[playerid][pAdmin] >= 1)
			{
			  if(IsPlayerConnected(para1))
			  {
			    if(para1 != INVALID_PLAYER_ID)
			    {
						GetPlayerName(para1, giveplayer, sizeof(giveplayer));
						GetPlayerName(playerid, sendername, sizeof(sendername));
						PlayerInfo[para1][pChar] = level;
						format(string, sizeof(string), "Your skin has been changed by Admin %s", sendername);
						SendClientMessage(para1, COLOR_WHITE, string);
						format(string, sizeof(string), "You have given %s skin to %d.", giveplayer,level);
						SendClientMessage(playerid, COLOR_WHITE, string);
					  SetPlayerSkin(para1, PlayerInfo[para1][pChar]);
					}
				}//not connected
			}
			else
			{
				SendClientMessage(playerid, COLOR_GRAD1, "  Your not an Admin !");
			}
		}
		return 1;
	}
If your using some RP mode, than you probably got pAdmin. Good Luck.


Re: [HELP] Need a cmd that changes clothes - FreddeN - 25.11.2009

Quote:
Originally Posted by kukars22
something like this?

Код:
if(strcmp(cmd, "/clothes", true) == 0)
	{
	  if(IsPlayerConnected(playerid))
	  {
			tmp = strtok(cmdtext, idx);
			if(!strlen(tmp))
			{
				SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /clothes [playerid/PartOfName] [skin id]");
				return 1;
			}
			new para1;
			new level;
			para1 = ReturnUser(tmp);
			tmp = strtok(cmdtext, idx);
			level = strval(tmp);
			if(level > 299 || level < 1) { SendClientMessage(playerid, COLOR_GREY, "Wrong skin ID!"); return 1; }
			if (PlayerInfo[playerid][pAdmin] >= 1)
			{
			  if(IsPlayerConnected(para1))
			  {
			    if(para1 != INVALID_PLAYER_ID)
			    {
						GetPlayerName(para1, giveplayer, sizeof(giveplayer));
						GetPlayerName(playerid, sendername, sizeof(sendername));
						PlayerInfo[para1][pChar] = level;
						format(string, sizeof(string), "Your skin has been changed by Admin %s", sendername);
						SendClientMessage(para1, COLOR_WHITE, string);
						format(string, sizeof(string), "You have given %s skin to %d.", giveplayer,level);
						SendClientMessage(playerid, COLOR_WHITE, string);
					  SetPlayerSkin(para1, PlayerInfo[para1][pChar]);
					}
				}//not connected
			}
			else
			{
				SendClientMessage(playerid, COLOR_GRAD1, " Your not an Admin !");
			}
		}
		return 1;
	}
If your using some RP mode, than you probably got pAdmin. Good Luck.
This is a Administrator Command, normal players should be able to get new skins etc.


Re: [HELP] Need a cmd that changes clothes - kukars22 - 27.11.2009

Than just take out if player is an admin.


Re: [HELP] Need a cmd that changes clothes - Andy_McKinley - 27.11.2009

Upload those skins you want.