SA-MP Forums Archive
still wont work - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: still wont work (/showthread.php?tid=126616)



still wont work - [SF]RobMob - 09.02.2010

hi im trying to get a car anti jack to work in my server as i have having a problem with people stealing peoples cars this is what i got it for some reason it dont work i want it so it kills the driver not the passenger for getting in to




public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
for(new i = 0; i < GetMaxPlayers(); i++)
{
if(IsPlayerInVehicle(i, vehicleid) && GetPlayerState(i) == PLAYER_STATE_DRIVER && GetPlayerState(playerid) == 5)
{
SetPlayerHealth(playerid, 0);
new pName[MAX_PLAYER_NAME],string[128];
GetPlayerName(playerid, pName, sizeof(pName));
format(string, sizeof(string), "[Anti-Jack]: %s has just been killed for car jacking (n00b!).", pName);
SendClientMessageToAll(red, string);
SendClientMessage(playerid,red,"Error: Car jacking is not allowed!.");
}
}
return 1;
}


Re: still wont work - Joe Staff - 09.02.2010

add
pawn Код:
if(ispassenger)return 1;
before your 'for' loop


Re: still wont work - matthewdriftking - 05.04.2010

What errors you got?
Can you post it?