GetPlayerSurfingObjectID

From SA-MP Wiki

(Difference between revisions)
Jump to: navigation, search
Revision as of 14:20, 9 December 2016
OstGot (Talk | contribs)

← Previous diff
Current revision
OstGot (Talk | contribs)

Line 25: Line 25:
} }
</pawn> </pawn>
 +
 +{{RelatedFunctions}}
 +{{GetPlayerSurfingVehicleID}}
[[Category:Scripting Functions]] [[Category:Scripting Functions]]

Current revision



GetPlayerSurfingObjectID was added in SA-MP 0.3c This function was added in SA-MP 0.3c R3 and will not work in earlier versions!


Description:

Returns the ID of the object the player is surfing on.


Parameters:
(playerid)
playeridThe ID of the player surfing the object

Return Values:

The ID of the moving object the player is surfing. If the player isn't surfing a moving object, it will return INVALID_OBJECT_ID


Example Usage:

/* when the player types 'objectsurfing' in to the chat box, they'll see this.*/
public OnPlayerText(playerid, text[])
{
	if(strcmp(text, "objectsurfing", true) == 0)
	{
		new
		    szMessage[30];
 
		format(szMessage, sizeof(szMessage), "You're surfing on object #%d.", GetPlayerSurfingObjectID(playerid));
		SendClientMessage(playerid, 0xA9C4E4FF, szMessage);
	}
	return 0;
}

Related Functions

The following functions may be helpful as they relate to this function in one way or another.

Personal tools