GTAOnline.net
San Andreas Multiplayer (sa:mp) => Scripting SA-MP [Pawn center] => Showroom SA:MP => Discussion démarrée par: ApocKalipsS le 23 Janvier 2010, 16:09:10
-
Hello,
Revenant d'un cours de Maths d'hier, je me suis dit que j'allais utiliser ce que j'ai appris.
Pour cela, j'ai fait une petite commande, qui est pratique, car un peu gonflant d'avoir un SetVehicleVelocity où l'on peut que aller en X ou Y :
Cette commande vous sert à vous donner un bon coup de boost vers l'angle auquel vous êtes orienté.
if(strcmp(cmd,"/vitesse",true)==0)
{
if(!IsPlayerInAnyVehicle(playerid))
{
new Float:Angle5;
new Float:Xx, Float:Yy, Float:Zz;
GetPlayerFacingAngle(playerid, Angle5);
GetPlayerPos(playerid, Xx, Yy, Zz);
new Float:DeltaX = 2 * (-floatsin(Angle5,degrees));
new Float:DeltaY = 2 * floatcos(Angle5,degrees);
SetPlayerVelocity(playerid, DeltaX, DeltaY, 0.1);
return 1;
}
if(IsPlayerInAnyVehicle(playerid))
{
new Float:Angle6;
GetVehicleZAngle(GetPlayerVehicleID(playerid), Angle6);
new Float:DeltaX = 2 * (-floatsin(Angle6,degrees));
new Float:DeltaY = 2 * floatcos(Angle6,degrees);
SetVehicleVelocity(GetPlayerVehicleID(playerid), DeltaX, DeltaY, 0.0);
return 1;
}
}
En haut de votre GM, vérifiez que vous ayez bien ceci : #include <float>
Intégrez cette commande dans "OnPlayerCommandText".
Je vous laisse profiter ! ;D
-
http://www.gtaonline.fr/forums/index.php/topic,2149.0.html (http://www.gtaonline.fr/forums/index.php/topic,2149.0.html)
-
Ah vi, j'avais pas vu ;D
A supprimer.
-
Sa ressemble un peu a un FS que j'avais trouvé sur le forum SAMP, si je le retrouve j'edit
-
Ah ;D
-
Béh
J' ai déjà fait un truc du genre sans trigo moi lol
dans mon FS Fun xd ^^