GetPlayerLastShotVectors
From SA-MP Wiki
(Difference between revisions)
Revision as of 12:05, 28 January 2014 Blantas (Talk | contribs) (Fixed the example.) ← Previous diff |
Revision as of 15:46, 31 January 2014 Connor Mead (Talk | contribs) Next diff → |
||
Line 42: | Line 42: | ||
[[Category:Scripting Functions]] | [[Category:Scripting Functions]] | ||
+ | [[fr:GetPlayerLastShotVectors]] |
Revision as of 15:46, 31 January 2014
Description:
Retrieves the vector of the last shot a player fired.
(playerid, &Float:fOriginX, &Float:fOriginY, &Float:fOriginZ, &Float:fHitPosX, &Float:fHitPosY, &Float:fHitPosZ)
playerid | The ID of the player to get the last bullet shot information of. |
&Float:fOriginX | The float variable to save the origin in the X direction to. |
&Float:fOriginY | The float variable to save the origin in the Y direction to. |
&Float:fOriginZ | The float variable to save the origin in the Z direction to. |
&Float:fHitPosX | The float variable to save the hit position in the X direction to. |
&Float:fHitPosY | The float variable to save the hit position in the Y direction to. |
&Float:fHitPosY | The float variable to save the hit position in the Z direction to. |
Return Values:
The function itself doesn't return a specific value. The positions are stored in the referenced variables.
public OnPlayerCommandText(playerid, cmdtext[]) { if(strcmp(cmdtext, "/lastshot", true) == 0) { new lsString[128], Float:fOriginX, Float:fOriginY, Float:fOriginZ, Float:fHitPosX, Float:fHitPosY, Float:fHitPosZ; GetPlayerLastShotVectors(playerid, fOriginX, fOriginY, fOriginZ, fHitPosX, fHitPosY, fHitPosZ); format(lsString, 128, "Last Shot Information: Origin: %f, %f, %f. Hit position: %f, %f, %f", fOriginX, fOriginY, fOriginZ, fHitPosX, fHitPosY, fHitPosZ); SendClientMessage(playerid, -1, lsString); return 1; } return 0; }
Related Functions
The following functions may be useful, as they are related to this function in one way or another.
- GetPlayerWeaponData: Find out information about weapons a player has.
- GetPlayerWeapon: Check what weapon a player is currently holding.
Related Callbacks
The following callbacks might be useful, as they're related to this function in one way or another.
- OnPlayerWeaponShot: Called when a player fires a weapon.