GetVehicleVelocity FR

From SA-MP Wiki

(Difference between revisions)
Jump to: navigation, search
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




Cette fonction a été ajoutée dans SA-MP 0.3a et ne fonctionne pas dans les versions antérieures


Description:

Récupère la vitesse X, Y et Z d'un vhicule


Paramètres:
(vehicleid, &Float:x, &Float:y, &Float:z)
vehicleidL'ID du véhicule dont on doit obtenir la vitesse.
&Float:xLa variable Float où stocker la vitesse X.
&Float:yLa variable Float où stocker la vitesse Y.
&Float:zLa 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.