Raised This Month: $ Target: $400
 0% 

Plug-ins enable the server to stop


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
wwzw
Member
Join Date: Feb 2009
Old 02-27-2009 , 05:06   Plug-ins enable the server to stop
Reply With Quote #1

First note: I do not understand English, the expression of the following may have errors, please understanding!

I want to modify a plug-in: slaylogo.sma, is to spray the body of the players executed.
Divided into: general audience: VIP (owned b - ADMIN_RESERVATION permissions), OP-player (with f - ADMIN_MAP permissions), GM-player (with m - ADMIN_LEVEL_A permission)
Only low-competence players sprayed high competence of the bodies of players will be put to death.
However, this plug will sometimes turn off the server, leading to hlds.exe stopped running. I do not know is wrong, please expert advice! Following is my source code plug-ins are used:

slaylogo.sma

Code:
#include <amxmod>
#include <amxmisc>
#define MAX_DISTANCE 100   // detect distance...
new player_origins[33][3]
public plugin_init() {
 register_plugin("Auto-logo punisher","0.01","[PAPA]PERt+")
 register_event("23", "checkspray", "a", "1=112")
 register_event( "DeathMsg", "store_table", "a" )
} 
public store_table() {
    new victim = read_data(2)
 get_user_origin(victim,player_origins[victim],0) 
    return PLUGIN_CONTINUE 
}
public checkspray() {
 new sprayid = read_data(2);
 if (!is_user_alive(sprayid))
  return PLUGIN_HANDLED
 new player_origin[3], players[32], inum=0, dist, last_dist=99999, last_id 
 get_user_origin(sprayid,player_origin,0)
 get_players(players,inum,"b")
 if (inum > 0) {
  for (new i=0;i<inum;i++) {
   if (players[i]!=sprayid) {
    dist = get_distance(player_origin,player_origins[players[i]])
    if (dist<last_dist) {
     last_id = players[i]
     last_dist = dist
    }
   }
  }
  if (last_dist < MAX_DISTANCE) {
   new p_name[32]
   get_user_name(sprayid,p_name,31)
   if (access(last_id , ADMIN_LEVEL_A)){
    client_cmd(sprayid,"kill")
    user_kill(sprayid,1)
    client_print(0,print_chat,"%s were executed, Because slaylogo To GM !!!!!!!!!!",p_name)
   } else if ((!access(sprayid , ADMIN_MAP)) && (access(last_id , ADMIN_MAP))) {
    client_cmd(sprayid,"kill")
    user_kill(sprayid,1)
    client_print(0,print_chat,"%s were executed, Because slaylogo To OP !!!!!!!!!!",p_name)
   } else if ((!access(sprayid , ADMIN_RESERVATION)) && (access(last_id , ADMIN_RESERVATION))) {
    client_cmd(sprayid,"kill")
    user_kill(sprayid,1)
    client_print(0,print_chat,"%s were executed, Because slaylogo To VIP !!!!!!!!!!",p_name)
   }
  }
 }
 return PLUGIN_CONTINUE
}


Because I do not understand English, so please try to clear expression, give the best of the revised code complete! Thanks!

Last edited by wwzw; 02-27-2009 at 12:24.
wwzw is offline
 



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 16:52.


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