Need 2 script codes!
#4

This is an example of a /pay command, you could easily change this to your preferences. (Don't critize the code it's coded on a Macintosh which is pain!)
pawn Код:
COMMAND:pay(playerid, params[])
{
    new
        user,
        string[128];
    if(sscanf(params, "ud ", user, amount)) return SendClientMessage(playerid, COLOR_WHITE, "ERROR >> That's not the way, try: /pay (player) (amount)");
    if(ConnectedStatus[user] != 3) return SendClientMessage(playerid, COLOR_WHITE, "ERROR >> That player is not currently logged in!"); // Should be changed.
    if(GetDistanceBetweenPlayers(playerid, user) > 3.0) return SendClientMessage(playerid, COLOR_WHITE, "ERROR >> You are too far away!");
    if(amount < 1 || amount > 100000) return SendClientMessage(playerid, COLOR_WHITE, "ERROR >> The amount has to between $1 and $100.000.");
    if(player[playerid][money] < amount) return SendClientMessage(playerid, COLOR_WHITE, "ERROR >> You don't have enough money to do that!");
    // Everything below this should be changed.
    format(string, sizeof(string), "{purple}** %s hands %s an amount of cash.", RemoverUnderScore(playerid), RemoveUnderScore(user));
    SendClientMessage(playerid, COLOR_WHITE, string);
    player[user][money] = player[user][money]+amount;
    player[playerid][money] = player[payerid][money]-amount;
    SetPlayerMoney(playerid, player[payerid][money]);
    SetPlayerMoney(user, player[user][money]);
    return 1;
}
Reply


Messages In This Thread
Need 2 script codes! - by NitoPSG - 10.01.2011, 10:24
Re: Need 2 script codes! - by DevilG - 10.01.2011, 11:09
Re: Need 2 script codes! - by Lorenc_ - 10.01.2011, 11:10
Re: Need 2 script codes! - by _rAped - 10.01.2011, 11:16
Re: Need 2 script codes! - by NitoPSG - 11.01.2011, 19:39
Re: Need 2 script codes! - by NitoPSG - 11.01.2011, 19:48
Re: Need 2 script codes! - by tony_fitto - 11.01.2011, 21:34
Re: Need 2 script codes! - by sleepysnowflake - 11.01.2011, 22:01

Forum Jump:


Users browsing this thread: 4 Guest(s)