Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <a_samp>
- #define VUP\
- 2008
- #define VUP2\
- 2009
- #define VUPSELKEY\
- 2010
- #define COLOR_RED\
- 0xAA3333AA
- new
- VupKey[MAX_PLAYERS],
- Vup[MAX_PLAYERS],
- JumpSize[MAX_PLAYERS],
- E[2] = "3",
- H[2] = "h",
- Z[2] = "Z",
- R[2] = "r",
- O[2] = "0"
- ;
- stock IsNumeric(string[])
- {
- for (new i = 0, j = strlen(string); i < j; i++){if (string[i] > '9' || string[i] < '0')
- return 0;}
- return 1;
- }
- public OnFilterScriptInit(){printf("[[/vup by %s%s%s%s%s]]",Z,H,E,R,O); return 1;}
- public OnFilterScriptExit(){return 1;}
- public OnPlayerConnect(playerid){Vup[playerid] = 0;JumpSize[playerid] = 0;VupKey[playerid] = 0; return 1;}
- public OnPlayerDisconnect(playerid){Vup[playerid] = 0;JumpSize[playerid] = 0;VupKey[playerid] = 0; return 1;}
- public OnPlayerCommandText(playerid, cmdtext[])
- {
- if(!strcmp(cmdtext, "/vup",true) || !strcmp(cmdtext, "/vhop",true))
- {
- if(IsPlayerInAnyVehicle(playerid))
- {
- ShowPlayerDialog(playerid, VUP, DIALOG_STYLE_INPUT, "Size:", "Please insert the height that your car will hop!\nValues are: 1-4","Ok","Exit");
- }
- else
- {
- SendClientMessage(playerid, COLOR_RED, "Error: You are not in a vehicle.");
- return 1;
- }
- return 1;
- }
- if(!strcmp(cmdtext, "/vupoff",true) || !strcmp(cmdtext, "/vhopoff",true)){
- if(IsPlayerInAnyVehicle(playerid)){
- if(Vup[playerid] == 1){
- Vup[playerid] = 0;
- JumpSize[playerid] = 0;
- ShowPlayerDialog(playerid, VUP2, DIALOG_STYLE_MSGBOX, "Disabled:", "You stopped from using /vup.Type /vup again to HOP AGAIN!\n Current value: 0","Ok","Exit");
- }else ShowPlayerDialog(playerid, VUP2, DIALOG_STYLE_MSGBOX, "/VUP:", "/vup is currently OFF! \nTo enable it type /vup and type the requested numbers.","Ok","Exit");
- }else SendClientMessage(playerid, COLOR_RED, "Error: You are not in a vehicle.");
- return 1;}
- return 0;
- }
- public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
- {
- if (IsPlayerInAnyVehicle(playerid) && GetPlayerState(playerid) == PLAYER_STATE_DRIVER && Vup[playerid] == 1){
- if (newkeys & KEY_CROUCH && VupKey[playerid] == 1){
- new Float:xx, Float:xy, Float:xz;
- GetVehicleVelocity(GetPlayerVehicleID(playerid), xx, xy, xz);
- if(JumpSize[playerid] == 1){SetVehicleVelocity(GetPlayerVehicleID(playerid), xx, xy, xz + 0.1);}
- if(JumpSize[playerid] == 2){SetVehicleVelocity(GetPlayerVehicleID(playerid), xx, xy, xz + 0.2);}
- if(JumpSize[playerid] == 3){SetVehicleVelocity(GetPlayerVehicleID(playerid), xx, xy, xz + 0.3);}
- if(JumpSize[playerid] == 4){SetVehicleVelocity(GetPlayerVehicleID(playerid), xx, xy, xz + 0.4);}
- return 1;}
- if (newkeys & KEY_ACTION && VupKey[playerid] == 2){
- new Float:xx, Float:xy, Float:xz;
- GetVehicleVelocity(GetPlayerVehicleID(playerid), xx, xy, xz);
- if(JumpSize[playerid] == 1){SetVehicleVelocity(GetPlayerVehicleID(playerid), xx, xy, xz + 0.1);}
- if(JumpSize[playerid] == 2){SetVehicleVelocity(GetPlayerVehicleID(playerid), xx, xy, xz + 0.2);}
- if(JumpSize[playerid] == 3){SetVehicleVelocity(GetPlayerVehicleID(playerid), xx, xy, xz + 0.3);}
- if(JumpSize[playerid] == 4){SetVehicleVelocity(GetPlayerVehicleID(playerid), xx, xy, xz + 0.4);}
- return 1;}
- if (newkeys & KEY_FIRE && VupKey[playerid] == 3){
- new Float:xx, Float:xy, Float:xz;
- GetVehicleVelocity(GetPlayerVehicleID(playerid), xx, xy, xz);
- if(JumpSize[playerid] == 1){SetVehicleVelocity(GetPlayerVehicleID(playerid), xx, xy, xz + 0.1);}
- if(JumpSize[playerid] == 2){SetVehicleVelocity(GetPlayerVehicleID(playerid), xx, xy, xz + 0.2);}
- if(JumpSize[playerid] == 3){SetVehicleVelocity(GetPlayerVehicleID(playerid), xx, xy, xz + 0.3);}
- if(JumpSize[playerid] == 4){SetVehicleVelocity(GetPlayerVehicleID(playerid), xx, xy, xz + 0.4);}
- return 1;}
- }
- return 1;
- }
- public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
- {
- if (dialogid == VUPSELKEY){
- if(response == 1){
- if(inputtext[0]){
- if(IsNumeric(inputtext[0])){
- new KeyString[256],
- KeyString2[50]
- ;
- if(inputtext[0] > '3')
- {
- format(KeyString, sizeof(KeyString), "ERROR!There is no number %d in the list below!\nWrite:\n\t1 - (H)Horn Key\n\t2 - (CTRL)Left CTRL\n\t3 - (FIRE)Left Click",inputtext,JumpSize[playerid]);
- ShowPlayerDialog(playerid, VUPSELKEY, DIALOG_STYLE_INPUT, "Succes:", KeyString,"Ok","Exit");
- }else{
- if(inputtext[0] == '1'){VupKey[playerid] = 1;KeyString2 = "(H)Horn Key";}
- if(inputtext[0] == '2'){VupKey[playerid] = 2;KeyString2 = "(CTRL)Left CTRL";}
- if(inputtext[0] == '3'){VupKey[playerid] = 3;KeyString2 = "(Fire)Left Click";}
- format(KeyString, sizeof(KeyString), "Succes!!\bYou selected %s, now press it to jump!\nType /vupoff to disable it!",KeyString2);
- ShowPlayerDialog(playerid, VUP2, DIALOG_STYLE_MSGBOX,"Succes!", KeyString,"Ok","Exit");
- }
- }
- }else{
- new JumpString[256];
- format(JumpString, sizeof(JumpString), "ERROR!No number found in the input!\nWrite:\n\t1 - (H)Horn Key\n\t2 - (CTRL)Left CTRL\n\t3 - (FIRE)Left Click",JumpSize[playerid]);
- ShowPlayerDialog(playerid, VUPSELKEY, DIALOG_STYLE_INPUT, "Succes:", JumpString,"Ok","Exit");
- }
- }
- if(response == 0)
- {
- Vup[playerid] = 0;
- JumpSize[playerid] = 0;
- VupKey[playerid] = 0;
- SendClientMessage(playerid, COLOR_RED, "You just disabled /vup.Type again to activate!");
- return 0;
- }
- }
- if (dialogid == VUP){
- if(response == 1){
- if(inputtext[0]){
- if(IsNumeric(inputtext[0])){
- if(inputtext[0] > '4'){ShowPlayerDialog(playerid, VUP, DIALOG_STYLE_INPUT, "Size:", "Please insert the height that your car will hop!\nValues are: 1-4","Ok","Exit");
- }else{
- new JumpString[256],
- InSetValue = strval(inputtext)
- ;
- Vup[playerid] = 1;
- JumpSize[playerid] = InSetValue;
- format(JumpString, sizeof(JumpString), "Succes!\nYou selected value %d!\nNow, select the number to select the button with wich\nyou will have to press to jump\nWrite:\n\t1 - (H)Horn Key\n\t2 - (CTRL)Left CTRL\n\t3 - (Fire)Left Click",JumpSize[playerid]);
- ShowPlayerDialog(playerid, VUPSELKEY, DIALOG_STYLE_INPUT, "Succes:", JumpString,"Ok","Exit");
- }
- if(inputtext[0] > 'E'){
- if(Vup[playerid] == 1){
- Vup[playerid] = 0;
- JumpSize[playerid] = 0;
- ShowPlayerDialog(playerid, VUP2, DIALOG_STYLE_MSGBOX, "Succes:", "Succes!\nYou disabled /VUP by typing E in the dialog..","Ok","Exit");}}
- if(inputtext[0] > '0'){
- }else ShowPlayerDialog(playerid, VUP, DIALOG_STYLE_INPUT, "Size:", "ERROR! Value 0 is incorrect!\nPlease insert again!Values are: 1-4","Ok","Exit");
- }else ShowPlayerDialog(playerid, VUP, DIALOG_STYLE_INPUT, "Size:", "ERROR!Only numbers allowed!\nPlease insert the height that your car will hop!\nValues are: 1-4","Ok","Exit");
- }else ShowPlayerDialog(playerid, VUP, DIALOG_STYLE_INPUT, "Size:", "Please insert the height that your car will hop!\nValues are: 1-4","Ok","Exit");
- }
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment