Clothes cmd request - i give rep
#2

Here is a basic command.

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;
}
I haven't tested this command

EDIT: Thanks Flake
Reply


Messages In This Thread
Clothes cmd request - i give rep - by buburuzu19 - 11.09.2014, 20:49
Re: Clothes cmd request - i give rep - by MikeEd - 11.09.2014, 23:28
Re: Clothes cmd request - i give rep - by Flake. - 11.09.2014, 23:32
Re: Clothes cmd request - i give rep - by MikeEd - 11.09.2014, 23:40
Re: Clothes cmd request - i give rep - by buburuzu19 - 14.09.2014, 09:12
Re: Clothes cmd request - i give rep - by Banana_Ghost - 14.09.2014, 12:06
Re: Clothes cmd request - i give rep - by buburuzu19 - 15.09.2014, 13:11
Re: Clothes cmd request - i give rep - by buburuzu19 - 19.09.2014, 15:00
Re: Clothes cmd request - i give rep - by buburuzu19 - 20.09.2014, 11:31
Re: Clothes cmd request - i give rep - by DaniceMcHarley - 20.09.2014, 14:27

Forum Jump:


Users browsing this thread: 1 Guest(s)