Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <a_samp>
- #include <zcmd>
- #include <sscanf2>
- new LastCarSpawn[MAX_PLAYERS],
- LastJumpCar[MAX_PLAYERS],
- LastBoostCar[MAX_PLAYERS],
- Float:Velocity[3];
- forward ResetJump(playerid);
- forward ResetBoost(playerid);
- public OnPlayerConnect(playerid)
- {
- LastCarSpawn[playerid] = -1; LastStuntSpawn[playerid] = -1; LastJumpCar[playerid] = -1; LastBoostCar[playerid] = -1;
- return 1;
- }
- public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
- {
- if(newkeys == KEY_YES)
- {
- if(IsPlayerInAnyVehicle(playerid))
- {
- if(LastJumpCar[playerid] != -1)
- {
- SendClientMessage(playerid,-1,"{F60121}[Erreur:] Le JUMP de votre véhicule n'est pas écoulé.");
- return 1;
- }
- new vehicleid; vehicleid = GetPlayerVehicleID(playerid);
- SetVelocityCar(vehicleid,0.0,0.0,0.3);
- LastJumpCar[playerid] = 1;
- SetTimerEx("ResetJump",5000,0,"i",playerid);
- }
- return 1;
- }
- if(newkeys == KEY_CROUCH)
- {
- if(IsPlayerInAnyVehicle(playerid))
- {
- if(LastBoostCar[playerid] != -1)
- {
- SendClientMessage(playerid,-1,"{F60121}[Erreur:] Le boost de votre véhicule n'est pas écoulé.");
- return 1;
- }
- new vehicleid; vehicleid = GetPlayerVehicleID(playerid);
- SetVelocityCar(vehicleid,0.0,0.3,0.0);
- LastBoostCar[playerid] = 1;
- SetTimerEx("ResetBoost",5000,0,"i",playerid);
- }
- return 1;
- }
- return 1;
- }
- public ResetJump(playerid)
- {
- SendClientMessage(playerid,-1,"{ADAEAD}[Info:] {C5F601}Le jump est de nouveau opérationnel");
- LastJumpCar[playerid] = -1;
- return 1;
- }
- public ResetBoost(playerid)
- {
- SendClientMessage(playerid,-1,"{ADAEAD}[Info:] {C5F601}Le boost est de nouveau opérationnel");
- LastBoostCar[playerid] = -1;
- return 1;
- }
- stock SetVelocityCar(vehicleid,Float:X,Float:Y,Float:Z)
- {
- GetVehicleVelocity(vehicleid,Velocity[0], Velocity[1], Velocity[2]);
- SetVehicleVelocity(vehicleid,Velocity[0]+X, Velocity[1]+Y, Velocity[2]+Z);
- return 1;
- }
- COMMAND:creerveh(playerid,params[])
- {
- new idcar, idcolor[2],Float:Pos[3];
- if(sscanf(params, "iii", idcar,idcolor[0],idcolor[1])) return SendClientMessage(playerid,-1,"{ADAEAD}[Info:] {C5F601}/creerveh <id> <couleur1> <couleur2>");
- {
- if(idcar > 399 && idcar < 613)
- {
- if(LastCarSpawn[playerid] != -1)
- DestroyVehicle(LastCarSpawn[playerid]);
- GetPlayerPos(playerid,Pos[0],Pos[1],Pos[2]);
- LastCarSpawn[playerid] = CreateVehicle(idcar,Pos[0],Pos[1],Pos[2], 0.0,idcolor[0],idcolor[1], 0);
- PutPlayerInVehicle(playerid,LastCarSpawn[playerid],0);
- SendClientMessage(playerid,-1,"{ADAEAD}[Info:] {C5F601}Véhicule spawn");
- return 1;
- }
- SendClientMessage(playerid,-1,"{F60121}[Erreur:] L'id du véhicule n'est pas la bonne");
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement