26.02.2014, 19:09
when you're a passenger and press "Block mayus" for passenger drive-by, OnPlayerUpdate is called only when you fire a gun, if you dont fire OnPlayerUpdate is called every ~5 seconds, and other players see you on pause. Also, hits are desynced here.
test it:
Enter a vehicle as passenger, give a gun, and test using this code:
Other bug:
OnPlayerWeaponShot is called with "weaponid" = 0 when you're a passenger, and get a weapon while you are in a vehнcle.
Test it: enter a vehicle as passenger, get a weapon, and debug OnPlayerWeaponShot, you will see it
Also, GetPlayerWeapon return 0 when you get a weapon when your state is passenger. Passenger state is really bugged. Sorry for my english
test it:
Enter a vehicle as passenger, give a gun, and test using this code:
pawn Код:
public OnPlayerUpdate (playerid)
{
static
lastOPU [MAX_PLAYERS];
new
string [60];
format (string, sizeof (string), "OnPlayerUpdate: Last call was %d ms ago", GetTickCount() - lastOPU [playerid]);
SendClientMessage (playerid, -1, string);
lastOPU [playerid] = GetTickCount();
return 1;
}
OnPlayerWeaponShot is called with "weaponid" = 0 when you're a passenger, and get a weapon while you are in a vehнcle.
Test it: enter a vehicle as passenger, get a weapon, and debug OnPlayerWeaponShot, you will see it
pawn Код:
public OnPlayerWeaponShot(playerid, weaponid, hittype, hitid, Float:fX, Float:fY, Float:fZ)
{
new szString[144];
format(szString, sizeof(szString), "Weapon %i fired. hittype: %i hitid: %i pos: %f, %f, %f", weaponid, hittype, hitid, fX, fY, fZ);
SendClientMessage(playerid, -1, szString);
return 1;
}