Raised This Month: $ Target: $400
 0% 

[AYUDA] Weapon Box


  
 
 
Thread Tools Display Modes
Author Message
h34s
Member
Join Date: Aug 2013
Location: Pornhub
Old 08-30-2013 , 22:03   [AYUDA] Weapon Box
#1

Buen ahora q ya encontre m ierrorsito xD! resulta q tengo adapatado al zp el plugin del weapon box y no puedo agarrar la caja cuando se cae dejo code igual aver si me pueden ayudar con el error

PHP Code:
// Publics

public removeEntity(ent)
{
    if (
pev_valid(ent))
        
engfunc(EngFunc_RemoveEntityent)
}

create_chest(origin[3])
{
    
g_chest_ent create_entity("info_target")
    
engfunc(EngFunc_SetModelg_chest_entg_models[random_num(0sizeof g_models 1)])

    
set_pev(g_chest_entpev_minsFloat:{-10.0,-10.0,0.0})
    
set_pev(g_chest_entpev_maxsFloat:{10.0,10.0,25.0})
    
set_pev(g_chest_entpev_sizeFloat:{-10.0,-10.0,0.0,10.0,10.0,25.0})
    
engfunc(EngFunc_SetSizeg_chest_entFloat:{-10.0,-10.0,0.0}, Float:{10.0,10.0,25.0})

    
set_pev(g_chest_entpev_movetypeMOVETYPE_FLY)
    
    new 
Float:fOrigin[3]
    
IVecFVec(originfOrigin)
    
set_pev(g_chest_entpev_originfOrigin)
    
    
set_pev(g_chest_ent,pev_renderfx,kRenderFxGlowShell)
    switch(
random_num(1,4))
    {
        case 
1set_pev(g_chest_entpev_rendercolorFloat:{0.0,0.0,255.0})
        case 
2set_pev(g_chest_entpev_rendercolorFloat:{0.0,255.0,0.0})
        case 
3set_pev(g_chest_entpev_rendercolorFloat:{255.0,0.0,0.0})
        case 
4set_pev(g_chest_entpev_rendercolorFloat:{255.0,255.0,255.0})
    }
}

public 
fw_Touch(enttouchertouched)
{
    
// Get entity classname
    
static classname[12]
    
pev(touchedpev_classnameclassname31)
    if (!
equal(classnameitem_class_name))
    
    
// Valid user alive?
    
if (!is_user_alive(toucher)) return;
    
    
// Check entity type
    
if (equal(classname"campo_grenade_forze"))
    {
        if(
g_zombie[toucher]) // los nemesis y zombies no pueden pasar
        
{
            new 
Float:pos_ptr[3], Float:pos_ptd[3], Float:push_power get_pcvar_float(cvar_bubblepush// intensidad de rechazo
        
            
pev(touchedpev_originpos_ptr// nose que es
            
pev(toucherpev_originpos_ptd// nose que es
        
            
for(new 03i++)
            {
                
pos_ptd[i] -= pos_ptr[i// nose que es
                
pos_ptd[i] *= push_power // poder cuando lo tocamos y nos rechaza
            
}
            
set_pev(toucherpev_velocitypos_ptd// velocidad del rechazo
            
set_pev(toucherpev_impulsepos_ptd// impulso del rechazo
        
}
    }
    else if (
equal(classname"item_dm"))
    {
        
        
// Give point random
        
new  points
        points 
random_num(1015)
    
        if (
points == 0)
        {
            
give_item(toucherg_skill_points_type[toucher][0] += points)
            
zp_colored_print(toucher"^x04[ZA]^x01 Has recogido un cofre, obtienes %d PH!"points)
        }
        else
        {
            
give_item(toucherg_skill_points_type[toucher][1] += points)
            
zp_colored_print(toucher"^x04[ZA]^x01 Has recogido un cofre, obtienes %d PZ!"points)
        }
    }
}

// Playerkilled

    
static origin[3]
    
get_user_origin(victimorigin)

if (
g_wesker[victim] || g_ninja[victim] || g_sniper[victim] || g_nemesis[victim])
        
create_chest(origin
Si me pueden dar una manito se lo agradeceria
h34s is offline
YakumoHiratsuhi
Veteran Member
Join Date: Dec 2010
Location: Dreαmlαnd.
Old 08-31-2013 , 08:55   Re: [AYUDA] Weapon Box
#2

Te falto ponerle su classname cuando lo creas.
PHP Code:
set_pev(g_chest_entpev_classname"item_dm"
No olvides destruir la entidad cuando la toque, de otra manera llegarán a tener millones de puntos.

Para ahorrarte trabajo solamente usa removeEntity()
__________________
"Podra parecer ridiculo o imposible, pero este es el camino que seguimos los verdaderos hombres, si hay un muro en el camino, lo derribamos, si no hay camino, haremos uno, con nuestras propias manos, porque el magma de nuestro corazón arde en llamas."

Last edited by YakumoHiratsuhi; 08-31-2013 at 08:57.
YakumoHiratsuhi is offline
Send a message via MSN to YakumoHiratsuhi
UnrealT
Member
Join Date: Jul 2013
Old 08-31-2013 , 09:43   Re: [AYUDA] Weapon Box
#3

Quote:
Originally Posted by h34s View Post

PHP Code:


public fw_Touch(enttouchertouched)
{

        
        
// Give point random
        
new  points
        points 
random_num(1015)
    
        if (
points == 0)
        {
            
give_item(toucherg_skill_points_type[toucher][0] += points)
            
zp_colored_print(toucher"^x04[ZA]^x01 Has recogido un cofre, obtienes %d PH!"points)
        } 
Digo yo , xq haces if (poits == 0)? si el random es entre 10 y 15, osea siempre te tocara los puntos
UnrealT is offline
h34s
Member
Join Date: Aug 2013
Location: Pornhub
Old 08-31-2013 , 15:33   Re: [AYUDA] Weapon Box
#4

PHP Code:
public removeEntity(ent)
{
    if (
pev_valid(ent))
        
engfunc(EngFunc_RemoveEntityg_chest_ent)
}

create_chest(origin[3])
{
    
g_chest_ent create_entity("info_target")
    
set_pev(g_chest_entpev_classnameitem_class_name)
    
    
engfunc(EngFunc_SetModel,g_chest_entg_models[random_num(0sizeof g_models 1)])

    
set_pev(g_chest_ent,pev_mins,Float:{-10.0,-10.0,0.0})
    
set_pev(g_chest_ent,pev_maxs,Float:{10.0,10.0,25.0})
    
set_pev(g_chest_ent,pev_size,Float:{-10.0,-10.0,0.0,10.0,10.0,25.0})
    
engfunc(EngFunc_SetSize,g_chest_ent,Float:{-10.0,-10.0,0.0},Float:{10.0,10.0,25.0})

    
set_pev(g_chest_ent,pev_solid,SOLID_BBOX)
    
set_pev(g_chest_ent,pev_movetype,MOVETYPE_FLY)
    
    new 
Float:fOrigin[3]
    
IVecFVec(originfOrigin)
    
set_pev(g_chest_entpev_originfOrigin)
    
    
set_pev(g_chest_ent,pev_renderfx,kRenderFxGlowShell)
    switch(
random_num(1,4))
    {
        case 
1set_pev(g_chest_ent,pev_rendercolor,Float:{0.0,0.0,255.0})
        case 
2set_pev(g_chest_ent,pev_rendercolor,Float:{0.0,255.0,0.0})
        case 
3set_pev(g_chest_ent,pev_rendercolor,Float:{255.0,0.0,0.0})
        case 
4set_pev(g_chest_ent,pev_rendercolor,Float:{255.0,255.0,255.0})
    }
}

public 
fw_Touch(enttouchertouched)
{
    
// Get entity classname
    
static classname[12]
    
pev(touchedpev_classnameclassname31)
    if (!
equal(classnameitem_class_name))
    
    
// Valid user alive?
    
if (!is_user_alive(toucher)) return;
    
    
// Check entity type
    
if (equal(classname"campo_grenade_forze"))
    {
        if(
g_zombie[toucher]) // los nemesis y zombies no pueden pasar
        
{
            new 
Float:pos_ptr[3], Float:pos_ptd[3], Float:push_power get_pcvar_float(cvar_bubblepush// intensidad de rechazo
        
            
pev(touchedpev_originpos_ptr// nose que es
            
pev(toucherpev_originpos_ptd// nose que es
        
            
for(new 03i++)
            {
                
pos_ptd[i] -= pos_ptr[i// nose que es
                
pos_ptd[i] *= push_power // poder cuando lo tocamos y nos rechaza
            
}
            
set_pev(toucherpev_velocitypos_ptd// velocidad del rechazo
            
set_pev(toucherpev_impulsepos_ptd// impulso del rechazo
        
}
    }
    else if (
equal(classname"item_dm"))
    {
        
        
// Give point random
        
new  points
        points 
random_num(1015)
        
        new 
random_num(0, (points 13))
        switch (
i)
        {
        
            case 
0:
            {
                
g_skill_points_type[toucher][0] += points
                zp_colored_print
(toucher"^x04[ZA]^x01 Has recogido un cofre, obtienes %d PH!"points)
            }
            case 
1:
            {
                
g_skill_points_type[toucher][1] += points
                zp_colored_print
(toucher"^x04[ZA]^x01 Has recogido un cofre, obtienes %d PZ!"points)
            }
            
removeEntity()
        }
    }

Algo asi?
h34s 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 00:38.


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