ID bug
#3

Код:
CMD:setskin(playerid, params[])
{
	if (PlayerInfo[playerid][pAdmin] >= 3)
	{
		new string[128], giveplayerid, skinid;
		if(sscanf(params, "ud", giveplayerid, skinid)) return SendClientMessageEx(playerid, COLOR_WHITE, "USAGE: /setskin [playerid] [skinid]");

		if(IsPlayerConnected(giveplayerid))
		{
			if(!IsInvalidSkin(skinid))
			{
				if(GetPlayerSkin(giveplayerid) == skinid)
				{
					SendClientMessageEx( playerid, COLOR_WHITE, "The player you're trying to change skins of already is using the skin you're trying to set." );
				}
				else
				{
					PlayerInfo[giveplayerid][pChar] = skinid;
					PlayerInfo[giveplayerid][pModel] = skinid;
					format(string, sizeof(string), "Your skin has been changed to ID %d by Administrator %s.", skinid, GetPlayerNameEx(playerid));
					SendClientMessageEx(giveplayerid, COLOR_WHITE, string);
					format(string, sizeof(string), "You have given %s skin ID %d.", GetPlayerNameEx(giveplayerid), skinid);
					SendClientMessageEx(playerid, COLOR_WHITE, string);
					SetPlayerSkin(giveplayerid, PlayerInfo[giveplayerid][pChar]);
				}
			}
			else
			{
				SendClientMessageEx(playerid, COLOR_GREY, "Invalid skin ID!");
			}
		}
	}
	else
	{
		SendClientMessageEx(playerid, COLOR_GRAD1, "You are not authorized to use that command!");
	}
	return 1;
}
Reply


Messages In This Thread
ID bug - by PrinceOfPersia - 20.05.2014, 10:08
Re: ID bug - by ThatThoseTheThy - 20.05.2014, 10:28
Re: ID bug - by PrinceOfPersia - 20.05.2014, 10:33
Re: ID bug - by Konstantinos - 20.05.2014, 10:35
Re: ID bug - by PrinceOfPersia - 20.05.2014, 10:35
Re: ID bug - by Konstantinos - 20.05.2014, 10:37
Re: ID bug - by Threshold - 20.05.2014, 10:37
Re: ID bug - by PrinceOfPersia - 20.05.2014, 10:38
Re: ID bug - by Konstantinos - 20.05.2014, 10:39
Re: ID bug - by PrinceOfPersia - 20.05.2014, 10:44

Forum Jump:


Users browsing this thread: 1 Guest(s)