Raised This Month: $ Target: $400
 0% 

Vip plugin help


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
edga85
BANNED
Join Date: Jan 2009
Old 07-23-2009 , 16:52   Vip plugin help
Reply With Quote #1

Can somebody help to fix this vip plugin because it crash the server
PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <engine>
#include <fakemeta>
#include <fakemeta_util>
#include <zombieplague>
#define PLUGIN "ZM VIP"
#define AUTHOR "aaarnas"
#define VERSION "1.2b"
#define ADMINACCESS ADMIN_LEVEL_H
static const COLOR[] = "^x04" //green
static const CONTACT[] = ""
new bool:dojump[33] = false;
new 
jumpnum[33] = 0;
new 
g_vip_armor
//new g_menu
//new g_menu_delay
//new g_vip_gravity
//new g_vip_speed
new gmsgSayText
new ammo
new maxplayers
new health_add
new nKiller_hp
new nHp_add
new nHp_max
new const
VIP_STATUS[] = "Prisijunge VIP:",
VIP_STATUS_N[] = "Nera prisijungusiu VIP",
CONTACT_ADMIN[] = "Serverio Administratoriaus kontaktai";

public 
plugin_init() {

register_plugin(PLUGINVERSIONAUTHOR)
register_event("DeathMsg","death_msg","a")
register_logevent("logevent_Round_Start"2"1=Round_Start")
register_clcmd("say""handle_say")
register_clcmd("say /noriuvip","ShowMotd")
register_clcmd("say /wantvip","ShowMotd")
register_clcmd("say /vip","ShowMotd")
// register_clcmd("say /vm", "Menu")
// register_clcmd("say /vipmenu", "Menu")

register_cvar("amx_contactinfo"CONTACTFCVAR_SERVER)
register_cvar("vip_multijump""2")
ammo register_cvar("vip_kill_ammo","4")
health_add register_cvar("vip_hp_on_infect""500")
g_vip_armor register_cvar("vip_armor""1")
// g_menu = register_cvar("vip_menu", "3")
// g_menu_delay = register_cvar("vip_menu_delay", "5.0")
// g_vip_gravity = register_cvar("vip_gravity", "500.0")
// g_vip_speed = register_cvar("vip_speed", "280.0")

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

if(
get_user_flags(read_data(1)) & ADMINACCESS && read_data(1)<=maxplayers && read_data(1) && read_data(1)!=read_data(2)) zp_set_user_ammo_packs(read_data(1),zp_get_user_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(playerinfector)
{
nHp_add get_pcvar_num (health_add)
nHp_max zp_get_zombie_maxhealth(infector)
if(!(
get_user_flags(infector) & ADMIN_LEVEL_H))
return;

nKiller_hp get_user_health(infector)
nKiller_hp += nHp_add
if (nKiller_hp nHp_maxnKiller_hp nHp_max
fm_set_user_health
(infectornKiller_hp)

}
public 
handle_say(id) {
new 
said[192]
read_args(said,192)
if( ( 
containi(said"who") != -&& containi(said"admin") != -) || contain(said"/vips") != -)
set_task(0.1,"print_adminlist",id)
return 
PLUGIN_CONTINUE
}
public 
logevent_Round_Start()
{
if(
g_vip_armor) {
new 
players[32], idpnum;
get_players(playerspnum"a");
for(new 
i=0i<= pnumi++) { 
id players[i];
if(
get_user_flags(id) & ADMINACCESS && get_pcvar_num(g_vip_armor) == 1) {
// Kolkas naudosiш рб рarvш bыdа.
fm_give_item(id"item_kevlar");
fm_give_item(id"item_assaultsuit");
// if(g_menu || get_pcvar_num(g_menu) == 3) set_task(get_pcvar_float(g_menu_delay), "Menu", id)
}
}
}
return 
PLUGIN_HANDLED
}
 
public 
print_adminlist(user
{
new 
adminnames[33][32]
new 
message[256]
new 
contactinfo[256], contact[112]
new 
idcountxlen

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

get_cvar_string("amx_contactinfo"contact63)
if(
contact[0]) {
format(contactinfo111"%s %s -- %s"COLORCONTACT_ADMINcontact)
print_message(usercontactinfo)
}
}
print_message(idmsg[]) {
message_begin(MSG_ONEgmsgSayText, {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")

edga85 is offline
Send a message via Skype™ to edga85
edga85
BANNED
Join Date: Jan 2009
Old 07-24-2009 , 10:41   Re: Vip plugin help
Reply With Quote #2

Someone help pls
edga85 is offline
Send a message via Skype™ to edga85
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 07-24-2009 , 10:44   Re: Vip plugin help
Reply With Quote #3

You have to wait 15 days before be allowed to up your thread. To start, indent properly your code.
__________________
Arkshine is offline
Mantac
Junior Member
Join Date: Jul 2009
Old 07-24-2009 , 14:40   Re: Vip plugin help
Reply With Quote #4

Ir as dejau sita plugina nieks netvarko..
Mantac is offline
edga85
BANNED
Join Date: Jan 2009
Old 07-24-2009 , 14:44   Re: Vip plugin help
Reply With Quote #5

No one can help pls?
edga85 is offline
Send a message via Skype™ to edga85
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 07-25-2009 , 00:44   Re: Vip plugin help
Reply With Quote #6

Quote:
Originally Posted by Arkshine View Post
To start, indent properly your code.
Learn to read first.
__________________
fysiks is offline
Reply



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:19.


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