11.09.2014, 23:28
Here is a basic command.
I haven't tested this command
EDIT: Thanks Flake
pawn Код:
stock IsValidSkin( skinid )
{
if( skinid == 74 || skinid > 299 || skinid < 0 )
return 0;
return 1;
}
CMD:buyclothes(playerid,params[])
{
new skinid;
if(sscanf(params,"i",skinid)) return SendClientMessage(playerid,-1,"SYNTAX: /buyclothes [skinid]");// gives a message if the player hasn't entered a skinid
if(!IsPlayerInRangeOfPoint(playerid, 7.0, 207.7145,-103.5601,1005.2578)) return SendClientMessage(playerid,-1,"You are not at binco");// checks if the player is at binco, if not it returns in an error
if(!IsValidSkin(skinid)) return SendClientMessage(playerid,-1,"Please enter a valid skin id");
GivePlayerMoney(playerid,-500);//Set this according to your choice
SetPlayerSkin(playerid,skinid)//Set's the player's skin id to the id he entered
new string[28];// a string variable
format(string,sizeof(string),"You've bought skin id %d",skinid);//formats the string
SendClientMessage(playerid,-1,string);// Sends a confirmation message
return 1;
}
EDIT: Thanks Flake