Hi, i tried to make this "Human Class" only for ADMIN_LEVEL_F but still do not working..
Code:
public HumanClassMenu( id )
{
if( zp_get_user_zombie( id ) || g_iSaveCurClass[ id ] != 0 )
{
print_chatColor( id, "\g[ZP] Nemozes izabrati klas kad si \tZombie." )
return PLUGIN_HANDLED
}
if( zp_get_user_nemesis( id ) || g_iSaveCurClass[ id ] != 0 )
{
print_chatColor( id, "\g[ZP] Nemozes izabrati klas kad si \tNemesis." )
return PLUGIN_HANDLED
}
if( zp_get_user_survivor( id ) || g_iSaveCurClass[ id ] != 0 )
{
print_chatColor( id, "\g[ZP] Nemozes izabrati klas kad si \tSurvivor." )
return PLUGIN_HANDLED
}
new menu = menu_create( "\yIzaberi tvoj klas:", "menu_handler" )
menu_additem( menu, "\wGhost - \r[ Extra Dmg & Disinfection & More Weapons ]", "1" )
new const nalezy_do[ ] = {
NONE,
o,
o,
o,
o,
o,
o,
o,
o,
o,
p,
o,
o,
o,
o,
o,
o,
o,
o,
o,
o,
p,
p,
o,
o,
o,
o,
o,
o,
o,
o,
o,
b,
o,
p,
o,
o,
o,
o,
p,
o,
b,
o,
o,
b,
o,
o,
o,
o,
o,
o,
o,
o,
b,
s,
s,
s,
s,
s,
}
// This will limit medic class to prevent massive disinfection/healing(Over-powered)
new iMedicLimit
// I precached this because your default knife may be a different model
engfunc( EngFunc_PrecacheModel, default_knifemodel_v )
engfunc( EngFunc_PrecacheModel, default_knifemodel_p )
precache_sound( "zombie_plague/select.wav" )
}
public ShowMotd( id )
{
show_motd(id, "premiumklasemotd.txt")
}
if( is_user_alive( id ) )
fw_HamSpawn_Post( id )
}
public HumanClassMenu( id )
{
if( zp_get_user_zombie( id ) || g_iSaveCurClass[ id ] != 0 )
{
print_chatColor( id, "\g[ZP] Nemozes izabrati klas kad si \tZombie." )
return PLUGIN_HANDLED
}
if( zp_get_user_nemesis( id ) || g_iSaveCurClass[ id ] != 0 )
{
print_chatColor( id, "\g[ZP] Nemozes izabrati klas kad si \tNemesis." )
return PLUGIN_HANDLED
}
if( zp_get_user_survivor( id ) || g_iSaveCurClass[ id ] != 0 )
{
print_chatColor( id, "\g[ZP] Nemozes izabrati klas kad si \tSurvivor." )
return PLUGIN_HANDLED
}
new menu = menu_create( "\yIzaberi tvoj klas:", "menu_handler" )
menu_additem( menu, "\wGhost - \r[ Extra Dmg & Disinfection & More Weapons ]", "1" )
if( ( buttons & IN_ATTACK2 ) )
{
switch( g_iCurMode[ id ] )
{
case 1:
{
// Disinfect
g_iCurMode[ id ] = 2
client_print( id, print_center, "Medical Kit Mode: D I S I N F E C T" )
}
}
}
else if( ( buttons & IN_USE ) )
{
switch( g_iCurMode[ id ] )
{
case 2:
{
new iCountZombie = zp_get_zombie_count( )
if( iCountZombie <= 1 )
{
print_chatColor( id, "\g[ZP] Nemozes koristiti ovu funkciju, ima samo jedan zombi!" )
return FMRES_IGNORED
}
else if( zp_is_swarm_round() || zp_is_plague_round())
{
print_chatColor( id, "\g[ZP] Nemozes desinfektovati u Swarm i Plague Mode!" )
return FMRES_IGNORED
}
if( zp_get_user_zombie( target_zm ) && is_user_alive( target_zm ) )
{
zp_disinfect_user( target_zm, 1 )
print_chatColor( target_zm, "\g[ZP] Ti si desinfektovan od %s", sz_Name1 )
print_chatColor( id, "\g[ZP] Ti si desinfektovao %s", sz_Name3 )
g_iMedUsable[ id ] = 0
}
}
}
}
g_iLastUsedCmd[ id ] = get_gametime( )
return FMRES_IGNORED
}
public fw_HamSpawn_Post( id )
{
if( !is_user_alive( id ) )
return PLUGIN_HANDLED
g_iCurClass[ id ] = g_iSaveCurClass[ id ]
g_iCurMode[ id ] = 0
if( is_user_connected( id ) )
{
g_iCurClass[ id ] = 0
g_iCurMode[ id ] = 0
g_speed[ id ] = 0
}
}
public zp_round_started( gamemode, id )
{
if( gamemode == MODE_SURVIVOR || gamemode == MODE_PLAGUE )
{
if( zp_get_user_survivor( id ) )
{
g_iCurClass[ id ] = 0
return PLUGIN_HANDLED
}
}
if( !zp_get_user_zombie( id ) && !zp_get_user_survivor( id ) && g_iCurClass[ id ] == 0 )
{
print_chatColor( id, "\g[ZP] Nisi izabrao klas? Kucaj /ghost" )
HumanClassMenu( id )
}
return PLUGIN_HANDLED
}
stock print_chatColor(const id,const input[], any:...)
{
new msg[191], players[32], count = 1;
vformat(msg,190,input,3);
replace_all(msg,190,"\g","^4");// green
replace_all(msg,190,"\n","^1");// normal
replace_all(msg,190,"\t","^3");// team
if (id) players[0] = id; else get_players(players,count,"ch");
for (new i=0;i<count;i++)
if (is_user_connected(players[i]))
{
message_begin(MSG_ONE_UNRELIABLE,get_user_msgid("SayText"),_,players[i]);
write_byte(players[i]);
write_string(msg);
message_end();
}
}
stock fm_find_ent_by_owner( index, const classname[ ], owner, jghgtype = 0 )
{
new strtype[ 11 ] = "classname", ent = index
switch( jghgtype )
{
case 1: strtype = "target"
case 2: strtype = "targetname"
}
Add this and tell me the output:
Code:
server_print("%d, %d, %d", item, Ghost, (get_user_flags(id) & ADMIN_LEVEL_F)); if( item == Ghost && !(get_user_flags(id) & ADMIN_LEVEL_F )) // ...
Not working......
ConnorMcLeod
08-16-2013 02:47
Re: Admin_level_f
PHP Code:
for(new i=1; i<sizeof nazwy_klas; i++)
->
PHP Code:
for(new i=1; i<=sizeof nazwy_klas; i++)
or :
PHP Code:
for(new i=0; i<sizeof nazwy_klas; i++)
Shippuden
08-16-2013 02:59
Re: Admin_level_f
Quote:
Originally Posted by ConnorMcLeod
(Post 2014346)
PHP Code:
for(new i=0; i<sizeof nazwy_klas; i++)
It's working, but for all players not for ADMIN_LEVEL_F
ConnorMcLeod
08-16-2013 04:40
Re: Admin_level_f
nazwy_klas size is 2, but you only add 1 item to the menu...
Shippuden
08-16-2013 04:55
Re: Admin_level_f
Quote:
Originally Posted by ConnorMcLeod
(Post 2014397)
nazwy_klas size is 2, but you only add 1 item to the menu...
I don't uderstand you?
Black Rose
08-16-2013 16:26
Re: Admin_level_f
Why are you PM'ing me when you haven't even done what I told you to.
Add that code and tell me what the console prints.
I can't try it out myself because I don't have ZP.
If you want this fixed, you'll have to put in this tiny effort and not just wait for others to fix it for you.
On top of that, the polish variable names doesn't help at all.