26.03.2018, 13:48
No need for storing each vehicle's data
pawn Код:
native IsValidVehicle(vehicleid);
stock IsPlayerNearRancher(playerid) {
for(new v = 0; v < MAX_VEHICLES; v++) {
if(IsValidVehicle(v) && GetVehicleModel(v) == VEH_RANCHER) {
new Float: x, Float: y, Float: z;
GetVehiclePos(v, x, y, z);
if(IsPlayerInRangeOfPoint(playerid, 2.0, x, y, z))
return 1;
}
}
return 0;
}
// In a timer
if(IsPlayerNearRancher(playerid)) {
// code
}