Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <a_samp>
- #include <zcmd>
- #include <sscanf2>
- #define Rojo 0xFF0000FF
- #define VerdeC 0x00FF00FF
- new Float:Jumping[MAX_PLAYERS];
- public OnFilterScriptInit()
- {
- for (new i = 0; i < MAX_PLAYERS; i++)
- {
- if (IsPlayerConnected(i) && !IsPlayerNPC(i))
- {
- Jumping[i] = 0.2;
- }
- }
- return 1;
- }
- public OnFilterScriptExit()
- {
- return 1;
- }
- public OnPlayerConnect(playerid)
- {
- Jumping[playerid] = 0.2;
- return 1;
- }
- CMD:jumpcar(playerid,params[])
- {
- new string[128]; new Float:jumping;
- if(sscanf(params, "f", jumping)) return SendClientMessage(playerid, Rojo, "Use: /jumpcar [0.0 - 0.5]");
- if(jumping < 0.0 || jumping > 0.5) return SendClientMessage(playerid, Rojo, "Use: /jumpcar [0.0 - 0.5]");
- Jumping[playerid] = jumping;
- format(string,128, "* You put your car jump in %0.2f", Jumping[playerid]);
- SendClientMessage(playerid, VerdeC, string);
- return 1;
- }
- public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
- {
- if (IsPlayerInAnyVehicle(playerid) && GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
- {
- if (newkeys & KEY_CROUCH)
- {
- new Float:x, Float:y, Float:z;
- GetVehicleVelocity(GetPlayerVehicleID(playerid), x, y, z);
- SetVehicleVelocity(GetPlayerVehicleID(playerid), x, y, z + Jumping[playerid]);
- return 1;
- }
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment