09.01.2010, 19:12
Ok so heres the code, My problem is that its continually killing the passenger, I haven't yet figured out how to fix this:
How could i fix it so it doesn't kill the passengers entering?
Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger) { for(new i = 0; i < GetMaxPlayers(); i++) { if (IsPlayerInVehicle(i, vehicleid) && GetPlayerState(i) == PLAYER_STATE_DRIVER) { 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; }