GetVehicleVelocity FR
From SA-MP Wiki
(Difference between revisions)
Revision as of 03:55, 5 January 2013 Connor Mead (Talk | contribs) ← Previous diff |
Revision as of 08:26, 6 January 2013 Connor Mead (Talk | contribs) Next diff → |
||
Line 1: | Line 1: | ||
+ | {{ScriptingFR}} | ||
+ | {{Title}} | ||
+ | |||
+ | {{0.3AddedFR|fonction|}} | ||
+ | |||
+ | {{Description|Récupère la vitesse X, Y et Z d'un vhicule}} | ||
+ | |||
+ | {{ParametersFR|vehicleid, &Float:x, &Float:y, &Float:z}} | ||
+ | {{Param|vehicleid|L'ID du véhicule dont on doit obtenir la vitesse.}} | ||
+ | {{Param|&Float:x|La variable Float où stocker la vitesse X.}} | ||
+ | {{Param|&Float:y|La variable Float où stocker la vitesse Y.}} | ||
+ | {{Param|&Float:z|La variable Float où stocker la vitesse Z.}} | ||
+ | |||
+ | {{ReturnFR|Cette fonction ne retourne pas de valeur particulière. Les valeurs X, Y et Z sont stockés dans des variables.}} | ||
+ | |||
+ | <pawn> | ||
+ | public OnPlayerCommandText(playerid, cmdtext[]) | ||
+ | { | ||
+ | if (!strcmp("/GetMyCarVelocity", cmdtext) && IsPlayerInAnyVehicle(playerid)) | ||
+ | { | ||
+ | new Float:Velocity[3], output[80]; | ||
+ | GetVehicleVelocity(GetPlayerVehicleID(playerid), Velocity[0], Velocity[1], Velocity[2]); | ||
+ | format(output, sizeof(output), "Votre vitesse : X%f, Y%f, Z%f", Velocity[0], Velocity[1], Velocity[2]); | ||
+ | SendClientMessage(playerid, 0xFFFFFFFF, output); | ||
+ | return 1; | ||
+ | } | ||
+ | return 0; | ||
+ | } | ||
+ | </pawn> | ||
+ | |||
+ | {{RelatedFunctionsFR}} | ||
+ | *[[GetPlayerVelocity_FR|GetPlayerVelocity:]] Récupère la vitesse x, y et z d'un véhicule | ||
+ | *[[SetVehicleVelocity_FR|SetVehicleVelocity:]] Modifier la vitesse x, y et z d'un véhicule | ||
+ | *[[SetPlayerVelocity_FR|SetPlayerVelocity:]] Modifier la vitesse x, y et z d'un joueur | ||
+ | |||
[[Category:Scripting Functions FR]] | [[Category:Scripting Functions FR]] |
Revision as of 08:26, 6 January 2013
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 vhicule
(vehicleid, &Float:x, &Float:y, &Float:z)
vehicleid | L'ID du véhicule dont on doit obtenir la vitesse. |
&Float:x | La variable Float où stocker la vitesse X. |
&Float:y | La variable Float où stocker la vitesse Y. |
&Float:z | La variable Float où stocker la vitesse Z. |
Retourne:
Cette fonction ne retourne pas de valeur particulière. Les valeurs X, Y et Z sont stockés dans des variables.
public OnPlayerCommandText(playerid, cmdtext[]) { if (!strcmp("/GetMyCarVelocity", cmdtext) && IsPlayerInAnyVehicle(playerid)) { new Float:Velocity[3], output[80]; GetVehicleVelocity(GetPlayerVehicleID(playerid), Velocity[0], Velocity[1], Velocity[2]); format(output, sizeof(output), "Votre vitesse : X%f, Y%f, Z%f", Velocity[0], Velocity[1], Velocity[2]); SendClientMessage(playerid, 0xFFFFFFFF, output); return 1; } return 0; }
Fonctions Relatives
Les fonctions suivantes peuvent être utiles car elles sont indirectement ou directement liées a cette fonction.
- GetPlayerVelocity: Récupère la vitesse x, y et z d'un véhicule
- SetVehicleVelocity: Modifier la vitesse x, y et z d'un véhicule
- SetPlayerVelocity: Modifier la vitesse x, y et z d'un joueur