SA-MP Forums Archive
Issue with checking if the person is on a boat. - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Issue with checking if the person is on a boat. (/showthread.php?tid=574105)



Issue with checking if the person is on a boat. - Dokins - 13.05.2015

EDIT:

FIXED, I was an idiot.


Re: Issue with checking if the person is on a boat. - Evocator - 13.05.2015

- || > 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.");



Re: Issue with checking if the person is on a boat. - Yashas - 13.05.2015

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


Re: Issue with checking if the person is on a boat. - Dokins - 13.05.2015

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!