AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   [SOLVED] Can pick up suplybox but didn't get weapon (https://forums.alliedmods.net/showthread.php?t=282644)

on154288 05-12-2016 19:32

[SOLVED] Can pick up suplybox but didn't get weapon
 
So i am trying to make a supplybox plugins forZombie Escape. Everything go smoothly but when I try to pick up the box, I does show the msg but didn't get the weapon.

Here is the code when touch the box:
PHP Code:

public fw_supplybox_touch(entid)
{    
    if (!
pev_valid(ent) || !is_user_alive(id) || ze_is_user_zombie(id)
     || 
g_supplybox_wait[id]) 
        return 
FMRES_IGNORED
    
    
static classname[32]
    
entity_get_string(ent,EV_SZ_classname,classname,31)
    
    if (
equal(classnameSUPPLYBOX_CLASSNAME))
    {
        
        static 
item_iditem[32]
        
item_id entity_get_int(entEV_INT_iuser1)
        
ArrayGetString(supplybox_itemitem_iditemcharsmax(item))
    
        if (
equali(item[id], "Balrog III")) {
            
client_cmd(id"balrog34admin")
        }
        else if (
equali(item[id], "Ammo")) {
            
cs_set_weapon_ammo(id200)
        }
        else if (
equali(item[id], "Balrog XI")) {
            
GiveBalrog11(id)
        }
        
//else if (item[id]== dragonblade) {
        //    GiveDragonBlade(id)
        //}
        
else if (equali(item[id], "Plasma Gun")) {
            
GivePlasma(id)
        }
            
        static 
name[32]
        
get_user_name(idnamesizeof(name))
        if (
equali(item[id], "Ammo")) {
            
client_print(0print_center"%s's Ammo have been restock !!!"name)
            
client_print(idprint_center"Your Ammo have been restock !!!")
        }
        else 
        {
            
client_print(0print_center"%s has received %s from SupplyBox !!!"nameitem)
        }
        
        static 
random_sound
        random_sound 
random_num(0charsmax(supplybox_pickup_sound))
        
emit_sound(idCHAN_VOICEsupplybox_pickup_sound[random_sound], 1.0ATTN_NORM0PITCH_NORM)

        new 
num_box entity_get_int(entEV_INT_iuser2)
        
supplybox_ent[num_box] = 0
        remove_entity
(ent)

        
g_supplybox_wait[id] = 1
        
if (task_exists(id+TASK_SUPPLYBOX_WAIT)) remove_task(id+TASK_SUPPLYBOX_WAIT)
        
set_task(2.0"remove_supplybox_wait"id+TASK_SUPPLYBOX_WAIT)
    }
    
    return 
FMRES_IGNORED


Full Code
PHP Code:

/* ======================================================
Credits:
- Dias | For Original Plugins
- Sontung0 | For Some Stock and config for Supplybox (Special Thank)
- Twilight Suzuka | For Some Stock
- CSO | For Model, Sound, Sprite of SupplyBox
- 4eRT | For Read ini file code i got from plugin "[ZP] Random Extra On New Round"
- on154288 | Make it work with Zombie Escape
====================================================== */
#include <amxmodx>
#include <amxmisc>
#include <engine>
#include <fakemeta>
#include <cstrike>
#include <xs>
#include <dias>
#include <zombie_escape>

#define PLUGIN "[ZE] SupplyBox"
#define VERSION "2.0"
#define AUTHOR "Dias"

// ======================= SUPPLYBOX CONFIG ======================== // 
#define SUPPLYBOX_CLASSNAME "supplybox"
#define TASK_SUPPLYBOX 128256
#define TASK_SUPPLYBOX2 138266
#define TASK_SUPPLYBOX_HELP 129257
#define TASK_SUPPLYBOX_WAIT 130259
const MAX_SUPPLYBOX_ENT 100
new const supplybox_spawn_file[] = "%s/ze_supplybox/%s.cfg"
new const supplybox_item_file[] = "%s/ze_supplybox.ini"
new const supplybox_icon_spr[] = "sprites/icon_supplybox.spr"
new const supplybox_model[][] = {
    
"models/supplybox.mdl"
}
new const 
supplybox_drop_sound[][] = {
    
"supplybox_drop.wav"
}
new const 
supplybox_pickup_sound[][] = {
    
"supplybox_pickup.wav"
}
// ======================= END OF SUPPLYBOX CONFIG ======================== // 

// Below here is hard code. Don't edit anything except cvars
new g_supplybox_numg_supplybox_wait[33], supplybox_count, Array:supplybox_item
supplybox_ent[MAX_SUPPLYBOX_ENT], g_supplybox_icon_idFloat:g_supplybox_spawn[MAX_SUPPLYBOX_ENT][3],
g_total_supplybox_spawn
new cvar_supplybox_iconcvar_supplybox_maxcvar_supplybox_numcvar_supplybox_totalintime
cvar_supplybox_timecvar_supplybox_delaytimecvar_supplybox_icon_sizecvar_supplybox_icon_light
new bool:made_supplyboxFloat:g_icon_delay[33], g_newroundg_endround

public plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR)

    
register_event("HLTV""event_newround""a""1=0""2=0")
    
register_logevent("logevent_round_end"2"1=Round_End")
    
    
register_forward(FM_Touch"fw_supplybox_touch")
    
    
cvar_supplybox_max register_cvar("ze_supplybox_max""16")
    
cvar_supplybox_num register_cvar("ze_supplybox_num""2")
    
cvar_supplybox_totalintime register_cvar("ze_supplybox_totalintime""4")
    
cvar_supplybox_time register_cvar("ze_supplybox_time""30")
    
cvar_supplybox_icon register_cvar("ze_supplybox_icon""1")
    
cvar_supplybox_delaytime register_cvar("ze_supplybox_icon_delay_time""0.03")    
    
cvar_supplybox_icon_size register_cvar("ze_supplybox_icon_size""2")
    
cvar_supplybox_icon_light register_cvar("ze_supplybox_icon_light""100")
    
    
set_task(2.0"update_radar"___"b")
}

public 
plugin_precache()
{
    
supplybox_item ArrayCreate(641)
    
    
load_supplybox_spawn()
    
load_supplybox_item()
    
    static 
i
    
for(0sizeof(supplybox_model); i++)
        
engfunc(EngFunc_PrecacheModelsupplybox_model[i])
    for(
0sizeof(supplybox_drop_sound); i++)
        
engfunc(EngFunc_PrecacheSoundsupplybox_drop_sound[i])        
    for(
0sizeof(supplybox_pickup_sound); i++)
        
engfunc(EngFunc_PrecacheSoundsupplybox_pickup_sound[i])
        
    
g_supplybox_icon_id engfunc(EngFunc_PrecacheModelsupplybox_icon_spr)
}

public 
plugin_cfg()
{
    
set_task(0.5"event_newround")
}

public 
load_supplybox_spawn()
{
    
// Check for spawns points of the current map
    
new cfgdir[32], mapname[32], filepath[100], linedata[64]
    
get_configsdir(cfgdircharsmax(cfgdir))
    
get_mapname(mapnamecharsmax(mapname))
    
formatex(filepathcharsmax(filepath), supplybox_spawn_filecfgdirmapname)
    
    
// Load spawns points
    
if (file_exists(filepath))
    {
        new 
file fopen(filepath,"rt"), row[4][6]
        
        while (
file && !feof(file))
        {
            
fgets(filelinedatacharsmax(linedata))
            
            
// invalid spawn
            
if(!linedata[0] || str_count(linedata,' ') < 2) continue;
            
            
// get spawn point data
            
parse(linedata,row[0],5,row[1],5,row[2],5)
            
            
// origin
            
g_supplybox_spawn[g_total_supplybox_spawn][0] = floatstr(row[0])
            
g_supplybox_spawn[g_total_supplybox_spawn][1] = floatstr(row[1])
            
g_supplybox_spawn[g_total_supplybox_spawn][2] = floatstr(row[2])

            
g_total_supplybox_spawn++
            if (
g_total_supplybox_spawn >= MAX_SUPPLYBOX_ENT
                break
        }
        if (
filefclose(file)
    }
}

public 
load_supplybox_item() 
{
    new 
filepath[64]
    
get_configsdir(filepathcharsmax(filepath))
    
format(filepathcharsmax(filepath), supplybox_item_filefilepath)
    
    if (!
file_exists(filepath))    
    {
        new 
error_msg[100]
        
formatex(error_msgcharsmax(error_msg), "[SupplyBox][Error] Item File Not Found")
        
set_fail_state(error_msg)
        return
    }
    
    new 
line[1024], key[64], value[960]
    new 
file fopen(filepath"rt")
    
    while (!
feof(file) && file)
    {
        
fgets(filelinecharsmax(line));
        
replace(linecharsmax(line), "^n""")
        
        if (!
line[0] || line[0] == ';')
            continue
        
        
strtok(linekeycharsmax(key), valuecharsmax(value), '=')
        
trim(key)
        
trim(value)
        
        if (
equali(key"SUPPLYBOX_ITEM")) 
        {
            while (
value[0] != && strtok(valuekeycharsmax(key), valuecharsmax(value), ',')) 
            {
                
trim(key)
                
trim(value)
                
ArrayPushString(supplybox_itemkey)
            }
        }
    }
}

public 
update_radar()
{    
    for (new 
id 1id <= get_maxplayers(); id++)
    {
        if (!
is_user_alive(id) || !supplybox_count || ze_is_user_zombie(id)) 
            continue
        
        static 
inext_ent
        i 
1
        
while(<= supplybox_count)
        {
            
next_ent supplybox_ent[i]
            if (
next_ent && is_valid_ent(next_ent))
            {
                static 
Float:origin[3]
                
pev(next_entpev_originorigin)
                
                
message_begin(MSG_ONE_UNRELIABLEget_user_msgid("HostagePos"), {0,0,0}, id)
                
write_byte(id)
                
write_byte(i)        
                
write_coord(floatround(origin[0]))
                
write_coord(floatround(origin[1]))
                
write_coord(floatround(origin[2]))
                
message_end()
            
                
message_begin(MSG_ONE_UNRELIABLEget_user_msgid("HostageK"), {0,0,0}, id)
                
write_byte(i)
                
message_end()
            }

            
i++
        }
    }
}

public 
event_newround()
{
    
made_supplybox false
    g_newround 
1
    g_endround 
0
    
    remove_supplybox
()
    
supplybox_count 0
    
    
if(task_exists(TASK_SUPPLYBOX)) remove_task(TASK_SUPPLYBOX)
    if(
task_exists(TASK_SUPPLYBOX2)) remove_task(TASK_SUPPLYBOX2)
    if(
task_exists(TASK_SUPPLYBOX_HELP)) remove_task(TASK_SUPPLYBOX_HELP)
}

public 
logevent_round_end() g_endround 1

public ze_user_infected()
{
    if(!
made_supplybox)
    {
        
g_newround 0
        made_supplybox 
true
        
        
if(task_exists(TASK_SUPPLYBOX)) remove_task(TASK_SUPPLYBOX)
        
        if(!
g_total_supplybox_spawn)
        {
            
client_print(0print_console"[SupplyBox][Error] Spawn Point Not Found. Please Create Spawn Point")
        } else {
            
set_task(get_pcvar_float(cvar_supplybox_time), "create_supplybox"TASK_SUPPLYBOX)
        }
    }
}

public 
client_PostThink(id)
{
    if (!
get_pcvar_num(cvar_supplybox_icon) || !is_user_alive(id) || ze_is_user_zombie(id))
        return
    if((
g_icon_delay[id] + get_pcvar_float(cvar_supplybox_delaytime)) > get_gametime())
        return
        
    
g_icon_delay[id] = get_gametime()

    if (
supplybox_count)
    {
        static 
ibox_ent
        i 
1
        
        
while (<= supplybox_count)
        {
            
box_ent supplybox_ent[i]
            
create_icon_origin(idbox_entg_supplybox_icon_id)
            
i++
        }
    }
}

public 
create_supplybox()
{
    if (
supplybox_count >= get_pcvar_num(cvar_supplybox_max) || g_newround || g_endround
        return

    if (
task_exists(TASK_SUPPLYBOX)) remove_task(TASK_SUPPLYBOX)
    
set_task(get_pcvar_float(cvar_supplybox_time), "create_supplybox"TASK_SUPPLYBOX)
    
    if (
get_total_supplybox() >= get_pcvar_num(cvar_supplybox_totalintime)) 
        return
    
    
g_supplybox_num 0
    create_supplybox2
()
    
    static 
random_sound
    random_sound 
random_num(0charsmax(supplybox_drop_sound))
    
client_cmd(0"spk ^"%s^""supplybox_drop_sound[random_sound])
    
    for(new 
0get_maxplayers(); i++)
    {
        if(
is_user_alive(i) && is_user_connected(i) && !ze_is_user_zombie(i))
            
client_print(iprint_center"Supplybox has appeared. Find it")
    }
    
    if (
task_exists(TASK_SUPPLYBOX_HELP)) remove_task(TASK_SUPPLYBOX_HELP)
    
set_task(3.0"show_supplybox_help"TASK_SUPPLYBOX_HELP)

    if (
task_exists(TASK_SUPPLYBOX2)) remove_task(TASK_SUPPLYBOX2)
    
set_task(0.5"create_supplybox2"TASK_SUPPLYBOX2__"b")    
}

public 
create_supplybox2()
{
    if (
supplybox_count >= get_pcvar_num(cvar_supplybox_max)
    || 
get_total_supplybox() >= get_pcvar_num(cvar_supplybox_totalintime) || g_newround || g_endround)
    {
        
remove_task(TASK_SUPPLYBOX2)
        return
    }
    
    
supplybox_count++
    
g_supplybox_num++

    static 
item
    item 
random(ArraySize(supplybox_item))

    new 
ent create_entity("info_target")
    
    
entity_set_string(entEV_SZ_classnameSUPPLYBOX_CLASSNAME)
    
entity_set_model(entsupplybox_model[random_num(0charsmax(supplybox_model))])    
    
entity_set_size(ent,Float:{-2.0,-2.0,-2.0},Float:{5.0,5.0,5.0})
    
entity_set_int(ent,EV_INT_solid,1)
    
entity_set_int(ent,EV_INT_movetype,6)
    
entity_set_int(entEV_INT_iuser1item)
    
entity_set_int(entEV_INT_iuser2supplybox_count)
    
    static 
Float:Origin[3]
    
collect_spawn_point(Origin)
    
engfunc(EngFunc_SetOriginentOrigin)
    
    
supplybox_ent[supplybox_count] = ent

    
if ((g_supplybox_num >= get_pcvar_num(cvar_supplybox_num)) && task_exists(TASK_SUPPLYBOX2)) 
        
remove_task(TASK_SUPPLYBOX2)
}

public 
get_total_supplybox()
{
    new 
total
    
for (new 1<= supplybox_counti++)
    {
        if (
supplybox_ent[i]) total += 1
    
}
    return 
total
}

public 
show_supplybox_help()
{
    for(new 
0get_maxplayers(); i++)
    {
        if(
is_user_alive(i) && is_user_connected(i) && !ze_is_user_zombie(i))
            
client_print(iprint_center"You can see Supplybox Location in the Radar")
    }
}

public 
remove_supplybox()
{
    
remove_ent_by_class(SUPPLYBOX_CLASSNAME)
    new 
supplybox_ent_reset[MAX_SUPPLYBOX_ENT]
    
supplybox_ent supplybox_ent_reset
}

public 
fw_supplybox_touch(entid)
{    
    if (!
pev_valid(ent) || !is_user_alive(id) || ze_is_user_zombie(id)
     || 
g_supplybox_wait[id]) 
        return 
FMRES_IGNORED
    
    
static classname[32]
    
entity_get_string(ent,EV_SZ_classname,classname,31)
    
    if (
equal(classnameSUPPLYBOX_CLASSNAME))
    {
        
        static 
item_iditem[32]
        
item_id entity_get_int(entEV_INT_iuser1)
        
ArrayGetString(supplybox_itemitem_iditemcharsmax(item))
    
        if (
equali(item[id], "Balrog III")) {
            
client_cmd(id"balrog34admin")
        }
        else if (
equali(item[id], "Ammo")) {
            
cs_set_weapon_ammo(id200)
        }
        else if (
equali(item[id], "Balrog XI")) {
            
GiveBalrog11(id)
        }
        
//else if (item[id]== dragonblade) {
        //    GiveDragonBlade(id)
        //}
        
else if (equali(item[id], "Plasma Gun")) {
            
GivePlasma(id)
        }
            
        static 
name[32]
        
get_user_name(idnamesizeof(name))
        if (
equali(item[id], "Ammo")) {
            
client_print(0print_center"%s's Ammo have been restock !!!"name)
            
client_print(idprint_center"Your Ammo have been restock !!!")
        }
        else 
        {
            
client_print(0print_center"%s has received %s from SupplyBox !!!"nameitem)
        }
        
        static 
random_sound
        random_sound 
random_num(0charsmax(supplybox_pickup_sound))
        
emit_sound(idCHAN_VOICEsupplybox_pickup_sound[random_sound], 1.0ATTN_NORM0PITCH_NORM)

        new 
num_box entity_get_int(entEV_INT_iuser2)
        
supplybox_ent[num_box] = 0
        remove_entity
(ent)

        
g_supplybox_wait[id] = 1
        
if (task_exists(id+TASK_SUPPLYBOX_WAIT)) remove_task(id+TASK_SUPPLYBOX_WAIT)
        
set_task(2.0"remove_supplybox_wait"id+TASK_SUPPLYBOX_WAIT)
    }
    
    return 
FMRES_IGNORED
}

public 
remove_supplybox_wait(id)
{
    
id -= TASK_SUPPLYBOX_WAIT
    
    g_supplybox_wait
[id] = 0
    
if (task_exists(id+TASK_SUPPLYBOX_WAIT)) remove_task(id+TASK_SUPPLYBOX_WAIT)
}

stock collect_spawn_point(Float:origin[3]) // By Sontung0
{
    for (new 
1<= g_total_supplybox_spawn *i++)
    {
        
origin g_supplybox_spawn[random(g_total_supplybox_spawn)]
        if (
check_spawn_box(origin)) return 1;
    }

    return 
0;
}
stock check_spawn_box(Float:origin[3]) // By Sontung0
{
    new 
Float:originE[3], Float:origin1[3], Float:origin2[3]
    new 
ent = -1
    
while ((ent engfunc(EngFunc_FindEntityByStringent"classname"SUPPLYBOX_CLASSNAME)) != 0)
    {
        
pev(entpev_originoriginE)
        
        
// xoy
        
origin1 origin
        origin2 
originE
        origin1
[2] = origin2[2] = 0.0
        
if (vector_distance(origin1origin2) <= 32.0) return 0;
    }
    return 
1;
}

stock create_icon_origin(identsprite// By sontung0
{
    if (!
pev_valid(ent)) return;
    
    new 
Float:fMyOrigin[3]
    
entity_get_vector(idEV_VEC_originfMyOrigin)
    
    new 
target ent
    
new Float:fTargetOrigin[3]
    
entity_get_vector(targetEV_VEC_originfTargetOrigin)
    
fTargetOrigin[2] += 40.0
    
    
if (!is_in_viewcone(idfTargetOrigin)) return;

    new 
Float:fMiddle[3], Float:fHitPoint[3]
    
xs_vec_sub(fTargetOriginfMyOriginfMiddle)
    
trace_line(-1fMyOriginfTargetOriginfHitPoint)
                            
    new 
Float:fWallOffset[3], Float:fDistanceToWall
    fDistanceToWall 
vector_distance(fMyOriginfHitPoint) - 10.0
    normalize
(fMiddlefWallOffsetfDistanceToWall)
    
    new 
Float:fSpriteOffset[3]
    
xs_vec_add(fWallOffsetfMyOriginfSpriteOffset)
    new 
Float:fScale
    fScale 
0.01 fDistanceToWall
    
    
new scale floatround(fScale)
    
scale max(scale1)
    
scale min(scaleget_pcvar_num(cvar_supplybox_icon_size))
    
scale max(scale1)

    
te_sprite(idfSpriteOffsetspritescaleget_pcvar_num(cvar_supplybox_icon_light))
}

stock te_sprite(idFloat:origin[3], spritescalebrightness// By sontung0
{    
    
message_begin(MSG_ONESVC_TEMPENTITY_id)
    
write_byte(TE_SPRITE)
    
write_coord(floatround(origin[0]))
    
write_coord(floatround(origin[1]))
    
write_coord(floatround(origin[2]))
    
write_short(sprite)
    
write_byte(scale
    
write_byte(brightness)
    
message_end()
}

stock normalize(Float:fIn[3], Float:fOut[3], Float:fMul// By sontung0
{
    new 
Float:fLen xs_vec_len(fIn)
    
xs_vec_copy(fInfOut)
    
    
fOut[0] /= fLenfOut[1] /= fLenfOut[2] /= fLen
    fOut
[0] *= fMulfOut[1] *= fMulfOut[2] *= fMul
}

stock str_count(const str[], searchchar// By Twilight Suzuka
{
    new 
countilen strlen(str)
    
    for (
0<= leni++)
    {
        if(
str[i] == searchchar)
            
count++
    }
    
    return 
count;
}

stock remove_ent_by_class(classname[])
{
    new 
nextitem  find_ent_by_class(-1classname)
    while(
nextitem)
    {
        
remove_entity(nextitem)
        
nextitem find_ent_by_class(-1classname)
    }


UPDATE
CODE:
PHP Code:

if (equal(classnameSUPPLYBOX_CLASSNAME))
    {
        
        static 
item_iditem[32]
        
item_id entity_get_int(entEV_INT_iuser1)
        
ArrayGetString(supplybox_itemitem_iditemcharsmax(item))
        
        
client_print(idprint_chat"item: %s"item[id])
        
client_print(idprint_chat"item: %s"item_id)
        
        if (
equali(item[id], "Balrog III")) {
            
engclient_cmd(id"balrog34admin")
        }
        else if (
equali(item[id], "Ammo")) {
            
cs_set_weapon_ammo(id200)
        }
        else if (
equali(item[id], "Balrog XI")) {
            
GiveBalrog11(id)
        }
        
//else if (item[id]== dragonblade) {
        //    GiveDragonBlade(id)
        //}
        
else if (equali(item[id], "Plasma Gun")) {
            
GivePlasma(id)
        } 

RESULT
http://i.imgur.com/RwWYhBo.png

siriusmd99 05-13-2016 05:52

Re: Can pick up suplybox but didn't get weapon
 
I think you shall change:
client_cmd(id, "balrog34admin")
with
engclient_cmd(id, "balrog34admin")

But anyway, show the full code if you want help.

on154288 05-13-2016 06:26

Re: Can pick up suplybox but didn't get weapon
 
Quote:

Originally Posted by siriusmd99 (Post 2418720)
I think you shall change:
client_cmd(id, "balrog34admin")
with
engclient_cmd(id, "balrog34admin")

But anyway, show the full code if you want help.

ok, I updated

PHP Code:

client_cmd(id"balrog34admin"

I don't think this one is the problem because other one didn't work so I tried this one (and it didn't work neither)

on154288 05-18-2016 11:24

Re: Can pick up suplybox but didn't get weapon
 
Can anyone help me :(

JusTGo 05-18-2016 11:33

Re: Can pick up suplybox but didn't get weapon
 
this is wrong:
PHP Code:

        else if (equali(item[id], "Balrog XI")) {
            
GiveBalrog11(id)
        }
        
//else if (item[id]== dragonblade) {
        //    GiveDragonBlade(id)
        //}
        
else if (equali(item[id], "Plasma Gun")) {
            
GivePlasma(id)
        } 

you should add item names in the .ini file not in the source code.

on154288 05-19-2016 07:38

Re: Can pick up suplybox but didn't get weapon
 
Quote:

Originally Posted by JusTGo (Post 2419960)
this is wrong:
PHP Code:

        else if (equali(item[id], "Balrog XI")) {
            
GiveBalrog11(id)
        }
        
//else if (item[id]== dragonblade) {
        //    GiveDragonBlade(id)
        //}
        
else if (equali(item[id], "Plasma Gun")) {
            
GivePlasma(id)
        } 

you should add item names in the .ini file not in the source code.

I don't really understand.
I get random weapon name in the .ini file (above a bit) then when you touch the box, it check the name that random and then act with followed name that taken from the file

on154288 05-20-2016 10:00

Re: Can pick up suplybox but didn't get weapon
 
UPDATE
I think there is a problem with item[id] and item_id so I use client_print to check what they get
CODE:
PHP Code:

if (equal(classnameSUPPLYBOX_CLASSNAME))
    {
        
        static 
item_iditem[32]
        
item_id entity_get_int(entEV_INT_iuser1)
        
ArrayGetString(supplybox_itemitem_iditemcharsmax(item))
        
        
client_print(idprint_chat"item: %s"item[id])
        
client_print(idprint_chat"item: %s"item_id)
        
        if (
equali(item[id], "Balrog III")) {
            
engclient_cmd(id"balrog34admin")
        }
        else if (
equali(item[id], "Ammo")) {
            
cs_set_weapon_ammo(id200)
        }
        else if (
equali(item[id], "Balrog XI")) {
            
GiveBalrog11(id)
        }
        
//else if (item[id]== dragonblade) {
        //    GiveDragonBlade(id)
        //}
        
else if (equali(item[id], "Plasma Gun")) {
            
GivePlasma(id)
        } 

RESULT
http://i.imgur.com/RwWYhBo.png

Anyone help?

SkumTomteN 05-20-2016 10:54

Re: Can pick up suplybox but didn't get weapon
 
use dias normal supplybox dude. -.-, stop changing stuff.

on154288 05-20-2016 10:57

Re: Can pick up suplybox but didn't get weapon
 
Quote:

Originally Posted by SkumTomteN (Post 2420470)
use dias normal supplybox dude. -.-, stop changing stuff.

Dias for Zombie Plague, I try to change it for Zombie Escape :3

JusTGo 05-20-2016 11:10

Re: Can pick up suplybox but didn't get weapon
 
untested:
PHP Code:

        else if (equali(item[id], "Balrog XI")) { 
            
GiveBalrog11(id
        } 
        
//else if (item[id]== dragonblade) { 
        //    GiveDragonBlade(id) 
        //} 
        
else if (equali(item[id], "Plasma Gun")) { 
            
GivePlasma(id
        } 

>>>>>>>>

PHP Code:

        else if (equali(item"Balrog XI")) { 
            
GiveBalrog11(id
        } 
        
//else if (item== dragonblade) { 
        //    GiveDragonBlade(id) 
        //} 
        
else if (equali(item"Plasma Gun")) { 
            
GivePlasma(id
        } 



All times are GMT -4. The time now is 18:37.

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