Police Problem - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Police Problem (
/showthread.php?tid=121384)
Police Problem -
Jo1Nt - 16.01.2010
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;
}
}
}
Re: Police Problem -
mamorunl - 16.01.2010
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
Re: Police Problem -
Jo1Nt - 16.01.2010
I solved it thanks for help