27.05.2014, 12:17
Can I make a suggestion? this could be easily done in PAWN but it would be much better writing it in C++ since its faster and would be handy for other people who needed this kind of function mostly for CnR servers (/detain and /kidnap), I am not sure if the function has the right name but it can be changed, I can't think any name for the function.
Suggestion:
Add: GetPlayerLastEneteredVehicle(playerid);
Add: PutPlayerInlastEneteredVehicle(playerid, targetid, seatid);
PAWN Version, maybe give you an idea of what I mean?
In addition to GetVehicleLastDriver(playerid) function.
Suggestion:
Add: GetPlayerLastEneteredVehicle(playerid);
Add: PutPlayerInlastEneteredVehicle(playerid, targetid, seatid);
PAWN Version, maybe give you an idea of what I mean?
pawn Код:
static
gPlayerLastVehicle[MAX_PLAYERS];
#define GetPlayerLastEneteredVehicle(%0) \
gPlayerLastVehicle[%0]
#define PutPlayerInlastEneteredVehicle(%0,%1,%2) \
PutPlayerInVehicle(%1, gPlayerLastVehicle[%0], %2)
public OnPlayerStateChange(playerid, newstate, oldstate)
{
if(newstate == PLAYER_STATE_DRIVER || newstate == PLAYER_STATE_PASSENGER)
{
gPlayerLastVehicle[playerid] = GetPlayerVehicleID(playerid);
}
return true;
}
