The command /contract
#2

On top of your code, with your other pVars add:
pawn Код:
enum pInfo
{
    pContract
}
new PlayerInfo[MAX_PLAYERS][pInfo];
Command (using ZCMD, might be the same way w/ dcmd, not sure, nvr used it.)

pawn Код:
COMMAND:contract(playerid, params[])
{
    new name[MAX_PLAYER_NAME], reason[100], ID, Reward;
    if(sscanf(params, "usi", ID, reason, Reward)) SendClientMessage(playerid, RED, "USAGE: /contract [ID] [Reason] [Reward]");
    else
    {
        GetPlayerName(playerid, name, sizeof(name));
        format(reason, sizeof(reason), "%s has placed a contract on you! Reason: %s", name, reason);
        GivePlayerMoney(playerid,-Reward);
        SetPlayerWantedLevel(ID, 6);
        PlayerInfo[ID][pContract]=Reward;
        SendClientMessage(ID, RED, reason);
    }
    return 1;
}
Under OnPlayerDeath add:
pawn Код:
GivePlayerMoney(killerid, PlayerInfo[playerid][pContract]);
 PlayerInfo[playerid][pContract] = 0;
Reply


Messages In This Thread
The command /contract - by dclaw - 08.01.2011, 20:16
Re: The command /contract - by John_F - 08.01.2011, 20:34
Re: The command /contract - by Alex_Valde - 08.01.2011, 20:34
Re: The command /contract - by John_F - 08.01.2011, 20:37

Forum Jump:


Users browsing this thread: 1 Guest(s)