/givecash command
#4

if you're using ZCMD

pawn Код:
CMD:givecash(playerid, params[])//if you are using ZCMD > credits to zeex....
{
    //first we are creating some variables that will help us much
    new Target, value;//we've created the target who will be givn the money and the value (how much they will take)
   
    if(sscanf(params, "ds", Target, value)) return SendClientMessage(playerid, -1, "SYNTAX: /givecash [playerid] [ammount]");
    //now, we've used sscanf to detect if the player has entered wrong syntax
    // d > Target
    //s > value
    // -1 > color white.
   
    GivePlayerMoney(playerid, -value);//we put the "-" to reduce the value from his money
    GivePlayerMoney(Target, value);//now we are giving that value to the target
    //we've done the transfer
   
    //Additional, let's put some messages (by format)
    new str[50];//added a new variable (string)
   
    format(str, sizeof(str), "ID(%d) has given you $%d",playerid, value);
    SendClientMessage(playerid, -1, str);
    //read about formats , it's easy :D
    return 1;
}
(this should work, sorry I was late, I'm on phone)

Edit:That's how it works, (it's a base) any additional depends on you
Reply


Messages In This Thread
/givecash command - by Helpergood - 26.07.2013, 18:47
Re: /givecash command - by ScRipTeRi - 26.07.2013, 19:05
Re: /givecash command - by Helpergood - 26.07.2013, 19:16
Re: /givecash command - by TH3_R3D™ - 26.07.2013, 19:23
Re: /givecash command - by Helpergood - 26.07.2013, 19:27
Re: /givecash command - by TH3_R3D™ - 26.07.2013, 19:30
Re: /givecash command - by Helpergood - 26.07.2013, 19:34
Re: /givecash command - by Vanter - 26.07.2013, 22:14
Re: /givecash command - by Helpergood - 26.07.2013, 22:26

Forum Jump:


Users browsing this thread: 1 Guest(s)