GetPlayerVelocity FR
From SA-MP Wiki
(Difference between revisions)
Revision as of 23:09, 16 December 2013 Connor Mead (Talk | contribs) ← Previous diff |
Revision as of 23:01, 31 January 2014 Connor Mead (Talk | contribs) Next diff → |
||
Line 1: | Line 1: | ||
{{ScriptingFR}} | {{ScriptingFR}} | ||
- | {{Title}} | ||
{{0.3AddedFR|fonction|}} | {{0.3AddedFR|fonction|}} | ||
Line 21: | Line 20: | ||
new Float:Velocity[3], string[80]; | new Float:Velocity[3], string[80]; | ||
GetPlayerVelocity(playerid, Velocity[0], Velocity[1], Velocity[2]); | GetPlayerVelocity(playerid, Velocity[0], Velocity[1], Velocity[2]); | ||
- | format(string, sizeof(string), "You are going at a velocity of X: %f, Y: %f, Z: %f", Velocity[0], Velocity[1], Velocity[2]); | + | format(string, sizeof(string), "Voici votre vélocité: X: %f, Y: %f, Z: %f", Velocity[0], Velocity[1], Velocity[2]); |
SendClientMessage(playerid, 0xFFFFFFFF, string); | SendClientMessage(playerid, 0xFFFFFFFF, string); | ||
return 1; | return 1; | ||
Line 29: | Line 28: | ||
{{RelatedFunctionsFR}} | {{RelatedFunctionsFR}} | ||
- | *[[SetPlayerVelocity_FR|SetPlayerVelocity]] | + | {{SetPlayerVelocity_FR}} |
- | *[[SetVehicleVelocity_FR|SetVehicleVelocity]] | + | {{SetVehicleVelocity_FR}} |
- | *[[GetVehicleVelocity_FR|GetVehicleVelocity]] | + | {{GetVehicleVelocity_FR}} |
[[Category:Scripting Functions FR]] | [[Category:Scripting Functions FR]] |
Revision as of 23:01, 31 January 2014
Page d'Accueil | Les Fonctions | Les Callbacks | Les bases du Scripting | Plugins de Serveur | Tutoriaux
Ne prenez pas en compte les FR dans les noms
Description:
Récupère la vitesse X, Y et Z d'un joueur. Peut être utile notamment dans les compteurs de vitesse (speedometers)
(playerid, &Float:x, &Float:y, &Float:z)
playerid | Le joueur dont la vitesse sera récupérée |
&Float:x | La variable (float) qui récupérera la vitesse X. |
&Float:y | La variable (float) qui récupérera la vitesse Y. |
&Float:z | La variable (float) qui récupérera la vitesse Z. |
Retourne:
Cette fonction ne retourne rien. Les valeurs à récupérer sont stockées dans les variables X, Y et Z
public OnPlayerCommandText(playerid, cmdtext[]) { if (!strcmp("/velocity", cmdtext)) { new Float:Velocity[3], string[80]; GetPlayerVelocity(playerid, Velocity[0], Velocity[1], Velocity[2]); format(string, sizeof(string), "Voici votre vélocité: X: %f, Y: %f, Z: %f", Velocity[0], Velocity[1], Velocity[2]); SendClientMessage(playerid, 0xFFFFFFFF, string); return 1; } }
Fonctions Relatives
Les fonctions suivantes peuvent être utiles car elles sont indirectement ou directement liées a cette fonction.
- SetPlayerVelocity: Modifie la vélocité (vitesse) d'un joueur.
- SetVehicleVelocity: Modifie la vélocité(vitesse) d'un véhicule.
- GetVehicleVelocity: Récupère la vélocité (vitesse) d'un véhicule.