19.08.2009, 08:20
I need to know how to make a script so that if a civilian with no wanted level does something illegal*ex:robs a bank*gets a higher wanted level.
new DEFINED_ROBBERY_AMOUNT = "69"
new WantedPlayer[MAX_PLAYERS];
if (strcmp(cmd, "/robbank", true) == 0)
{
new wantedpl[MAX_PLAYER_NAME];
GetPlayerName(playerid, wantedpl, sizeof(wantedpl));
if(WantedPlayer[playerid] == 0)
{
format(string, sizeof(string), "%s has become a criminal, the player is at 1 star! Catch them!", wantedpl);
SendClientMessageToAll(0xFFFFFFAA, string);
WantedPlayer[playerid]++;
SetPlayerWantedLevel(playerid, 1);
GivePlayerMoney(playerid, DEFINED_ROBBERY_AMOUNT);
}
else if (WantedPlayer[playerid] >= 1 && WantedPlayer[playerid] < 6)
{
WantedPlayer[playerid]++;
SetPlayerWantedLevel(playerid, WantedPlayer[playerid]);
GivePlayerMoney(playerid, DEFINED_ROBBERY_AMOUNT);
format(string, sizeof(string), "%s has obtained another star, catch them! (Now at %d).", wantedpl, WantedPlayer[playerid]);
SendClientMessageToAll(0xFFFFFFAA, string);
}
else if(WantedPlayer[playerid] >= 6)
{
SendClientMessage(playerid, 0xFFFFFFAA, "You're the most wanted, run run run!");
}
}
public OnPlayerDeath(playerid, killerid, reason)
{
new murderedname[MAX_PLAYER_NAME];
new murderersname[MAX_PLAYER_NAME];
if(WantedPlayer[playerid] > 0)
{
GetPlayerName(playerid, murderedname, sizeof(murderedname));
GetPlayerName(killerid, murderersname, sizeof(murderers));
format(string, sizeof(string), "%s has slaughtered the Wanted Criminal %s.", murderersname, murderedname);
SendClientMessageToAll(0xFFFFFFAA, string);
}
}