08.01.2011, 20:34
Here you go mate, just delete that "COMMAND:" and uncomment that "dcmd_contract", I've done this quickly so...
I haven't tested it but it should work perfectly.
One more thing - You will need to make something like if some one kills that guy, he will get that reward, in this command I've made you won't get that.
pawn Код:
/*dcmd_contract*/COMMAND:(playerid, params[])
{
new targetID,reason[128], money;
if(!sscanf(params, "us[128]i", targetID, reason, money))
{
if(IsPlayerConnected(targetID))
{
new name[MAX_PLAYER_NAME], targetname[MAX_PLAYER_NAME], string[128];
GetPlayerName(playerid, name, sizeof(name));
GetPlayerName(targetID, targetname, sizeof(targetname));
SetPlayerWantedLevel(targetID, 6);
format(string, sizeof(string), " %s has place an contract on you. Reason: %s.",name, reason);
SendClientMessage(targetID, 0xFFFFFFFF, string);
format(string, sizeof(string), " You have placed a contract on %s for $%d",targetname, money);
SendClientMessage(playerid, 0xFFFFFFFF, string);
GivePlayerMoney(playerid, -money);
}
else return SendClientMessage(playerid,COLOR_RED, "Error: Player is not connected.");
}
else return SendClientMessage(playerid, COLOR_RED, "Usage: /contract [ID] [Reason] [Reward]");
return 1;
}
One more thing - You will need to make something like if some one kills that guy, he will get that reward, in this command I've made you won't get that.