PDA

View Full Version : Anti-Team Car Jack System.


Kyle
11/03/2010, 06:37 AM
I have tried searching for this but failed while looking, I need the system so it removes the player from the vehicle if they teamjack cars. The codes i have used before remove me even if im a passenger on the vehicle. Thanks

pen_theGun
11/03/2010, 07:45 AM
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
if(ispassenger)
SetVehicleParamsForPlayer( vehicleid, playerid, 0, 0); // Parameters (vehicleid,playerid,objective,doorslocked)
else {
new vehid_2=-1;
for(new t=0; t<MAX_PLAYERS; t++)
{
if( IsPlayerConnected( t ) ){
vehid_2=GetPlayerVehicleID( t );
if(vehicleid==vehid_2 && gTeam[ playerid ] == gTeam[ t ] )
SetVehicleParamsForPlayer( vehicleid, playerid, 0, 1); // Parameters (vehicleid,playerid,objective,doorslocked)
break;
}
}
}
return 1;
}

Kyle
12/03/2010, 06:47 AM
Will that code work even when the player in the car exits the car so it sets params again.

Dustly
08/12/2011, 08:36 AM
Thanks, hey kyle... that code works perfectly... enjoy man!