still wont work
#1

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;
}
Reply
#2

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

What errors you got?
Can you post it?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)