Issue with checking if the person is on a boat.
#1

EDIT:

FIXED, I was an idiot.
Reply
#2

- || > OR:
The Player is not on the pier OR the player is not on a boat > send a message.

- && > AND:
The Player is not on the pier AND the player is not on a boat > send a message.


Код:
	new 
		vehid = GetPlayerSurfingVehicleID(playerid);

	if (IsPlayerInAnyVehicle(playerid))
		return SendClientMessage(playerid, COLOUR_GREY, "You must get out of the vehicle to use this.");

	if ( !IsPlayerInRangeOfPoint(playerid, 5, -1624.0994,1423.9761,7.1734) && (!IsABoat(vehid) && vehid != INVALID_VEHICLE_ID) ) 
		return SendClientMessage(playerid, COLOUR_GREY, "You must be on a boat or at a fishing pier to release your fish.");
Reply
#3

Also note that GetPlayerSurfingVehicleID returns the vehicle id on which the player is surfing if and only if the vehicle is moving.
Reply
#4

It was also the vehicle model the IsABoat is looking for, my mistake! I'm a moron, thanks for the reply.

Ahh, that's an issue, I'll just have to do a range check instead of surfing, thanks!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)