[HELP] Clothes
#1

I've got a command but people can change other characters there skins..
How can I make that they can only change there own skin?

This is my code:

Код:
	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(IsAtClothShop(playerid))
			{
			  if(IsPlayerConnected(para1))
			  {
			    if(para1 != INVALID_PLAYER_ID)
			    {
			      PlayerPlaySound(playerid, 1084, 0.0, 0.0, 0.0);
						SafeGivePlayerMoney(playerid, -50);
			      SendClientMessage(playerid, COLOR_WHITE, " * Your skin has been changed!");
						PlayerInfo[para1][pChar] = level;
						GameTextForPlayer(playerid, "~w~Skin purchased", 5000, 1);
					  SetPlayerSkin(para1, PlayerInfo[para1][pChar]);
					}
				}//not connected
			}
			else
			{
				SendClientMessage(playerid, COLOR_GRAD1, "  You are not at the clothes shop!");
			}
		}
		return 1;
	}
If anyone has some tips or knows how to fix this please help meh!
Reply


Messages In This Thread
[HELP] Clothes - by joeri55 - 20.12.2009, 09:50
Re: [HELP] Clothes - by Marcel - 20.12.2009, 09:54
Re: [HELP] Clothes - by joeri55 - 20.12.2009, 10:16
Re: [HELP] Clothes - by Marcel - 20.12.2009, 10:20

Forum Jump:


Users browsing this thread: 1 Guest(s)