P1xeL

Humen class + zombie class

Dec 14th, 2012
176
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 16.36 KB | None | 0 0
  1. #include <amxmodx>
  2. #include <cstrike>
  3. #include <engine>
  4. #include <fun>
  5. #include <hamsandwich>
  6. #include <fakemeta_util>
  7.  
  8. #pragma semicolon 1
  9.  
  10. #define FLASH_SPEED         350.0       // viteza care o are Flash
  11. #define FLASHT_SPEED        350.0       // viteza care o are Flash
  12. #define FLASHTZ_SPEED       210.0       // viteza care o are Flash
  13. #define HULK_GRAVITY        0.75        // gravitatea setata lui hulk ( 1.0 = 800 )
  14. #define HULKT_GRAVITY       0.55        // gravitatea setata lui hulk ( 1.0 = 800 )
  15. #define PREDATOR_MULTIPLY   1.8     // damage facut inmultit cu 1.5 sau cat pui.
  16. #define ELF_INVISIBILITY    76      // ( 0 - 255 ) 2.55 este aproximativ 1% deci 76 vine cam 30% vizibil
  17.  
  18. #define PLUGIN "Plugin Nou"
  19. #define VERSION "1.0"
  20.  
  21. new  const  Models[  6  ][    ]  =
  22. {
  23.    
  24.     "",     //Null
  25.     "HumenClass",       //Flash
  26.     "HumenClass2",      //Hulk
  27.     "HumenClass3",      //Predator
  28.     "HumenClass4",      //Elf
  29.     "HumenClass5"       //Vip
  30.    
  31. };
  32.  
  33. new  const  ModelsT[  6  ][    ]  =
  34. {
  35.    
  36.     "",     //Null
  37.     "ZombieClass",      //Flash
  38.     "ZombieClass2",     //Hulk
  39.     "ZombieClass3",     //Predator
  40.     "ZombieClass4",     //Elf
  41.     "ZombieClass5"      //Vip
  42.    
  43. };
  44.  
  45. new  const  kModels[  3  ][    ]  =
  46. {
  47.    
  48.     "",         //Null
  49.     "models/HumenClassKnife.mdl",       //Flash
  50.     "models/HumenClassKnife2.mdl"       //Vip
  51.    
  52. };
  53.  
  54. new  const  kModelsT[  6  ][    ]  =
  55. {
  56.    
  57.     "",         //Null
  58.     "models/ZombieClass.mdl",
  59.     "models/ZombieClass2.mdl"//Flash
  60.     "models/ZombieClass3.mdl",
  61.     "models/ZombieClass4.mdl",
  62.     "models/ZombieClass5.mdl"       //Vip
  63.    
  64. };
  65.  
  66. new  const  MenuName[    ]  =  " \wRase \rHuman^n";
  67. new  const  MenuNameT[    ]  =  " \wChoose \y Your Class :^n";
  68. new  const  NumeSite[    ]  =  "\yRase Human";
  69.  
  70. new  bool:UserIsFlash[  33  ], bool:UserIsHulk[  33  ], bool:UserIsPredator[  33  ], bool:UserIsElf[  33  ], bool:UserIsVIp[  33  ];
  71. new  bool:UserIsFlashT[  33  ], bool:UserIsHulkT[  33  ], bool:UserIsPredatorT[  33  ], bool:UserIsElfT[  33  ], bool:UserIsVIpT[  33  ];
  72. new  bool:UserChoosed[  33  ];
  73.  
  74. public  plugin_precache(    )
  75. {
  76.    
  77.     new  ModelPath[  64  ];
  78.    
  79.     for(  new  i  = 1;  i  <  6;  i++  )
  80.     {
  81.         formatex(  ModelPath,  sizeof  (  ModelPath  )  -1, "models/player/%s/%s.mdl",  ModelsT[  i  ],  ModelsT[  i  ]  );
  82.         formatex(  ModelPath,  sizeof  (  ModelPath  )  -1, "models/player/%s/%s.mdl",  ModelsT[  i  ],  ModelsT[  i  ]  );
  83.         precache_model(  ModelPath  );
  84.        
  85.     }
  86.     for(  new  i  = 1;  i  <  3;  i++  )
  87.     {
  88.         precache_model(  kModels[  i  ]  );
  89.         precache_model(  kModelsT[  i  ]  );
  90.     }
  91. }
  92.  
  93. public plugin_cfg(    )    set_cvar_float(  "sv_maxspeed",  FLASH_SPEED  );
  94.  
  95. public plugin_init(    )
  96. {
  97.     register_plugin(  PLUGIN,  VERSION, "Askhanar"  );
  98.     register_clcmd(  "say /race",  "sayRace"  );
  99.    
  100.     RegisterHam(  Ham_Spawn,  "player",  "Ham_PlayerSpawnPost",  true  );
  101.     RegisterHam(  Ham_TakeDamage,  "player", "Ham_PlayerTakeDamage", false  );
  102.     register_clcmd("chooseteam", "clcmd_changeteam");
  103.     register_event( "CurWeapon", "evCurWeapon", "be", "1=1" );
  104.     register_event( "HLTV", "evHookRoundStart", "a", "1=0", "2=0" );
  105. }
  106.  
  107. public client_connect(id)
  108. {
  109.     SetCl_Settings(  id  ,  0  );
  110.     UserIsFlashT[  id  ]  =  false;
  111.     UserIsHulkT[  id  ]  =  false;
  112.     UserIsPredatorT[  id  ]  =  false;
  113.     UserIsElfT[  id  ]  =  false;
  114.     UserIsVIpT[  id  ]  =  false;
  115.     UserIsFlash[  id  ]  =  false;
  116.     UserIsHulk[  id  ]  =  false;
  117.     UserIsPredator[  id  ]  =  false;
  118.     UserIsElf[  id  ]  =  false;
  119.     UserIsVIp[  id  ]  =  false;
  120.     UserChoosed[  id  ]  =  false;
  121. }
  122.  
  123. public client_disconnect(id)
  124. {
  125.     SetCl_Settings(  id,  0  );
  126.     UserIsFlashT[  id  ]  =  false;
  127.     UserIsHulkT[  id  ]  =  false;
  128.     UserIsPredatorT[  id  ]  =  false;
  129.     UserIsElfT[  id  ]  =  false;
  130.     UserIsVIpT[  id  ]  =  false;
  131.     UserIsFlash[  id  ]  =  false;
  132.     UserIsHulk[  id  ]  =  false;
  133.     UserIsPredator[  id  ]  =  false;
  134.     UserIsElf[  id  ]  =  false;
  135.     UserIsVIp[  id  ]  =  false;
  136.     UserChoosed[  id  ]  =  false;
  137. }
  138.  
  139. public sayRace(  id  )
  140. {
  141.     if(  cs_get_user_team(  id  )  ==  CS_TEAM_CT   ) {
  142.         if( UserChoosed[  id  ]  )
  143.         {
  144.             client_print( id, print_chat, "[ Class System ] u Cant Choose Class 2 times In Round" );
  145.             return 1;
  146.         }
  147.         MainMenu(  id  );
  148.     }
  149.     else if(  cs_get_user_team(  id  )  ==  CS_TEAM_T   )   MainMenu(  id  );
  150.    
  151.     return 0;
  152. }
  153.  
  154. public clcmd_changeteam(id)
  155. {
  156.     if(  cs_get_user_team(  id  )  ==  CS_TEAM_CT   ) {
  157.         if( UserChoosed[  id  ]  )
  158.         {
  159.             client_print( id, print_chat, "[ Class System ] u Cant Choose Class 2 times In Round" );
  160.             return 1;
  161.         }
  162.         MainMenu(  id  );
  163.     }
  164.     else if(  cs_get_user_team(  id  )  ==  CS_TEAM_T   )   MainMenu(  id  );
  165.     return 0;
  166. }
  167.  
  168. public Ham_PlayerSpawnPost(  id  )
  169. {
  170.     if( !is_user_alive(  id  ) ||   UserChoosed[  id  ]  || cs_get_user_team(  id  )  ==  CS_TEAM_CT    ) {
  171.         client_print( id, print_chat, "[ Class System ] u Cant Choose Class 2 times In Round" );
  172.     }
  173.    
  174.     ResetUserSettings(  id  );
  175.     if(  cs_get_user_team(  id  )  ==  CS_TEAM_CT )   MainMenu(  id  );
  176.     else if(  cs_get_user_team(  id  )  ==  CS_TEAM_T   )   MainMenu(  id  );
  177.    
  178.     cs_reset_user_model(  id  );
  179.    
  180.     return HAM_IGNORED;
  181. }
  182.  
  183. public Ham_PlayerTakeDamage(  id,  iInflictor,  iAttacker,  Float:flDamage,  bitsDamageType  )
  184. {
  185.    
  186.     if(  !iAttacker ||  id  ==  iAttacker  ||  !is_user_connected(  iAttacker  )  ||  !is_user_connected(  id  )
  187.         ||  get_user_team(  id  )  ==  get_user_team(  iAttacker  )
  188.             || !UserIsPredator[  iAttacker  ]  || !UserIsVIp[  id  ] ) return HAM_IGNORED;
  189.    
  190.     SetHamParamFloat(  4, flDamage * PREDATOR_MULTIPLY  );
  191.    
  192.     return HAM_IGNORED;
  193. }
  194.  
  195. public evHookRoundStart( )
  196. {
  197.     new iPlayers[ 32 ];
  198.     new iPlayersNum;
  199.  
  200.     get_players( iPlayers, iPlayersNum, "ch" );    
  201.     for( new i = 0 ; i < iPlayersNum ; i++ )
  202.     {
  203.         UserChoosed[  iPlayers[  i  ]  ]  =  false;
  204.     }
  205.    
  206. }
  207.  
  208. public evCurWeapon( id )
  209. {
  210.     if( is_user_alive( id ) )
  211.     {
  212.        
  213.         if( cs_get_user_team(  id  )  ==  CS_TEAM_CT  )
  214.         {
  215.            
  216.             new clip, ammo, wpnid = get_user_weapon( id, clip, ammo );
  217.                
  218.             if( wpnid == CSW_KNIFE  )
  219.             {
  220.            
  221.                 if( UserIsFlash[ id ] )
  222.                 {
  223.                     entity_set_string( id, EV_SZ_viewmodel, kModels[ 1 ] );
  224.                 }
  225.                 else if( UserIsHulk[ id ] )
  226.                 {
  227.                     entity_set_string( id, EV_SZ_viewmodel, kModels[ 2 ] );
  228.                 }
  229.                 else if( UserIsPredator[ id ] )
  230.                 {
  231.                     entity_set_string( id, EV_SZ_viewmodel, kModels[ 1 ] );
  232.                 }
  233.                 else if( UserIsElf[ id ] )
  234.                 {
  235.                     entity_set_string( id, EV_SZ_viewmodel, kModels[ 2 ] );
  236.                 }
  237.                 else if(  UserIsVIp[  id  ]  )
  238.                 {
  239.                
  240.                     entity_set_string( id, EV_SZ_viewmodel, kModels[ 1 ] );
  241.                 }
  242.             }
  243.         }
  244.         else if( cs_get_user_team(  id  )  ==  CS_TEAM_T  )
  245.         {
  246.            
  247.             new clip, ammo, wpnid = get_user_weapon( id, clip, ammo );
  248.                
  249.             if( wpnid == CSW_KNIFE  )
  250.             {
  251.            
  252.                 if( UserIsFlashT[ id ] )
  253.                 {
  254.                     entity_set_string( id, EV_SZ_viewmodel, kModelsT[ 1 ] );
  255.                 }
  256.                 else if( UserIsHulkT[ id ] )
  257.                 {
  258.                     entity_set_string( id, EV_SZ_viewmodel, kModelsT[ 2 ] );
  259.                 }
  260.                 else if( UserIsPredatorT[ id ] )
  261.                 {
  262.                     entity_set_string( id, EV_SZ_viewmodel, kModelsT[ 3 ] );
  263.                 }
  264.                 else if( UserIsElfT[ id ] )
  265.                 {
  266.                     entity_set_string( id, EV_SZ_viewmodel, kModelsT[ 4 ] );
  267.                 }
  268.                 else if(  UserIsVIpT[  id  ]  )
  269.                 {
  270.                
  271.                     entity_set_string( id, EV_SZ_viewmodel, kModelsT[ 5 ] );
  272.                 }
  273.             }
  274.         }
  275.     }
  276.     return 0;
  277. }
  278.  
  279. public client_PreThink(  id  )
  280. {
  281.     if(  is_user_alive(  id  ) && is_user_connected(  id  )  &&  cs_get_user_team(  id  )  ==  CS_TEAM_CT  )
  282.     {
  283.         if( UserIsFlash[  id  ]  ||  UserIsVIp[  id  ] || UserIsFlashT[  id  ] )
  284.         {
  285.             set_user_maxspeed(  id,  FLASH_SPEED  );
  286.         }
  287.     }
  288.    
  289. }
  290.    
  291. public MainMenu( id )
  292. {
  293.     if( cs_get_user_team(  id  )  ==  CS_TEAM_T  ) {
  294.         new  menu  =  menu_create(  MenuNameT,  "MainMenuHandlerT"  )
  295.        
  296.         menu_additem(  menu,  "\wClassic \yZombie^n \r[\w =Balanced= \r]",  "1",  0  );
  297.         menu_additem(  menu,  "\wFast \yZombie^n \r[\w +Fast - HP \r]",  "2",  0  );
  298.         menu_additem(  menu,  "\wJumper \yZombie^n \r[\w +Jump -HP \r]",  "3",  0  );
  299.         menu_additem(  menu,  "\rWereWolf ^n \r[\w =Balanced= \r]",  "4",  0  );
  300.         menu_additem(  menu,  "\wTanker \y Zombie^n \r[\w +HP -Fast \r]",  "5",  0  );
  301.        
  302.         menu_setprop(  menu,  MPROP_EXITNAME,  NumeSite  );
  303.        
  304.         menu_display(  id,  menu,  0  );
  305.     }
  306.     else if( cs_get_user_team(  id  )  ==  CS_TEAM_CT  ) {
  307.         new  menu  =  menu_create(  MenuName,  "MainMenuHandler"  );   
  308.        
  309.         menu_additem(  menu,  "Super Fast \r[\yHigh Speed \w+ \yM4a1 \w+ \yDeagle\r]",  "1",  0  );
  310.         menu_additem(  menu,  "Gravity Man \r[\yGravity \w+ \yAk47 \w+ \yDeagle\r]",  "2",  0  );
  311.         menu_additem(  menu,  "TerminaToR \r[\yDamage Ridicat \w+ \yM249 \w+ \yUsp\r]",  "3",  0  );
  312.         menu_additem(  menu,  "ELF \r[\yInvizibilitate \w+ \yM4a1 \w+ \yUsp\r]^n",  "4",  0  );
  313.         menu_additem(  menu,  "\rOwner \w[LOCKED TO OWNER]",  "5",  0  );
  314.        
  315.         menu_setprop(  menu,  MPROP_EXITNAME,  NumeSite  );
  316.        
  317.         menu_display(  id,  menu,  0  );
  318.     }
  319.  
  320. }
  321.  
  322.  
  323.  
  324. public MainMenuHandlerT(  id,  menu,  item  )
  325. {
  326.     if(  item  ==  MENU_EXIT  )
  327.     {
  328.         set_task(  0.1,  "MainMenu",  id  );
  329.         return 1;
  330.     }
  331.    
  332.     if(  cs_get_user_team(  id  )  !=  CS_TEAM_T  ) return 1;
  333.    
  334.     new  data[  6  ],  iName[  64  ];
  335.     new  iaccess,  callback;
  336.    
  337.     menu_item_getinfo(  menu,  item,  iaccess,  data,  5,  iName,  sizeof  (  iName  )  -1,  callback  );
  338.     ResetUserSettings(  id  );
  339.    
  340.    
  341.     new  key  =  str_to_num(  data  );
  342.    
  343.     switch(  key  )
  344.     {
  345.         case 1:
  346.         {
  347.             ResetUserSettings(  id  );
  348.             GiveUserPower( id,  6 );
  349.             cs_set_user_model(  id,  Models[  1  ]  );
  350.             engclient_cmd( id, "weapon_knife" );
  351.             return 1;
  352.         }
  353.         case 2:
  354.         {
  355.             ResetUserSettings(  id  );
  356.             GiveUserPower( id,  7 );
  357.             cs_set_user_model(  id,  Models[  2  ]  );
  358.             engclient_cmd( id, "weapon_knife" );
  359.             return 1;
  360.         }
  361.         case 3:
  362.         {
  363.             ResetUserSettings(  id  );
  364.             GiveUserPower( id,  8 );
  365.             cs_set_user_model(  id,  Models[  3  ]  );
  366.             engclient_cmd( id, "weapon_knife" );
  367.             return 1;
  368.         }
  369.         case 4:
  370.         {
  371.             ResetUserSettings(  id  );
  372.             GiveUserPower( id,  9 );
  373.             cs_set_user_model(  id,  Models[  4  ]  );
  374.             engclient_cmd( id, "weapon_knife" );
  375.             return 1;
  376.         }
  377.         case 5:
  378.         {
  379.             ResetUserSettings(  id  );
  380.             GiveUserPower( id,  10 );
  381.             cs_set_user_model(  id,  Models[  5  ]  );
  382.             engclient_cmd( id, "weapon_knife" );
  383.             return 1;
  384.         }
  385.     }
  386.    
  387.     return 0;
  388. }
  389.  
  390.  
  391. /*=======================================================================================s=P=u=f=?*/
  392. public MainMenuHandler(  id,  menu,  item  )
  393. {
  394.     if(  item  ==  MENU_EXIT  )
  395.     {
  396.         set_task(  0.1,  "MainMenu",  id  );
  397.         return 1;
  398.     }
  399.    
  400.     if(  cs_get_user_team(  id  )  !=  CS_TEAM_CT  ) return 1;
  401.    
  402.     new  data[  6  ],  iName[  64  ];
  403.     new  iaccess,  callback;
  404.    
  405.     menu_item_getinfo(  menu,  item,  iaccess,  data,  5,  iName,  sizeof  (  iName  )  -1,  callback  );
  406.     ResetUserSettings(  id  );
  407.    
  408.    
  409.     new  key  =  str_to_num(  data  );
  410.    
  411.     switch(  key  )
  412.     {
  413.         case 1:
  414.         {
  415.             UserChoosed[  id  ]  =  true;
  416.             ResetUserSettings(  id  );
  417.             GiveUserPower( id,  1 );
  418.             cs_set_user_model(  id,  Models[  1  ]  );
  419.             give_item(id, "weapon_m4a1");
  420.             cs_set_user_bpammo ( id, CSW_M4A1, 999);
  421.             give_item(id, "weapon_deagle");
  422.             cs_set_user_bpammo ( id, CSW_DEAGLE, 999);
  423.             engclient_cmd( id, "weapon_knife" );
  424.             return 1;
  425.         }
  426.         case 2:
  427.         {
  428.             UserChoosed[  id  ]  =  true;
  429.             ResetUserSettings(  id  );
  430.             GiveUserPower( id,  2 );
  431.             cs_set_user_model(  id,  Models[  2  ]  );
  432.             give_item(id, "weapon_ak47");
  433.             cs_set_user_bpammo ( id, CSW_AK47, 999);
  434.             give_item(id, "weapon_deagle");
  435.             cs_set_user_bpammo ( id, CSW_DEAGLE, 999);
  436.             engclient_cmd( id, "weapon_knife" );
  437.             return 1;
  438.         }
  439.         case 3:
  440.         {
  441.             UserChoosed[  id  ]  =  true;
  442.             ResetUserSettings(  id  );
  443.             GiveUserPower( id,  3 );
  444.             cs_set_user_model(  id,  Models[  3  ]  );
  445.             give_item(id, "weapon_m249");
  446.             cs_set_user_bpammo ( id, CSW_M249, 999);
  447.             give_item(id, "weapon_usp");
  448.             cs_set_user_bpammo ( id, CSW_USP, 999);
  449.             engclient_cmd( id, "weapon_knife" );
  450.             return 1;
  451.         }
  452.         case 4:
  453.         {
  454.             UserChoosed[  id  ]  =  true;
  455.             ResetUserSettings(  id  );
  456.             GiveUserPower( id,  4 );
  457.             cs_set_user_model(  id,  Models[  4  ]  );
  458.             give_item(id, "weapon_m4a1");
  459.             cs_set_user_bpammo ( id, CSW_M4A1, 999);
  460.             give_item(id, "weapon_usp");
  461.             cs_set_user_bpammo ( id, CSW_USP, 999);
  462.             engclient_cmd( id, "weapon_knife" );
  463.             return 1;
  464.         }
  465.         case 5:
  466.         {
  467.             if(  UserIsVip(  id  ) )
  468.             {
  469.                 UserChoosed[  id  ]  =  true;
  470.                 ResetUserSettings(  id  );
  471.                 GiveUserPower( id,  5 );
  472.                 cs_set_user_model(  id,  Models[  5  ]  );
  473.                 give_item(id, "weapon_ak47");
  474.                 cs_set_user_bpammo ( id, CSW_AK47, 999);
  475.                 give_item(id, "weapon_deagle");
  476.                 cs_set_user_bpammo ( id, CSW_DEAGLE, 999);
  477.                 give_item(id, "weapon_m249");
  478.                 cs_set_user_bpammo ( id, CSW_M249, 999);
  479.                 give_item(id, "weapon_m4a1");
  480.                 cs_set_user_bpammo ( id, CSW_M4A1, 999);
  481.                 give_item(id, "weapon_usp");
  482.                 cs_set_user_bpammo ( id, CSW_USP, 999);
  483.                 engclient_cmd( id, "weapon_knife" );
  484.                 return 1;
  485.             }
  486.             else
  487.             {
  488.                 MainMenu(  id  );
  489.                 return 1;
  490.             }
  491.         }
  492.     }
  493.    
  494.     return 0;
  495. }
  496.  
  497. public GiveUserPower(  id,  const  Class  )
  498. {
  499.    
  500.     switch(  Class  )
  501.     {
  502.         case 1:
  503.         {
  504.            
  505.             //slow hacking ?:O
  506.             SetCl_Settings(  id,  1  );
  507.             set_user_maxspeed(  id,  FLASH_SPEED  );
  508.             UserIsFlash[  id  ]  =  true;
  509.            
  510.             return 1;
  511.            
  512.         }
  513.         case 2:
  514.         {
  515.             set_user_gravity(  id,  HULK_GRAVITY  );
  516.             UserIsHulk[  id  ]  =  true;
  517.            
  518.             return 1;
  519.         }
  520.         case 3:
  521.         {
  522.             UserIsPredator[  id  ]  =  true;
  523.             return 1;
  524.         }
  525.         case 4:
  526.         {
  527.             set_user_rendering(  id,  kRenderFxNone,  0,  0,  0,  kRenderTransAlpha,  ELF_INVISIBILITY );
  528.             UserIsElf[  id  ]  =  true;
  529.            
  530.             return 1;
  531.         }
  532.         case 5:
  533.         {
  534.             //Il facem Flash
  535.             SetCl_Settings(  id,  1  );
  536.            
  537.             set_user_maxspeed(  id,  FLASH_SPEED  );
  538.            
  539.             //Il facem Hulk
  540.             set_user_gravity(  id,  HULK_GRAVITY  );
  541.            
  542.             //Il facem Predator
  543.            
  544.             //Il facem Elf
  545.             set_user_rendering(  id,  kRenderFxNone,  0,  0,  0,  kRenderTransAlpha,  ELF_INVISIBILITY );
  546.            
  547.             UserIsVIp[  id  ]  =  true;
  548.             return 1;
  549.         }
  550.         case 6:
  551.         {
  552.            
  553.             //slow hacking ?:O
  554.             SetCl_Settings(  id,  1  );
  555.             fm_set_user_health(id, get_user_health(id) + 2900);
  556.             UserIsFlashT[  id  ]  =  true;
  557.            
  558.             return 1;
  559.         }
  560.         case 7:
  561.         {
  562.             set_user_maxspeed(  id,  FLASHT_SPEED  );
  563.             fm_set_user_health(id, get_user_health(id) + 2400);
  564.             UserIsHulkT[  id  ]  =  true;
  565.            
  566.             return 1;
  567.         }
  568.         case 8:
  569.         {
  570.             set_user_gravity(  id,  HULKT_GRAVITY  );
  571.             fm_set_user_health(id, get_user_health(id) + 2400);
  572.             UserIsPredatorT[  id  ]  =  true;
  573.             return 1;
  574.         }
  575.         case 9:
  576.         {
  577.             fm_set_user_health(id, get_user_health(id) + 2900);
  578.             UserIsElfT[  id  ]  =  true;
  579.            
  580.             return 1;
  581.         }
  582.         case 10:
  583.         {
  584.             set_user_maxspeed(  id,  FLASHTZ_SPEED  );
  585.             fm_set_user_health(id, get_user_health(id) + 3900);
  586.             UserIsVIp[  id  ]  =  true;
  587.             return 1;
  588.         }
  589.     }
  590.    
  591.     return 0;
  592.    
  593. }
  594.  
  595. public ResetUserSettings(  id  )
  596. {
  597.     if(  UserIsFlash[  id  ]  )    set_user_maxspeed(  id,  255.0  );
  598.    
  599.     if(  UserIsFlashT[  id  ]  )    set_user_maxspeed(  id,  255.0  );
  600.    
  601.     if(  UserIsHulk[  id  ]  )     set_user_gravity(  id,  1.0  );
  602.    
  603.     if(  UserIsHulkT[  id  ]  )     set_user_gravity(  id,  1.0  );
  604.    
  605.     if(  UserIsElf[  id  ]  )    set_user_rendering(  id,  kRenderFxNone,  0,  0,  0,  kRenderNormal,  0  );
  606.    
  607.     if(  UserIsElfT[  id  ]  )    set_user_rendering(  id,  kRenderFxNone,  0,  0,  0,  kRenderNormal,  0  );
  608.    
  609.     if( UserIsVIp[  id  ] || UserIsVIpT[  id  ]  )
  610.     {
  611.         set_user_maxspeed(  id,  255.0  );
  612.    
  613.         set_user_gravity(  id,  1.0  );
  614.            
  615.         set_user_rendering(  id,  kRenderFxNone,  0,  0,  0,  kRenderNormal,  0  );
  616.     }  
  617.    
  618.     SetCl_Settings(  id,  0  );
  619.     UserIsFlash[  id  ]  =  false;
  620.     UserIsHulk[  id  ]  =  false;
  621.     UserIsPredator[  id  ]  =  false;
  622.     UserIsElf[  id  ]  =  false;
  623.     UserIsVIp[  id  ]  =  false;
  624.     UserIsFlashT[  id  ]  =  false;
  625.     UserIsHulkT[  id  ]  =  false;
  626.     UserIsPredatorT[  id  ]  =  false;
  627.     UserIsElfT[  id  ]  =  false;
  628.     UserIsVIpT[  id  ]  =  false;  
  629. }
  630. public SetCl_Settings(  id,  const  OnOff  )
  631. {
  632.    
  633.     if(  OnOff  >  0  )
  634.     {
  635.         client_cmd(  id, "cl_backspeed %.1f",  FLASH_SPEED  );
  636.         client_cmd(  id, "cl_forwardspeed %.1f",  FLASH_SPEED  );
  637.         client_cmd(  id, "cl_sidespeed %.1f",  FLASH_SPEED  );
  638.        
  639.         return 1;
  640.        
  641.     }
  642.    
  643.     client_cmd(  id, "cl_backspeed 400"  );
  644.     client_cmd(  id, "cl_forwardspeed 400"  );
  645.     client_cmd(  id, "cl_sidespeed 400"  );
  646.    
  647.     return 0;
  648.    
  649. }
  650.  
  651. stock bool:UserIsVip(  id  )
  652. {
  653.    
  654.     if(  get_user_flags(  id  )  &  read_flags(  "b"  )  )
  655.         return true;
  656.        
  657.     return false;
  658.    
  659. }
Advertisement
Add Comment
Please, Sign In to add comment