Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- Copyright(c), Roach™
- .___________________________________________________________________________________________.
- | |
- | ____ __ __ |
- | | _ \ | | | | |
- | | |_| | _____ _______ _____ | |__| | |
- | | / | _ | | ___ | | ___| | __ | |
- | | |\ \ _ | |_| | _ | |___| | _ | |___ _ | | | | _ |
- | |_| \_\|_||_____||_||_| |_||_||_____||_||__| |__||_| |
- | |
- |._________________________________________________________________________________________.|
- R.O.A.C.H.
- //==============================================================================
- /--> Details/Questions/Updates:
- [TOPIC]: http://sa-mp.ro/forum/index.php
- */
- //==============================================================================
- // Includes
- //==============================================================================
- #include <a_samp>
- #include <zcmd>
- //==============================================================================
- //|----------------------------------------------------------------------------|
- // Config
- //==============================================================================
- //==============================================================================
- // Defines
- //==============================================================================
- #define FILTERSCRIPT true
- //==============================================================================
- // Speed-Boost
- //==============================================================================
- #define SB 2013
- #define SB2 2014
- #define SBK 2015
- //==============================================================================
- // Colors
- //==============================================================================
- #define COLOR_RED 0xAA3333AA
- #define COLOR_INFO 0x4077F7FF
- //==============================================================================
- // End Config
- //|----------------------------------------------------------------------------|
- //==============================================================================
- new SbK[MAX_PLAYERS], Sb[MAX_PLAYERS], Velocity[MAX_PLAYERS];
- #if FILTERSCRIPT == true
- public OnFilterScriptInit()
- {
- new h, mins, y, m, d;
- gettime(h,mins);
- getdate(y,m,d);
- print("\n ___________________________________________________");
- print(" ");
- print(" Speed-Boost ");
- print(" --------------- ");
- print(" B.Y. ");
- print(" R.O.A.C.H ");
- print(" ___________________________________________________\n");
- print(" ");
- print(" |-> Loaded Successfully!\n ");
- printf(" Today: %d/%d/%d - Hour: %d:%d", d, m, y, h, mins);
- print(" ___________________________________________________\n");
- return 1;
- }
- public OnFilterScriptExit()
- {
- print("\n ___________________________________________________");
- print(" ");
- print(" Speed-Boost ");
- print(" --------------- ");
- print(" B.Y. ");
- print(" R.O.A.C.H ");
- print(" ___________________________________________________\n");
- print(" |-> Unloaded!");
- return 1;
- }
- #endif
- public OnPlayerConnect(playerid)
- {
- SbK[playerid] = 0; Sb[playerid] = 0; Velocity[playerid] = 0;
- return 1;
- }
- public OnPlayerDisconnect(playerid, reason)
- {
- SbK[playerid] = 0; Sb[playerid] = 0; Velocity[playerid] = 0;
- return 1;
- }
- //==============================================================================
- // Commands
- //==============================================================================
- CMD:speedboost(playerid, params[])
- {
- if(IsPlayerInAnyVehicle(playerid)) ShowPlayerDialog(playerid, SB, DIALOG_STYLE_INPUT, " ", "\t\t {4077F7}[SIZE]\n\n{FFFFFF}Please insert the height for your car velocity!\nValues are: {7F7F7F}1{FFFFFF} - {7F7F7F}3","Ok","Exit");
- else SendClientMessage(playerid, COLOR_RED, "[ERROR]: {FFFFFF}You are not in a vehicle.");
- return 1;
- }
- CMD:sb(playerid, params[]) return cmd_speedboost(playerid, params);
- CMD:sboff(playerid, params[])
- {
- if(Sb[playerid] == 0) return ShowPlayerDialog(playerid, SB2, DIALOG_STYLE_MSGBOX, "[ERROR]:", "{F40900}/speedboost {FFFFFF}is currently OFF! \nTo enable it type {F40900}/speedboost {FFFFFF}and type the requested numbers.","Ok","");
- Sb[playerid] = 0;
- Velocity[playerid] = 0;
- return ShowPlayerDialog(playerid, SB2, DIALOG_STYLE_MSGBOX, " ", "\t\t{4077F7}[INFO]\n\n{FFFFFF}You stopped from using {F40900}/speedboost{FFFFFF}.\nType {F40900}/speedboost {FFFFFF}again FOR SPEED!\n Current value: {7F7F7F}0","Ok","");
- }
- CMD:speedboostoff(playerid, params[]) return cmd_sboff(playerid, params);
- public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
- {
- new Float:vx, Float:vy, Float:vz;
- GetVehicleVelocity(GetPlayerVehicleID(playerid), vx, vy, vz);
- if(IsPlayerInAnyVehicle(playerid) && GetPlayerState(playerid) == PLAYER_STATE_DRIVER && Sb[playerid] == 1)
- {
- if (newkeys & KEY_ACTION && SbK[playerid] == 2)
- {
- if(Velocity[playerid] == 1) return SetVehicleVelocity(GetPlayerVehicleID(playerid), vx * 1.4, vy * 1.4, vz);
- if(Velocity[playerid] == 2) return SetVehicleVelocity(GetPlayerVehicleID(playerid), vx * 1.8, vy * 1.8, vz);
- if(Velocity[playerid] == 3) return SetVehicleVelocity(GetPlayerVehicleID(playerid), vx * 2.0, vy * 2.0, vz);
- return 1;
- }
- if (newkeys & KEY_CROUCH && SbK[playerid] == 1)
- {
- if(Velocity[playerid] == 1) return SetVehicleVelocity(GetPlayerVehicleID(playerid), vx * 1.4, vy * 1.4, vz);
- if(Velocity[playerid] == 2) return SetVehicleVelocity(GetPlayerVehicleID(playerid), vx * 1.8, vy * 1.8, vz);
- if(Velocity[playerid] == 3) return SetVehicleVelocity(GetPlayerVehicleID(playerid), vx * 2.0, vy * 2.0, vz);
- return 1;
- }
- if (newkeys & KEY_FIRE && SbK[playerid] == 3)
- {
- if(Velocity[playerid] == 1) return SetVehicleVelocity(GetPlayerVehicleID(playerid), vx * 1.4, vy * 1.4, vz);
- if(Velocity[playerid] == 2) return SetVehicleVelocity(GetPlayerVehicleID(playerid), vx * 1.8, vy * 1.8, vz);
- if(Velocity[playerid] == 3) return SetVehicleVelocity(GetPlayerVehicleID(playerid), vx * 2.0, vy * 2.0, vz);
- return 1;
- }
- }
- return 1;
- }
- public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
- {
- new VS[500], KS1[300], KS2[35];
- if(dialogid == SB)
- {
- if(response == 1)
- {
- new VValue = strval(inputtext);
- if(!inputtext[0]) return ShowPlayerDialog(playerid, SB, DIALOG_STYLE_INPUT, " ", "\t\t {4077F7}[SIZE]\n\n{FFFFFF}Please insert the value for your car velocity!\nValues are: {7F7F7F}1{FFFFFF} - {7F7F7F}3","Ok","Exit");
- if(!IsNumeric(inputtext[0])) return ShowPlayerDialog(playerid, SB, DIALOG_STYLE_INPUT, " ", "\t\t {AA3333}[ERROR]\n\n{FFFFFF}Only numbers allowed!\nPlease insert the height for your car velocity!\nValues are: {7F7F7F}1{FFFFFF} - {7F7F7F}3","Ok","Exit");
- if(inputtext[0] > '3') return ShowPlayerDialog(playerid, SB, DIALOG_STYLE_INPUT, " ", "\t {AA3333}[ERROR]\n\n{FFFFFF}Invalid value!\nPlease insert again!\nValues are: {7F7F7F}1{FFFFFF} - {7F7F7F}3","Ok","Exit");
- if(inputtext[0] == '0') return ShowPlayerDialog(playerid, SB, DIALOG_STYLE_INPUT, " ", "\t {AA3333}[ERROR]\n\n{FFFFFF}Value 0 is incorrect!\nPlease insert again!\nValues are: {7F7F7F}1{FFFFFF} - {7F7F7F}3","Ok","Exit");
- Sb[playerid] = 1;
- Velocity[playerid] = VValue;
- format(VS, sizeof(VS), "\t\t {4077F7}[KEY's]\n\n{FFFFFF}You selected value {7F7F7F}%d{FFFFFF}!\nNow, select the number to select the button with wich\nyou will have to press to jump\nWrite:\n\t{7F7F7F}1 {FFFFFF}- {67A9F7}Horn Key(H)\n\t{7F7F7F}2 {FFFFFF}- {67A9F7}Left CTRL(CTRL)\n\t{7F7F7F}3 {FFFFFF}- {67A9F7}Left Click(FIRE)",Velocity[playerid]);
- return ShowPlayerDialog(playerid, SBK, DIALOG_STYLE_INPUT, " ", VS,"Ok","Exit");
- }
- }
- if(dialogid == SBK)
- {
- if(response == 1)
- {
- if(!inputtext[0]) return format(VS, sizeof(VS), "\t\t {AA3333}[ERROR]\n\n{FFFFFF}No number found in the input!\nWrite:\n\t{7F7F7F}1 {FFFFFF}- {67A9F7}Horn Key(H)\n\t{7F7F7F}2 {FFFFFF}- {67A9F7}Left CTRL(CTRL)\n\t{7F7F7F}3 {FFFFFF}- {67A9F7}Left Click(FIRE)",Velocity[playerid]), ShowPlayerDialog(playerid, SBK, DIALOG_STYLE_INPUT, " ", VS,"Ok","Exit");
- if(!IsNumeric(inputtext[0])) return ShowPlayerDialog(playerid, SBK, DIALOG_STYLE_INPUT, " ", "\t\t {AA3333}[ERROR]\n\n{FFFFFF}Only numbers allowed!\nSelect a number to select the button with wich\nyou will have to press to jump\nWrite:\n\t{7F7F7F}1 {FFFFFF}- {67A9F7}Horn Key(H)\n\t{7F7F7F}2 {FFFFFF}- {67A9F7}Left CTRL(CTRL)\n\t{7F7F7F}3 {FFFFFF}- {67A9F7}Left Click(FIRE)","Ok","Exit");
- if(inputtext[0] > '3') return format(KS1, sizeof(KS1), "\t {AA3333}[ERROR]\n\n{FFFFFF}There is no number %d in the list below!\nWrite:\n\t{7F7F7F}1 {FFFFFF}- {67A9F7}Horn Key(H)\n\t{7F7F7F}2 {FFFFFF}- {67A9F7}Left CTRL(CTRL)\n\t{7F7F7F}3 {FFFFFF}- {67A9F7}Left Click(FIRE)",inputtext,Velocity[playerid]), ShowPlayerDialog(playerid, SBK, DIALOG_STYLE_INPUT, " ", KS1,"Ok","Exit");
- if(inputtext[0] == '1') SbK[playerid] = 1, KS2 = "{67A9F7}Horn Key(H){FFFFFF}";
- if(inputtext[0] == '2') SbK[playerid] = 2, KS2 = "{67A9F7}Left CTRL(CTRL){FFFFFF}";
- if(inputtext[0] == '3') SbK[playerid] = 3, KS2 = "{67A9F7}Left Click(Fire){FFFFFF}";
- format(KS1, sizeof(KS1), "\t\t {4077F7}[INFO]\n\n{FFFFFF}You selected %s{FFFFFF}, now press it for SPEED!\nType {F40900}/sboff {FFFFFF}to disable it!",KS2);
- return ShowPlayerDialog(playerid, SB2, DIALOG_STYLE_MSGBOX," ", KS1,"Ok","");
- }
- }
- return 1;
- }
- stock IsNumeric(nstring[])
- {
- for (new i = 0, j = strlen(nstring);
- i < j; i++)
- {
- if (nstring[i] > '9' || nstring[i] < '0')
- return 0;
- }
- return 1;
- }
- // © R.O.A.C.H. 2010 - 2011 -- All rights Reserved
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement