How to make /givemoney and /giveweapon?
#8

pawn Код:
CMD:givecash(playerid, params[])
{
    new ID, Money;
    new string[128];
    if(sscanf(params, "ii", ID, Money)) return SendClientMessage(playerid, -1, "USAGE: /GiveCash [ID] [Amount]");
    if(GetPlayerMoney(playerid) < amount) return SendClientMessage(playerid, -1, "You don't even have that much.");
    GivePlayerMoney(playerid, -amount);
    GivePlayerMoney(giveplayerid, amount);
    format(string, sizeof(string), "You succesfully gaved %i $ to %s !", Money, ID);
    SendClientMessage(playerid, -1, string);
    new name[MAX_PLAYER_NAME];
    GetPlayerName(playerid, name, sizeof(name));
    format(string, sizeof(string), "You received %i money from %s !", Money, name);
    SendClientMessage(ID, -1, string);
    return 1;
}
pawn Код:
CMD:giveweapon(playerid, params[])
{
    new ID;
    new Weapon;
    new Ammo;
    if(sscanf(params, "iii", ID, Weapon, Ammo)) return SendClientMessage(playerid, -1, "USAGE: /GiveWeapon [ID] [Weapon] [Ammo]");
    GivePlayerWeapon(ID, Weapon, Ammo);
    return 1;
}
Reply


Messages In This Thread
How to make /givemoney and /giveweapon? - by C0olp1x - 16.11.2014, 00:50
Re: How to make /givemoney and /giveweapon? - by Abagail - 16.11.2014, 00:55
Re: How to make /givemoney and /giveweapon? - by C0olp1x - 16.11.2014, 00:58
Re: How to make /givemoney and /giveweapon? - by C0olp1x - 16.11.2014, 01:01
Re: How to make /givemoney and /giveweapon? - by Abagail - 16.11.2014, 01:01
Re: How to make /givemoney and /giveweapon? - by C0olp1x - 16.11.2014, 01:04
Re: How to make /givemoney and /giveweapon? - by AlphaPac - 16.11.2014, 03:34
Re: How to make /givemoney and /giveweapon? - by HY - 16.11.2014, 07:09
Re: How to make /givemoney and /giveweapon? - by dominik523 - 16.11.2014, 10:45
Re : How to make /givemoney and /giveweapon? - by Dutheil - 16.11.2014, 11:08

Forum Jump:


Users browsing this thread: 1 Guest(s)