PDA

View Full Version : Anti Car Jacking Help


Celebesgamer
26/07/2013, 01:16 AM
Hi,
I'm looking for an anti-carjacking system
Because My Server rules have "Do Not Car Jacking"
but there are many who break them.
Please give me some help ...

ScRipTeRi
26/07/2013, 01:37 AM
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
//Anti car Jack
for(new i=0; i<MAX_PLAYERS; i++)
{
if (ispassenger) return 1;
if(IsPlayerInVehicle(i,vehicleid) && GetPlayerState(i) == PLAYER_STATE_DRIVER && GetPlayerTeam(i) == GetPlayerTeam(playerid)) {
new Float:X,Float:Y,Float:Z;
GetPlayerPos(playerid,X,Y,Z);
SendClientMessage(playerid, COLOR_RED1, "No car jack, press G to enter as passenger.");
SetPlayerPos(playerid,X,Y,Z+1);
}
}
return 1;
}

Celebesgamer
26/07/2013, 01:42 AM
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
//Anti car Jack
for(new i=0; i<MAX_PLAYERS; i++)
{
if (ispassenger) return 1;
if(IsPlayerInVehicle(i,vehicleid) && GetPlayerState(i) == PLAYER_STATE_DRIVER && GetPlayerTeam(i) == GetPlayerTeam(playerid)) {
new Float:X,Float:Y,Float:Z;
GetPlayerPos(playerid,X,Y,Z);
SendClientMessage(playerid, COLOR_RED1, "No car jack, press G to enter as passenger.");
SetPlayerPos(playerid,X,Y,Z+1);
}
}
return 1;
}

thank you.

ScRipTeRi
26/07/2013, 01:57 AM
not problem :)