XADRENALINEIX

Motions97's Ralistic Taser

Jul 6th, 2013
121
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.70 KB | None | 0 0
  1. #include <natives.h>
  2. #include <common.h>
  3. #include <consts.h>
  4. #include <types.h>
  5. #include <strings.h>
  6. #include <xboxpad.h>
  7.  
  8.  
  9. void zzzz(void){
  10.     if(IS_BUTTON_PRESSED(0,BUTTON_LT) && IS_BUTTON_JUST_PRESSED(0,BUTTON_A)){
  11.         if(GET_HOST_ID() != GET_PLAYER_ID()){
  12.             int network_player,i;
  13.             float x,y,z;
  14.             for(i = 0;i <= 15;i++){
  15.                 if(!IS_NETWORK_PLAYER_ACTIVE(i)) continue;
  16.                 if(i == GET_PLAYER_ID()) continue;
  17.                 GET_PLAYER_CHAR(i, &network_player);
  18.                 if(!DOES_CHAR_EXIST(network_player)) continue;
  19.                 GET_OFFSET_FROM_CHAR_IN_WORLD_COORDS(network_player, 0,0,0,&x,&y,&z);
  20.                 if(IS_PLAYER_FREE_AIMING_AT_CHAR(GET_PLAYER_ID(), network_player) || IS_PLAYER_TARGETTING_CHAR(GET_PLAYER_ID(),network_player)){
  21.                     print("Taser Deployed");
  22.                     START_PTFX_ON_PED("ambient_electrical_sparks", network_player, 0, 0, 0, 1, 1, 1, 1);
  23.                     ADD_EXPLOSION(x,y,z,EXPLOSION_DIR_WATER_HYDRANT,5.0,false,true,0.0);
  24.                     ADD_EXPLOSION(x + 2.0,y,z,EXPLOSION_DIR_WATER_HYDRANT,5.0,false,true,0.0);
  25.                     ADD_EXPLOSION(x,y + 2.0,z,EXPLOSION_DIR_WATER_HYDRANT,5.0,false,true,0.0);
  26.                     ADD_EXPLOSION(x - 2.0,y,z,EXPLOSION_DIR_WATER_HYDRANT,5.0,false,true,0.0);
  27.                     ADD_EXPLOSION(x,y - 2.0,z,EXPLOSION_DIR_WATER_HYDRANT,5.0,false,true,0.0);
  28.                     WAIT(2000);
  29.                     REMOVE_PTFX_FROM_PED(network_player);
  30.                     return;
  31.                 }
  32.             }
  33.             return;
  34.         }
  35.         else{
  36.             print("Cannot use this because you are ~r~host");
  37.         }
  38.     }
  39. }
  40.  
  41. void main(void){
  42.     THIS_SCRIPT_IS_SAFE_FOR_NETWORK_GAME();
  43.     PRINT_STRING_WITH_LITERAL_STRING_NOW("STRING","Taser Glock by ~y~Motions97", 2000, 1);
  44.     GIVE_WEAPON_TO_CHAR(GetPlayerPed(),WEAPON_PISTOL,AMMO_MAX,false);
  45.     while(true){
  46.         zzzz();
  47.         WAIT(0);
  48.     }
  49. }
Advertisement
Add Comment
Please, Sign In to add comment