CMD:hitman(playerid, params[])
{
new theScore, senderid;
if(sscanf(params, "k<player_name>i", senderid, theScore)) return SCM(playerid, C_INFO, "/hitman [playerid] [score]");
if(!IsPlayerConnected(senderid)) return playerMessage(playerid, C_RED, "Podano błędne id gracza!", "Invalid playerid!");
if(theScore > pScore[playerid] || !(0 < theScore <= 500)) return playerMessage(playerid, C_RED, "Błędna ilość respektu [1 - 500]", "Invalid amount of score [1 - 500]");
pHitman[senderid] += theScore;
pScore[playerid] -= theScore;
return serverMessageEx(-1, "%s "ORANGE"dał "WHITE"%d "ORANGE"expa za głowę gracza "WHITE"%s "ORANGE"- łącznie "WHITE"%d", "%s "ORANGE"gave "WHITE"%d "ORANGE"score for killing player "WHITE"%s "ORANGE"- together "WHITE"%d", pName[playerid], theScore, pName[senderid], pHitman[senderid]);
}
//OnPlayerDeath
if(pHitman[playerid])
{
serverMessageEx(-1, "%s "ORANGE"zdobył "WHITE"%d "ORANGE"pkt. respektu za zabуjstwo gracza "WHITE"%s", "%s "ORANGE"gained "WHITE"%d "ORANGE"score points for killing "WHITE"%s", pName[killerid], pHitman[playerid], pName[playerid]);
pScore[killerid] += pHitman[playerid];
pHitman[playerid] = 0;
}
|
This is what I would do:
- Create a global variable something like 'bool:PlayerIsWanted[MAX_PLAYERS]'. - If the player is contracted, set PlayerIsWanted to true on that individual player. - OnPlayerDeath, pay out the contract money to the killerid and set PlayerIsWanted to false on the player. |