25.02.2011, 12:52
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:
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);
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 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);