GetPlayerPos

From SA-MP Wiki

(Difference between revisions)
Jump to: navigation, search
Revision as of 02:34, 22 December 2011
Smithy (Talk | contribs)

← Previous diff
Revision as of 23:46, 31 January 2014
Connor Mead (Talk | contribs)

Next diff →
Line 1: Line 1:
{{Scripting}} {{Scripting}}
-{{Title}} 
{{Description|Get the X Y Z coordinates of a player.}} {{Description|Get the X Y Z coordinates of a player.}}
Line 34: Line 33:
[[Category:Scripting Functions]] [[Category:Scripting Functions]]
 +
 +[[fr:GetPlayerPos]]

Revision as of 23:46, 31 January 2014



Description:

Get the X Y Z coordinates of a player.


Parameters:
(playerid, Float:x, Float:y, Float:z)
playeridThe ID of the player to get the position of.
Float:xA float to store the X coordinate in, passed by reference.
Float:yA float to store the Y coordinate in, passed by reference.
Float:zA float to store the Z coordinate in, passed by reference.


Return Values:

This function does not return any specific values.


public OnPlayerDeath(playerid, killerid, reason)
{
    // Declare 3 float variables to store the X, Y and Z coordinates in
    new Float:x, Float:y, Float:z;
 
    // Use GetPlayerPos, passing the 3 float variables we just created
    GetPlayerPos(playerid, x, y, z);
 
    // Create a cash pickup at the player's position
    CreatePickup(1212, 4, x, y, z, GetPlayerVirtualWorld(playerid));
   return 1;
}

Related Functions

The following functions may be useful, as they are related to this function in one way or another.

In other languages