GetPlayerVisual Shared function

From Gothic 2 Online: Wiki
Jump to navigation Jump to search

This function was added in version: 0.0.0

Gets the given player's visual.

Syntax

table getPlayerVisual(int id)

Required Arguments

  • id: player's id.

Returns

  • table: containing the player visual

Example

Client

addEventHandler("onCommand", function(cmd, params)
{
	if (cmd == "myvisual")
	{
		local visual = getPlayerVisual(pid);

		// printing visual in debug console

		print("Your visual is: ");
		print("Body Model: " + visual.bodyModel + " Body Texture " + visual.bodyTxt);
		print("Head Model: " + visual.headModel + " Head Texture " + visual.headTxt);
	}
});

Server

addEventHandler("onPlayerCommand", function(pid, cmd, params)
{
	if (cmd == "myvisual")
	{
		local visual = getPlayerVisual(pid);

		// printing visual on chat

		sendMessageToPlayer(0,255,0,"Your visual is: ");
		sendMessageToPlayer(0,255,0,"Body Model: " + visual.bodyModel + " Body Texture " + visual.bodyTxt);
		sendMessageToPlayer(0,255,0,"Head Model: " + visual.headModel + " Head Texture " + visual.headTxt);
	}
});

Related functions

Server

Shared