Raised This Month: $ Target: $400
 0% 

Spawn Protection


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
Agression Terrpr
Member
Join Date: Jun 2015
Location: Lithuania
Old 04-04-2016 , 05:19   Spawn Protection
Reply With Quote #1

Hi, Well as to be only 1 thing that i buy, Spawn protection that will run not only protection, 1 time just to buy, but to function every time after, only to respawn

My Engish Bad

PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <fun>
#include <gunxpmod>
 
public plugin_init()
{
   
register_plugin("Spawn Protection""1.0""Peli")
 
   
register_item_gxm("Spawn Protection""Spawn Protection"501GUN_SECTION_ITEMS0)
 
   
register_cvar("sv_sp""1")
   
register_cvar("sv_sptime""5")
   
register_cvar("sv_spmessage""1")
   
register_cvar("sv_spshellthick""25")
}
 
public 
gxm_item_enabled(id)
{
   if(
get_cvar_num("sv_sp") == 1)
   {
      
set_task(0.1"protect"id)
   }
 
   return 
PLUGIN_CONTINUE
}
 
public 
client_disconnect(id)
{
   
remove_task(id)
   return 
PLUGIN_HANDLED
}
 
public 
protect(id)
{
   new 
Float:SPTime get_cvar_float("sv_sptime")
   new 
SPSecs get_cvar_num("sv_sptime")
   new 
FTime get_cvar_num("mp_freezetime")
   new 
SPShell get_cvar_num("sv_spshellthick")
   
set_user_godmode(id1)
 
   if(
get_user_team(id) == 1)
   {
      
set_user_rendering(idkRenderFxGlowShell25500kRenderNormalSPShell)
   }
 
   if(
get_user_team(id) == 2)
   {
      
set_user_rendering(idkRenderFxGlowShell00255kRenderNormalSPShell)
   }
 
   if(
get_cvar_num("sv_spmessage") == 1)
   {
      
set_hudmessage(25511, -1.0, -1.006.0SPTime+FTime0.10.24)
      
show_hudmessage(id"Spawn Protection is enabled for %d second(s)"SPSecs)
   }
 
   
set_task(SPTime+FTime"sp_off"id)
   return 
PLUGIN_HANDLED
}
 
public 
sp_off(id)
{
   new 
SPShell get_cvar_num("sv_spshellthick")
   if(!
is_user_connected(id))
   {
      return 
PLUGIN_HANDLED
   
}
 
   else
   {
      
set_user_godmode(id0)
      
set_user_rendering(idkRenderFxGlowShell00,0kRenderNormalSPShell)
      return 
PLUGIN_HANDLED
   
}
 
   return 
PLUGIN_HANDLED

Agression Terrpr is offline
Send a message via Skype™ to Agression Terrpr
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 18:06.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode