08.01.2011, 20:34
On top of your code, with your other pVars add:
Command (using ZCMD, might be the same way w/ dcmd, not sure, nvr used it.)
Under OnPlayerDeath add:
pawn Код:
enum pInfo
{
pContract
}
new PlayerInfo[MAX_PLAYERS][pInfo];
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;
}
pawn Код:
GivePlayerMoney(killerid, PlayerInfo[playerid][pContract]);
PlayerInfo[playerid][pContract] = 0;