30.05.2013, 09:54
pawn Code:
CMD:buyskin(playerid, params[])
{
new skin;
if(!IsAtClothesShop(playerid)) return SendClientMessage(playerid, COLOR_GREY, "[ERROR]You must in clothes shop to buy the skin");
if(sscanf(params,"i",skin)) return SendClientMessage(playerid,COLOR_GREY,"USAGE: /buyskin [SkinID]");
SendClientMessage(playerid, COLOR_YELLOW, "You have successfully bought your own skin.");
GameTextForPlayer(playerid, "~r~$-500", 1000,1);
GivePlayerMoney(playerid, -500);
SetPlayerSkin(playerid,skin);
return 1;
}
pawn Code:
forward IsAtClothesShop(playerid);
public IsAtClothesShop(playerid)
{
if(IsPlayerInRangeOfPoint(playerid,20,161.5236, -83.3203, 1001.8047)||
IsPlayerInRangeOfPoint(playerid,20,207.7182,-100.9436,1005.2578) ||
IsPlayerInRangeOfPoint(playerid,20,203.9261,-43.2656,1001.8047) ||
IsPlayerInRangeOfPoint(playerid,20,206.3746,-8.1824,1001.2109) ||
IsPlayerInRangeOfPoint(playerid,20,207.0685,-129.1833,1003.5078))
{ return true; }
return false;
}