GetVehicleVelocity FR

From SA-MP Wiki

(Difference between revisions)
Jump to: navigation, search
Revision as of 01:16, 5 February 2014
Connor Mead (Talk | contribs)

← Previous diff
Revision as of 01:17, 5 February 2014
Connor Mead (Talk | contribs)

Next diff →
Line 34: Line 34:
[[Category:Scripting Functions FR]] [[Category:Scripting Functions FR]]
 +
 +[[en:GetVehicleVelocity]]

Revision as of 01:17, 5 February 2014



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 véhicule


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.

In other languages