Raised This Month: $ Target: $400
 0% 

[Help] Zombie Class


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
wEEk
Senior Member
Join Date: Sep 2012
Old 12-29-2013 , 04:25   [Help] Zombie Class
Reply With Quote #1

Hello, I need help because when compiling classes for level I strip error that does not recognize me zclass1_Nivel to register for a class, it is for a BaseBuilder

Code:

PHP Code:
/*Global var*/
new Array:g_zclass_level

/*Precache*/
g_zclass_level ArrayCreate(11)

/*--- Menu & Handler---*/

public show_zclass_menu(id,offset)
{
    if(
offset<0offset 0

    
new keyscurnummenu[512], szCache1[32], szCache2[32], iCache3
    
    
for(new i=offset;i<g_iZClasses;i++)
    {
        
ArrayGetString(g_zclass_nameiszCache1charsmax(szCache1))
        
ArrayGetString(g_zclass_infoiszCache2charsmax(szCache2))
        
iCache3 ArrayGetCell(g_zclass_admini)
        
        
/*---Nivel---*/
        
new Nivel ArrayGetCell(g_zclass_leveli)
        
        if (
g_level[id] >= Nivel)
        {
            if (
== g_iZombieClass[id]) format(menu,511,"%s^n\d%d. %s %s \r%s"menucurnum+1szCache1szCache2iCache3 == ADMIN_ALL "" "(Solo Para Admins)")
            else 
format(menu,511,"%s^n\w%d. \r%s \y%s \r%s"menucurnum+1szCache1szCache2iCache3 == ADMIN_ALL "" "(Solo Para Admins)")
        }
        
/*---Si el nivel no es mayor o igual Le muestra el Menu con Nivel requerido---*/
        
else format(menu,511,"%s^n\w%d. \d%s %s \r[Nivel:\w%d\r ] %s"menucurnum+1szCache1szCache2NiveliCache3 == ADMIN_ALL "" "(Solo Para Admins)")
        
        
g_iMenuOptions[id][curnum] = i
        keys 
+= (1<<curnum)
    
        
curnum++
        
        if(
curnum==8)
            break;
    }

    
format(menu,511,"\ySeleccione su clase:^n\w%s^n"menu)
    if(
curnum==&& offset<12)
    {
        
keys += (1<<8)
        
format(menu,511,"%s^n\w9. Next",menu)
    }
    if(
offset)
    {
        
keys += (1<<9)
        
format(menu,511,"%s^n\w0. Back",menu)
    }

    
show_menu(id,keys,menu,-1,"ZClassSelect")
}

public 
zclass_pushed(id,key)
{
    if(
key<8)
    {
         new 
szCache1[32]
        new 
Nivel ArrayGetCell(g_zclass_levelg_iMenuOptions[id][key])
        if(
g_level[id] >= Nivel)
        {
            if (
g_iMenuOptions[id][key] == g_iZombieClass[id])
            {
                
client_cmd(id"spk %s"LOCK_FAIL);
            
                
print_color(id"%s ^x04%L"MODNAMELANG_SERVER"CLASS_CURRENT")
                
show_zclass_menu(id,g_iMenuOffset[id])
                return ;
            }
        
            new 
iCache3 ArrayGetCell(g_zclass_adming_iMenuOptions[id][key])
        
            if ((
iCache3 != ADMIN_ALL || !iCache3) && !access(idiCache3))
            {
                
print_color(id"%s %L"MODNAMELANG_SERVER"CLASS_NO_ACCESS")
                
show_zclass_menu(id,g_iMenuOffset[id])
                return ;
            }
            
            
g_iNextClass[id] = g_iMenuOptions[id][key]
     
            
ArrayGetString(g_zclass_nameg_iMenuOptions[id][key], szCache1charsmax(szCache1))
            
            if (!
g_isZombie[id] || (g_isZombie[id] && (g_boolCanBuild || g_boolPrepTime)))
                
print_color(id"%s ^x04Has seleccionado el ^x03%s"MODNAMEszCache1)
                
            if (!
g_isAlive[id])
                
print_color(id"%s x04%L"MODNAMELANG_SERVER"CLASS_RESPAWN")
                
            
g_iMenuOffset[id] = 0
            
            
if (g_isZombie[id] && (g_boolCanBuild || g_boolPrepTime))
                
ExecuteHamB(Ham_CS_RoundRespawnid)
                
            
ExecuteForward(g_fwClassPickedg_fwDummyResultidg_iZombieClass[id]);
        }
        else 
        {
            
print_color(id"%s ^x04Necesitas ser nivel %d para elegir %s ^x03%s"MODNAMENivelszCache1); 
            return;
        }
    }
    else
    {
        if(
key==8)
            
g_iMenuOffset[id] += 8
                
        
if(key==9)
            
g_iMenuOffset[id] -= 8
            
        show_zclass_menu
(id,g_iMenuOffset[id])
    }
}  

public 
native_register_zombie_class(const name[], const info[], const model[], const clawmodel[], hpspeedFloat:gravityFloat:knockbackadminflagscreditsNivel//Le agrege Nivel 

    if (!
g_boolArraysCreated
        return 
0
         
    
// Strings passed byref 
    
param_convert(1
    
param_convert(2
    
param_convert(3
    
param_convert(4
     
    
// Add the class 
    
ArrayPushString(g_zclass_namename
    
ArrayPushString(g_zclass_infoinfo
     
    
ArrayPushCell(g_zclass_modelsstartArraySize(g_zclass_playermodel)) 
    
ArrayPushString(g_zclass_playermodelmodel
    
ArrayPushCell(g_zclass_modelsendArraySize(g_zclass_playermodel)) 
    
ArrayPushCell(g_zclass_modelindex, -1
     
    
ArrayPushString(g_zclass_clawmodelclawmodel
    
ArrayPushCell(g_zclass_hphp
    
ArrayPushCell(g_zclass_spdspeed
    
ArrayPushCell(g_zclass_gravgravity
    
ArrayPushCell(g_zclass_adminadminflags
    
ArrayPushCell(g_zclass_creditscredits
    
ArrayPushCell(g_zclass_levelNivel//Level 
In .inc

PHP Code:
native bb_register_zombie_class(const name[], const info[], const model[], const clawmodel[], hpspeedFloat:gravityFloat:knockback 0.0adminflags ADMIN_ALLcredits 0Nivel )
native zp_register_zombie_class(const name[], const info[], const model[], const clawmodel[], hpspeedFloat:gravityFloat:knockback 0.0adminflags ADMIN_ALLcredits 0Nivel 

Example in my class

PHP Code:
new const zclass1_name[] = { "Zombie" 
new const 
zclass1_info[] = { "Speed++" 
new const 
zclass1_model[] = { "bb_classic" 
new const 
zclass1_clawmodel[] = { "v_knife" 
const 
zclass1_health 2600 
const zclass1_speed 350 
const Float:zclass1_gravity 0.7 
const zclass1_adminflags ADMIN_ALL 
const zclass1_Nivel 
And, the error is:

[php]bb_register_zombie_class( zclass1_name, zclass1_info, zclass1_model, zclass1_clawmodel, zclass1_health, zclass1_speed, zclass1_gravity, 0.0, zclass1_adminflags, Nivel ) // Here I mistake not to recognize me strip "Level"
__________________
Aprendiendo de nadie
wEEk 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 10:08.


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