Пређи на главни садржај

GetPlayerSurfingPlayerObjectID

warning

This function was added in omp v1.1.0.2612 and will not work in earlier versions!

Description​

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

NameDescription
playeridThe ID of the player surfing the object

Returns​

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

Examples​

/* 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[46];

format(szMessage, sizeof(szMessage), "You're surfing on object #%d.", GetPlayerSurfingPlayerObjectID(playerid));
SendClientMessage(playerid, 0xA9C4E4FF, szMessage);
}
return 0;
}