Posts: 25
Threads: 9
Joined: Nov 2012
Reputation:
0
Hello.
I would like to know if there is any good way to get all players who are in given vehicle. I want to give player score for killing someone in car but OnVehicleDeath you don't get player id. I could come up with looping trough all players for IsPlayerInVehicle but then again how do I get list of players.
Posts: 25
Threads: 9
Joined: Nov 2012
Reputation:
0
Thanks, I didnt know Player was global variable.
Posts: 2,593
Threads: 34
Joined: Dec 2007
pawn Код:
foreach(new i : Player)
{
new vehID = GetPlayerVehicleID(i);
if(vehID > 0 && vehID == VehicleIDToCheck)
{
// Do something...
}
}
Posts: 7,801
Threads: 187
Joined: Feb 2010
Reputation:
0
You may need to update your foreach include. Otherwise, change it to foreach(Player, i)
In regards to the callback returning the wrong killerid; I BELIEVE there is a bug with the callback in that it doesn't return the proper ID of the person who actually destroyed the vehicle. Instead, it returns the ID of the player who's client reported the vehicle's death. I would of said something earlier, but just remembered reading something about that when you mentioned it returning 255.
Posts: 25
Threads: 9
Joined: Nov 2012
Reputation:
0
Thank you for your reply.
So to get proper killer ID I just need to wait until new binaries are released? So server doesn't check anything and does only what client reports? So if hacker reports that all vehicles had blown up does that make server call OnPlayerDeath() for eveyone who were in cars? And that means score can be altered by hacker? If so I'd really like to see server having more control over players.