Police Problem
#1

If someone has wanted level ,and a cop shots him he respawns to spawn place
Take a look at the line :
if(gTeam[i] == 2 || IsACop(playerid) && CrimInRange(30.0, playerid,i))
{
count = 1;
format(string, sizeof(string), "~w~Running Suspect~r~Killed~n~Bonus~g~$%d", price);
GameTextForPlayer(i, string, 5000, 1);
ConsumingMoney[i] = 1;
GivePlayerMoney(i, price / 2);
PlayerPlaySound(i, 1058, 0.0, 0.0, 0.0);
}
}
}
if(count == 1)
{
GivePlayerMoney(playerid, - price);
PlayerInfo[playerid][pWantedDeaths] += 1;
PlayerInfo[playerid][pJailed] = 1;
PlayerInfo[playerid][pJailTime] = (WantedLevel[playerid])*(250);
format(string, sizeof(string), "* You are in Jail for %d Seconds and lose $%d because of running away and getting shot by the Officer.", PlayerInfo[playerid][pJailTime], price);
SendClientMessage(playerid, COLOR_LIGHTRED, string);
WantedPoints[playerid] = 0;
WantedLevel[playerid] = 0;
}
}
}
Reply
#2

Why not use OnPlayerDeath and check if the killerid 'IsACop'. As an additional check, you also get the distance there.

In your code: Try to put the gTeam-check and the IsACop between additional braces and the second part looks weird. Why didn't you put that together with the first part?

* mamoru
Reply
#3

I solved it thanks for help
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)