GetPlayerVelocity FR

From SA-MP Wiki

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



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 joueur. Peut être utile notamment dans les compteurs de vitesse (speedometers)


Paramètres:
(playerid, &Float:x, &Float:y, &Float:z)
playeridLe joueur dont la vitesse sera récupérée
&Float:xLa variable (float) qui récupérera la vitesse X.
&Float:yLa variable (float) qui récupérera la vitesse Y.
&Float:zLa 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.