25.07.2011, 09:22
Nice, thanks.
New callback:
pawn Код:
|
If OnVehicleStreamIn, and vehicle falling down, the server think OnUnoccupiedVehicleUpdate. It's bad, because player not touch this vehicle (only OnVehicleStreamIn).
|
New callback:
pawn Код:
|
public OnUnoccupiedVehicleUpdate(vehicleid, playerid, passenger_seat)
{
new string[128];
format(str, 128, "Test [%d] [%d] [%d]", vehicleid, playerid, passenger_seat);
return SendClientMessageToAll(0xFFFF00FFm string);
}
Test Code:
pawn Код:
|
public OnUnoccupiedVehicleUpdate(vehicleid, playerid, passenger_seat) {
new
Float: fVehicle[3]; // Array to store the vehicle's co-ordinates
GetVehiclePos(vehicleid, fVehicle[0], fVehicle[1], fVehicle[2]); // Get vehicle co-ordinates and store them into the array we created before
if(!IsPlayerInRangeOfPoint(playerid, 10, fVehicle[0], fVehicle[1], fVehicle[2])) { // If player is not in range of the vehicle we checked (furthest distance in the given example is 10)
// Code for the callback, which gets called if player moves the vehicle and is not driving
return;
}
}
#define CAMERA_MODE_NONE 0
#define CAMERA_MODE_INTRAIN 3
#define CAMERA_MODE_ONFOOT 4
#define CAMERA_MODE_AIM_SNIPER 7
#define CAMERA_MODE_AIM_ROCKETLAUNCHER 8
#define CAMERA_MODE_FIXED_ATSIDE 14
#define CAMERA_MODE_FIXED_POS 15
#define CAMERA_MODE_FIXED_CARBUMPER 16
#define CAMERA_MODE_INCAR 18
#define CAMERA_MODE_INBOAT 22
#define CAMERA_MODE_AIM_CAMERA 46
#define CAMERA_MODE_AIM_HEATSEEKER 51
#define CAMERA_MODE_AIM 53
#define CAMERA_MODE_DRIVEBY 55
#define CAMERA_MODE_FIXED_CINEMA 56
#define CAMERA_MODE_FIXED_CINEMA_FLYOVER 57
#define CAMERA_MODE_FIXED_CINEMA_ZOOM 58
#define CAMERA_MODE_FIXED_CINEMA_UNDER 59
#define CAMERA_MODE_FIXED_CINEMA_SIDE 62
#define CAMERA_MODE_FIXED_CINEMA_ROUND 63
#define CAMERA_MODE_FIXED_CINEMA_HEADON 64