SA-MP Forums Archive
Anti-Team Car Jack System. - 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)
+--- Thread: Anti-Team Car Jack System. (/showthread.php?tid=133149)



Anti-Team Car Jack System. - Kyle - 11.03.2010

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


Re: Anti-Team Car Jack System. - pen_theGun - 11.03.2010

pawn Код:
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;
}



Re: Anti-Team Car Jack System. - Kyle - 12.03.2010

Will that code work even when the player in the car exits the car so it sets params again.


Re: Anti-Team Car Jack System. - Dustly - 08.12.2011

Thanks, hey kyle... that code works perfectly... enjoy man!