can someone help me with this?
#1

hi, i have a andti drive-by that had a bug.
this are the lines that i think that have te problem:
pawn Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
  new vehicleid=GetPlayerVehicleID(playerid);
    if(IsPlayerInAnyVehicle(playerid) && GetPlayerVehicleSeat(playerid) == 0 && IsDDBVehicle(vehicleid)){
phe problem is that if u get in the car normaly using enter/f the anti DB, works perfectly, but if u use the carspawner it dont work.
can someone help me please?

PD: Sorry for my bad english
Reply
#2

Try instead of

pawn Код:
IsPlayerInAnyVehicle(playerid) && GetPlayerVehicleSeat(playerid) == 0
pawn Код:
new state = GetPlayerState(playerid);
if(state == PLAYER_STATE_DRIVER ... )
Reply
#3

Quote:
Originally Posted by Rizard
Try instead of

pawn Код:
IsPlayerInAnyVehicle(playerid) && GetPlayerVehicleSeat(playerid) == 0
pawn Код:
new state = GetPlayerState(playerid);
if(state == PLAYER_STATE_DRIVER ... )
same problem
Reply
#4

Quote:
Originally Posted by the_chaoz
Quote:
Originally Posted by Rizard
Try instead of

pawn Код:
IsPlayerInAnyVehicle(playerid) && GetPlayerVehicleSeat(playerid) == 0
pawn Код:
new state = GetPlayerState(playerid);
if(state == PLAYER_STATE_DRIVER ... )
same problem
Use: OnPlayerStateChange.
pawn Код:
public OnPlayerStateChange(playerid, newstate, oldstate){
  if(newstate == PLAYER_STATE_DRIVER && IsDDBVehicle(vehicleid)){
     ... do your things.
  }
}
Reply
#5

Another Method...

Код:
new playa_ammo[MAX_PLAYERS][13];
new playa_weapon[MAX_PLAYERS][13];
>> OnPlayerEnterVehicle

Код:
for(new i = 0;i<13;i++)GetPlayerWeaponData(playerid, i, playa_weapon[playerid][i], playa_ammo[playerid][i]);
ResetPlayerWeapons(playerid);
>> OnPlayerExitVehicle
Код:
for(new i = 0;i<13;i++)GivePlayerWeapon(playerid,playa_weapon[playerid][i],playa_ammo[playerid][i]);
Reply
#6

No, i need the event to be OnPlayerKeyStateChange
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)