MegastoRM

autorespawn_for_deathrun

Mar 17th, 2013
182
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.80 KB | None | 0 0
  1. #include <amxmodx>
  2. #include <amxmisc>
  3. #include <hamsandwich>
  4.  
  5. native give_item( index, const item[] )
  6.  
  7. public plugin_init()
  8. {
  9. register_plugin( "auto respawner", "50", "DeathRun Serbia" )
  10.  
  11. RegisterHam( Ham_Killed, "player", "Smrt_igraca", 1 )
  12.  
  13. register_clcmd( "say /respawn", "respawnuj" )
  14. }
  15. public client_putinserver( id )
  16. {
  17. if(!is_user_alive(id) && is_user_connected(id))
  18. set_task( 1.2, "respawnuj", id+343 )
  19. }
  20. public respawnuj( id )
  21. {
  22. id-=343
  23. if(!is_user_connected(id) || is_user_alive(id))
  24. return PLUGIN_HANDLED
  25.  
  26. if(get_user_team( id ) == 2 )
  27. {
  28. ExecuteHamB( Ham_CS_RoundRespawn, id )
  29. give_item( id, "weapon_knife" )
  30. }
  31. return PLUGIN_CONTINUE
  32. }
  33. public Smrt_igraca( id )
  34. {
  35. if( is_user_connected( id ) )
  36. {
  37. set_task( 0.2, "respawnuj", id+343 )
  38. }
  39. }
Advertisement
Add Comment
Please, Sign In to add comment