Anti kill help - 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: Anti kill help (
/showthread.php?tid=231310)
Anti kill help -
[WTF]Godfather - 25.02.2011
Well as you see on my signature im working on a gm to share it to samp people
But i got a problem
How to make an a anti-car kill, and anti team kill, and of course anti spawn kill
Thanks
Re: Anti kill help -
Baboon - 25.02.2011
anti-car kill:
make a timer. Which will count every 500 millseconds. Under ongamemodeinit:
for(new i = 0; i < MAX_PLAYERS; i++)
{
SetTimerEx("godforvehicle",500,false,"d", i);
}
and then something like:
Quote:
/*public godforvehicle(playerid)
{
if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 511) // for vehicle model 511 anti kill.
{
GetVehicleHealth(vehicle, vehiclehealth);
if(vehiclehealth < 1000)
{
RepairVehicle(vehicle);
}
}
return 1;
}
|
Anti teamkill: SetPlayerTeam (look at wiki).
anti spawnkill: you can use godmode for like 9 seconds, SetPlayerHealth(playerid, 999999999); and then in a public function of the timer, you set the health back to 100. use SetTimerEx(" your public function ", 9000, false, "d", playerid);
Re : Anti kill help -
[WTF]Godfather - 25.02.2011
Anti car kill is like a player kill another player with his car i want an anti of this