Anti-Jack is killing passengers too ;( -
Christopher. - 09.01.2010
Ok so heres the code, My problem is that its continually killing the passenger, I haven't yet figured out how to fix this:
Код:
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;
}
How could i fix it so it doesn't kill the passengers entering?
Re: Anti-Jack is killing passengers too ;( -
Christopher. - 09.01.2010
When this is called the player is not currently in the car, So they wouldn't be a passenger....
Re: Anti-Jack is killing passengers too ;( -
Christopher. - 09.01.2010
No, Its supposed to kill somebody trying to jack the car, Not a passenger trying to enter.
Re: Anti-Jack is killing passengers too ;( -
[SF]RobMob - 10.01.2010
Quote:
Originally Posted by » ραωпsтαг «
Try this ...
Код:
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;
}
Info.
Or try the one above.
|
Dont work errors
C:\Users\robmob\Desktop\The New World 2\gamemodes\NextBigThing.pwn(350
: error 029: invalid expression, assumed zero
C:\Users\robmob\Desktop\The New World 2\gamemodes\NextBigThing.pwn(350
: warning 215: expression has no effect
C:\Users\robmob\Desktop\The New World 2\gamemodes\NextBigThing.pwn(350
: error 001: expected token: ";", but found ")"
C:\Users\robmob\Desktop\The New World 2\gamemodes\NextBigThing.pwn(350
: error 029: invalid expression, assumed zero
C:\Users\robmob\Desktop\The New World 2\gamemodes\NextBigThing.pwn(350
: fatal error 107: too many error messages on one line
Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
4 Errors.
with line
if (IsPlayerInVehicle(i, vehicleid) && GetPlayerState(i) == PLAYER_STATE_DRIVER) && GetPlayerState(playerid) == 5)
Re: Anti-Jack is killing passengers too ;( -
Miguel - 11.01.2010
Quote:
Originally Posted by [SF
robmob ]
if (IsPlayerInVehicle(i, vehicleid) && GetPlayerState(i) == PLAYER_STATE_DRIVER) && GetPlayerState(playerid) == 5)
|
pawn Код:
if(IsPlayerInVehicle(i, vehicleid) && GetPlayerState(i) == PLAYER_STATE_DRIVER && GetPlayerState(playerid) == 5)
Re: Anti-Jack is killing passengers too ;( -
[SF]RobMob - 26.01.2010
it compiled but it did nothing
Anti-Jack error -
OmarEco - 21.06.2010
i have error in this filterscript
http://www.m5zn.com/uploads/2010/6/2...52vceysn0p.bmp