Raised This Month: $12 Target: $400
 3% 

[ZP] VIP Plugin [Fixed-New]


Post New Thread Reply   
 
Thread Tools Display Modes
Armin
Junior Member
Join Date: Feb 2010
Location: Estonia
Old 02-21-2010 , 15:43   Re: [ZP] VIP Plugin [Fixed-New]
Reply With Quote #21

Additional information, what can help to solve problem:
1. If I delete from source SMA this code

PHP Code:
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))

the server works fine, but You understand, that this procedure is responsible for giving ammo to VIP for zombie kill.


2. When the round starts, I tried to put myself into zombie using ZP admin menu.
I waas alone on server.
I found, that server crashes just this moment, when I must become zombie.
How the 2 thing is associated with 1?
Please, do not be silent ) heeeeelp.
__________________
Armin is offline
Send a message via ICQ to Armin
badalhoca
Senior Member
Join Date: Sep 2009
Old 02-21-2010 , 18:00   Re: [ZP] VIP Plugin [Fixed-New]
Reply With Quote #22

fix this soon as possible please!
badalhoca is offline
Armin
Junior Member
Join Date: Feb 2010
Location: Estonia
Old 02-22-2010 , 03:21   Re: [ZP] VIP Plugin [Fixed-New]
Reply With Quote #23

Hahaha, i did it
Now it works!
The problem was beсause of exception.
When the server starts round, and human become zombie, the exluding situation arises.
Please see this codes.
NUMBER 1.
PHP Code:
public death_msg() {
    new 
attacker read_data(1)
    
    if(
get_user_flags(attacker) & ADMINACCESS && attacker<=maxplayers && attacker && attacker!=read_data(2))zp_set_user_ammo_packs(attacker,zp_get_user_ammo_packs(attacker) + get_pcvar_num(ammo))

and

NUMBER 2
PHP Code:
public zp_user_infected_post(playerinfector) {
    
 
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_maxkiller_hp hp_max
fm_set_user_health
(infectorkiller_hp);
zp_set_user_ammo_packs(infectorzp_get_user_ammo_packs(infector) + get_pcvar_num(infect_ammo))

I solved the problem, by deleting the procedure public zp_user_infected_post(player, infector)

After that vip plugin works fine.
We can give another privilegies to VIP zombies, like.......

Here is code:
PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <zombieplague>
#include <engine>
#include <fakemeta_util>

#define PLUGIN    "[ZP] VIP"
#define AUTHOR    "NoName"
#define VERSION    "beta"

#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[] = "VIP ONLINE",
    
VIP_STATUS_N[] = "No VIP online",
    
CONTACT_ADMIN[] = "Contact Server Admin";
    

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 /wantvip","ShowMotd")
    
register_clcmd("say /vip","ShowMotd")
    
    
register_cvar("amx_contactinfo"CONTACTFCVAR_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() {
    new 
attacker read_data(1)
    
    if(
get_user_flags(attacker) & ADMINACCESS && attacker<=maxplayers && attacker && attacker!=read_data(2))zp_set_user_ammo_packs(attacker,zp_get_user_ammo_packs(attacker) + get_pcvar_num(ammo))
}


public 
client_putinserver(id)
{
    
jumpnum[id] = 0
    dojump
[id] = false
}

public 
client_disconnect(id)
{
    
jumpnum[id] = false
    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") != -&& containi(said"admin") != -) || contain(said"/vips") != -)
        
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 
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")

TEST IT!!! And enjoy if works fine!
Attached Files
File Type: sma Get Plugin or Get Source (zp_vip.sma - 313 views - 5.3 KB)
__________________
Armin is offline
Send a message via ICQ to Armin
badalhoca
Senior Member
Join Date: Sep 2009
Old 02-22-2010 , 06:52   Re: [ZP] VIP Plugin [Fixed-New]
Reply With Quote #24

HAHA you rock dude!

TY so much you hero..

one question can you do it with cvars? another thing how can i chenge the model of the VIP? because i already use that model to admins, and i want another one to VIPS
badalhoca is offline
Russiaboy
BANNED
Join Date: May 2009
Location: ZombiePlague is my Home
Old 02-22-2010 , 08:05   Re: [ZP] VIP Plugin [Fixed-New]
Reply With Quote #25

Hey Armin,
GJ i will update it
Russiaboy is offline
Send a message via MSN to Russiaboy Send a message via Skype™ to Russiaboy
badalhoca
Senior Member
Join Date: Sep 2009
Old 02-22-2010 , 11:24   Re: [ZP] VIP Plugin [Fixed-New]
Reply With Quote #26

hey, please show me the model of the vip plugin dude...
badalhoca is offline
Armin
Junior Member
Join Date: Feb 2010
Location: Estonia
Old 02-22-2010 , 11:56   Re: [ZP] VIP Plugin [Fixed-New]
Reply With Quote #27

what model? You can choose it.
VIP gets admin model.
And admin model is set in zombieplague.ini file.
__________________
Armin is offline
Send a message via ICQ to Armin
badalhoca
Senior Member
Join Date: Sep 2009
Old 02-22-2010 , 13:42   Re: [ZP] VIP Plugin [Fixed-New]
Reply With Quote #28

HMN... ok than TY GJ
badalhoca is offline
Zombiezzz
Veteran Member
Join Date: Nov 2009
Location: Nov 2009
Old 02-22-2010 , 14:56   Re: [ZP] VIP Plugin [Fixed-New]
Reply With Quote #29

I once too had a turtle
__________________
Zombiezzz is offline
re333
Senior Member
Join Date: May 2009
Old 02-23-2010 , 23:37   Re: [ZP] VIP Plugin [Fixed-New]
Reply With Quote #30

Thanks dude ! i'm going to test this
re333 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 23:56.


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