14.03.2009, 16:44
Here:
pawn Код:
new HuntID[MAX_PLAYERS];
new IsHunting[MAX_PLAYERS];
OnPlayerCommandText(playerid, cmdtext[])
{
if(!strcmp(cmdtext, "/mission", true))
{
new
Msg[19];
HuntID[playerid] = random(GetMaxPlayers());
while(HuntID[playerid] == playerid || !IsPlayerConnected(HuntID[playerid])) HuntID[playerid] = random(GetMaxPlayers());
format(Msg, 19, "You are now hunting for ID %i.", HuntID[playerid]);
SendClientMessage(playerid, 0xFFFF00FF, Msg);
IsHunting[playerid] = 1;
return 1;
}
return 0;
}
OnPlayerDeath(playerid, killerid, reason)
{
if(IsHunting[killerid] == 1 && HuntID[killerid] == playerid)
{
SendClientMessage(killer, 0xFFFF00FF, "You have successfully carried out the mission and have been awarded $5000!");
GivePlayerMoney(killerid, 5000);
}
return 1;
}