Raised This Month: $ Target: $400
 0% 

Vip plugin - server crah plz help


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
noname456
Junior Member
Join Date: Feb 2009
Old 06-30-2009 , 07:23   Vip plugin - server crah plz help
Reply With Quote #1

Hello, I am donwloaded Zm Vip plugin, but this plugin makes me server crash. Its working, but... Can anyone find the problem?

Here Codes:

Quote:
/* Script generated by Pawn Studio */
#include <amxmodx>
#include <amxmisc>
#include <zombieplague>
#include <engine>
#include <fakemeta_util>
#define PLUGIN "ZM VIP"
#define AUTHOR "aaarnas"
#define VERSION "1.2a"
#define ADMINACCESS ADMIN_LEVEL_H
static const COLOR[] = "^x04" //green
static const CONTACT[] = ""
const g_armor_amount = 100
new const g_sound_buyarmor[] = { "items/tr_kevlar.wav" }
new bool:dojump[33] = false
new jumpnum[33] = 0
new gmsgSayText
new ammo
new maxplayers
new health
new add_health
new hp_max
new killer_hp
new infect_ammo
new const
VIP_STATUS[] = "Prisijunge Vipai",
VIP_STATUS_N[] = "Nera prisijungusiu Vipu",
CONTACT_ADMIN[] = "";

public plugin_init() {

register_plugin(PLUGIN, VERSION, AUTHOR)
register_event("DeathMsg","death_msg","a")
register_logevent("logevent_Round_Start", 2, "1=Round_Start")
register_clcmd("say", "handle_say")
register_clcmd("say /wantvip","ShowMotd")
register_clcmd("say /vip","ShowMotd")

register_cvar("amx_contactinfo", CONTACT, FCVAR_SERVER)
register_cvar("vip_multijump", "2")
ammo = register_cvar("vip_kill_ammo","4")
health = register_cvar("vip_hp_on_infect", "500")
infect_ammo = register_cvar("vip_ammo_on_infect", "3")

gmsgSayText = get_user_msgid("SayText")
maxplayers = get_maxplayers()
}
public death_msg() {

if(read_data(1)<=maxplayers && read_data(1) && read_data(1)!=read_data(2)) zp_set_user_ammo_packs(read_data(1),zp_get_us er_ammo_packs(read_data(1)) + get_pcvar_num(ammo))
}
public client_putinserver(id)
{
jumpnum[id] = 0
dojump[id] = false
}
public client_disconnect(id)
{
jumpnum[id] = 0
dojump[id] = false
}
public zp_user_infected_post(player, infector) {

add_health = get_pcvar_num(health)
hp_max = zp_get_zombie_maxhealth(infector)
if(!(get_user_flags(infector) & ADMINACCESS) && !is_user_alive(infector))
return;

killer_hp = get_user_health(infector)
killer_hp += add_health
if (killer_hp > hp_max) killer_hp = hp_max
fm_set_user_health(infector, killer_hp);
zp_set_user_ammo_packs(infector, zp_get_user_ammo_packs(infector) + get_pcvar_num(infect_ammo))
}
public handle_say(id) {
new said[192]
read_args(said,192)
if( ( containi(said, "who") != -1 && containi(said, "admin") != -1 ) || contain(said, "/vips") != -1 )
set_task(0.1,"print_adminlist",id)
return PLUGIN_CONTINUE
}
public logevent_Round_Start()
{
for(new i=0; i<= maxplayers; i++) {
if (get_user_flags(i) & ADMINACCESS) {
set_pev(i, pev_armorvalue, float(pev(i, pev_armorvalue)+g_armor_amount))
engfunc(EngFunc_EmitSound, i, CHAN_BODY, g_sound_buyarmor, 1.0, ATTN_NORM, 0, PITCH_NORM)
}
}
}

public print_adminlist(user)
{
new adminnames[33][32]
new message[256]
new contactinfo[256], contact[112]
new id, count, x, len

for(id = 1 ; id <= maxplayers ; id++)
if(is_user_connected(id))
if(get_user_flags(id) & ADMINACCESS)
get_user_name(id, adminnames[count++], 31)
len = format(message, 255, "%s%s: ",COLOR, VIP_STATUS)
if(count > 0) {
for(x = 0 ; x < count ; x++) {
len += format(message[len], 255-len, "%s%s", adminnames[x], x < (count-1) ? ", ":"")
if(len > 96 ) {
print_message(user, message)
len = format(message, 255, "%s",COLOR)
}
}
print_message(user, message)
}
else {
len += format(message[len], 255-len, "%s.", VIP_STATUS_N)
print_message(user, message)
}

get_cvar_string("amx_contactinfo", contact, 63)
if(contact[0]) {
format(contactinfo, 111, "", COLOR, CONTACT_ADMIN, contact)
print_message(user, contactinfo)
}
}
print_message(id, msg[]) {
message_begin(MSG_ONE, gmsgSayText, {0,0,0}, id)
write_byte(id)
write_string(msg)
message_end()
}
public client_PreThink(id)
{
if(!is_user_alive(id)) return PLUGIN_CONTINUE
if(!access(id,ADMINACCESS)) return PLUGIN_CONTINUE
new nbut = get_user_button(id)
new obut = get_user_oldbutton(id)
if((nbut & IN_JUMP) && !(get_entity_flags(id) & FL_ONGROUND) && !(obut & IN_JUMP))
{
if(jumpnum[id] < get_cvar_num("vip_multijump"))
{
dojump[id] = true
jumpnum[id]++
return PLUGIN_CONTINUE
}
}
if((nbut & IN_JUMP) && (get_entity_flags(id) & FL_ONGROUND))
{
jumpnum[id] = 0
return PLUGIN_CONTINUE
}
return PLUGIN_CONTINUE
}
public client_PostThink(id)
{
if(!is_user_alive(id)) return PLUGIN_CONTINUE
if(!access(id,ADMINACCESS)) return PLUGIN_CONTINUE
if(dojump[id] == true)
{
new Float:velocity[3]
entity_get_vector(id,EV_VEC_velocity,velocity )
velocity[2] = random_float(265.0,285.0)
entity_set_vector(id,EV_VEC_velocity,velocity )
dojump[id] = false
return PLUGIN_CONTINUE
}
return PLUGIN_CONTINUE
}
public ShowMotd(id)
{
show_motd(id, "vip.txt")
}
Sorry, i am new here...
noname456 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 15:36.


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