05.07.2013, 08:44
How can I make a good anti-car surfing system?Can you give me an example so I can do it good?
new AntiCarSurfing[MAX_PLAYERS];
forward KillSurfer(playerid);
public OnPlayerConnect(playerid)
{
AntiCarSurfing[playerid]=SetTimerEx("KillSurfer",1000,true,"i",playerid);
return 1;
}
public OnPlayerDisconnect(playerid, reason)
{
KillTimer(AntiCarSurfing[playerid]);
return 1;
}
public KillSurfer(playerid)
{
new surf;
surf=GetPlayerSurfingVehicleID(playerid);
if(surf!=INVALID_VEHICLE_ID)
SetPlayerHealth(playerid,0);
return 1;
}