Raised This Month: $180 Target: $400
 45% 

[HELP] csdm_shop.amxx


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Shadowless
Junior Member
Join Date: May 2018
Location: Republic Of Georgia
Old 05-14-2018 , 17:34   [HELP] csdm_shop.amxx
Reply With Quote #1

PLEASE help...

Code:
L 05/15/2018 - 01:32:06: -------- Mapchange to de_dust2 --------
L 05/15/2018 - 01:32:06: [AMXX] Plugin "csdm_shop.amxx" failed to load: Plugin uses an unknown function (name "get_user_lvl") - check your modules.ini.
L 05/15/2018 - 01:32:07: [csdm_spawn_preset.amxx] Loaded 40 spawn points for map de_dust2.



PHP Code:
// Ignored xs__ variables
#pragma semicolon 1
#pragma ctrlchar '\'

new SpeedFix[33];
new 
cvar[9];
new 
two_damage[33];
new 
key 767;

replace_all(String:string[], lenString:what[], String:with[])
{
    new 
pos 0;
    new 
var1 contain(stringwhat);
    
pos var1;
    if (
var1 == -1)
    {
        return 
0;
    }
    new 
total 0;
    new 
with_len strlen(with);
    new 
diff strlen(what) - with_len;
    new 
total_len strlen(string);
    new 
temp_pos 0;
    while (
replace(string[pos], len poswhatwith))
    {
        
pos with_len pos;
        
total_len -= diff;
        if (
pos >= total_len)
        {
            return 
total;
        }
        else
        {
            
temp_pos contain(string[pos], what);
            if (
temp_pos == -1)
            {
                return 
total;
            }
            else
            {
                
pos temp_pos pos;
                
total++;
            }
            return 
total;
        }
        return 
total;
    }
    return 
total;
}

register_menu(String:title[], keysString:function[], outside)
{
    
register_menucmd(register_menuid(titleoutside), keys, function);
    return 
0;
}

public 
__fatal_ham_error(Ham:idHamError:errString:reason[])
{
    !!! 
Removed Phi
    
if (func != -&& callfunc_begin_i(func, -1) == 1)
    {
        
callfunc_push_int(id);
        
callfunc_push_int(err);
        
callfunc_push_str(reason0);
        if (
callfunc_end() == 1)
        {
            
fail 0;
        }
    }
    if (
fail)
    {
        
set_fail_state(reason);
    }
    return 
0;
}

fm_set_user_armor(indexarmor)
{
    
set_pev(index47float(armor));
    return 
1;
}

fm_set_user_health(indexhealth)
{
    !!! 
Removed Phi
    
if (health 0)
    {
        
set_pev(index""float(health));
    }
    else
    {
        
dllfunc(""index);
    }
    return 
1;
}

fm_give_item(indexString:item[])
{
    !!! 
Removed Phi
    
if (!equal(item"weapon_"7) && !equal(item"ammo_""") && !equal(item"item_""") && !equal(item"tf_weapon_"""))
    {
        return 
0;
    }
    new 
ent engfunc(""engfunc(43item));
    if (!
pev_valid(ent))
    {
        return 
0;
    }
    new 
Float:origin[3];
    
pev(index""origin);
    
set_pev(ent""origin);
    
set_pev(ent83pev(ent83) | 2.00/*1073741824*/);
    
dllfunc(""ent);
    new 
save pev(ent"");
    
dllfunc(4entindex);
    if (
save != pev(ent""))
    {
        return 
ent;
    }
    
engfunc(20ent);
    return -
1;
}

fm_set_user_maxspeed(indexFloat:speed)
{
    
engfunc(52indexspeed);
    
set_pev(index56speed);
    return 
1;
}

public 
plugin_init()
{
    
register_plugin(468"1.0""StudenT");
    
RegisterHam("""player""Double_Damage"0);
    
register_event("CurWeapon""WeaponChange""be""1=1");
    
register_menu("Shop Menu"key"Shop_Func"0);
    
register_clcmd("say /shop""Shop", -1"", -1);
    
register_clcmd("say_team /shop""Shop", -1"", -1);
    
cvar[1] = register_cvar("csdm_shop_ammo""1"00);
    
cvar[2] = register_cvar("csdm_shop_armor""2"00);
    
cvar[3] = register_cvar("csdm_shop_health1""3"00);
    
cvar[4] = register_cvar("csdm_shop_health2""4"00);
    
cvar[5] = register_cvar("csdm_shop_gren""5"00);
    
cvar[6] = register_cvar("csdm_shop_speed""6"00);
    
cvar[7] = register_cvar("csdm_shop_awp""7"00);
    
cvar[8] = register_cvar("csdm_shop_damage""8"00);
    return 
0;
}

public 
Double_Damage(victiminflictorattackerFloat:damagedamage_type)
{
    !!! 
Removed Phi
    
if (attacker != victim && !is_user_connected(attacker))
    {
        return 
1;
    }
    if (
two_damage[attacker][0][0])
    {
        
SetHamParamFloat(4damage 2.00);
    }
    return 
1;
}

public 
WeaponChange(id)
{
    if (
SpeedFix[id][0][0])
    {
        
fm_set_user_maxspeed(id400.00);
    }
    return 
0;
}

public 
Shop(id)
{
    !!! 
Removed Phi
    
if (!is_user_alive(id) || my_money get_pcvar_num(cvar[1][0]) || lvl 3)
    {
        
len formatex(szMenu[len], 649 len1892get_pcvar_num(cvar[1][0])) + len;
        
key key & -2;
    }
    else
    {
        
len formatex(szMenu[len], 649 len2032get_pcvar_num(cvar[1][0])) + len;
        
key key 1;
    }
    if (!
is_user_alive(id) || my_money get_pcvar_num(cvar[2][0]) || lvl 4)
    {
        
len formatex(szMenu[len], 649 len"\d2. +25 AP: %d$ и 4 lvl\n"get_pcvar_num(cvar[2][0])) + len;
        
key key & -3;
    }
    else
    {
        
len formatex(szMenu[len], 649 len"\r2. \w+25 AP: \y%d$ \wи \y4 lvl\n"get_pcvar_num(cvar[2][0])) + len;
        
key key 2;
    }
    if (!
is_user_alive(id) || my_money get_pcvar_num(cvar[3][0]) || lvl 5)
    {
        
len formatex(szMenu[len], 649 len"\d3. +20 HP: %d$ и 4 lvl\n"get_pcvar_num(cvar[3][0])) + len;
        
key key & -5;
    }
    else
    {
        
len formatex(szMenu[len], 649 len"\r3. \w+20 HP: \y%d$ \wи \y4 lvl\n"get_pcvar_num(cvar[3][0])) + len;
        
key key 4;
    }
    if (!
is_user_alive(id) || my_money get_pcvar_num(cvar[4][0]) || lvl 6)
    {
        
len formatex(szMenu[len], 649 len"\d4. +40 HP: %d$ и 6 lvl\n"get_pcvar_num(cvar[4][0])) + len;
        
key key & -9;
    }
    else
    {
        
len formatex(szMenu[len], 649 len"\r4. \w+40 HP: \y%d$ \wи \y6 lvl\n"get_pcvar_num(cvar[4][0])) + len;
        
key key 8;
    }
    if (!
is_user_alive(id) || my_money get_pcvar_num(cvar[5][0]) || lvl 8)
    {
        
len formatex(szMenu[len], 649 len2948get_pcvar_num(cvar[5][0])) + len;
        
key key & -17;
    }
    else
    {
        
len formatex(szMenu[len], 649 len3140get_pcvar_num(cvar[5][0])) + len;
        
key key 16;
    }
    if (!
is_user_alive(id) || my_money get_pcvar_num(cvar[6][0]) || lvl 12)
    {
        
len formatex(szMenu[len], 649 len3364get_pcvar_num(cvar[6][0])) + len;
        
key key & -33;
    }
    else
    {
        
len formatex(szMenu[len], 649 len3592get_pcvar_num(cvar[6][0])) + len;
        
key key 32;
    }
    if (!
is_user_alive(id) || my_money get_pcvar_num(cvar[7][0]) || lvl 19)
    {
        
len formatex(szMenu[len], 649 len"\d7. AWP: %d$ и 19 lvl\n"get_pcvar_num(cvar[7][0])) + len;
        
key key & -65;
    }
    else
    {
        
len formatex(szMenu[len], 649 len"\r7. \wAWP: \y%d$ \wи \y19 lvl\n"get_pcvar_num(cvar[7][0])) + len;
        
key key 64;
    }
    if (!
is_user_alive(id) || my_money get_pcvar_num(cvar[8][0]) || lvl 19)
    {
        
len formatex(szMenu[len], 649 len4100get_pcvar_num(cvar[8][0])) + len;
        
key key & -129;
    }
    else
    {
        
len formatex(szMenu[len], 649 len4280get_pcvar_num(cvar[8][0])) + len;
        
key key 128;
    }
    
len formatex(szMenu[len], 649 len4492) + len;
    
key key 512;
    
show_menu(idkeyszMenu, -1"Shop Menu");
    return 
1;
}

public 
Shop_Func(idkey)
{
    !!! 
Removed Phi
    
new my_money cs_get_user_money_ul(id);
    new 
lvl get_user_lvl(id);
    switch (
key)
    {
        case 
0:
        {
            if (!
is_user_alive(id) || my_money get_pcvar_num(cvar[1][0]) || lvl 3)
            {
                return 
0;
            }
            
cs_set_user_money_ul(idmy_money get_pcvar_num(cvar[1][0]), "");
            
cs_set_user_bpammo(id16100);
            
cs_set_user_bpammo(id""52);
            
cs_set_user_bpammo(id"""");
            
cs_set_user_bpammo(id""32);
            
cs_set_user_bpammo(id7100);
            
cs_set_user_bpammo(id8"");
            
cs_set_user_bpammo(id"""tf_weapon_");
            
cs_set_user_bpammo(id11100);
            
cs_set_user_bpammo(id12100);
            
cs_set_user_bpammo(id"""");
            
cs_set_user_bpammo(id"""");
            
cs_set_user_bpammo(id15"");
            
cs_set_user_bpammo(id"""tf_weapon_");
            
cs_set_user_bpammo(id"""");
            
cs_set_user_bpammo(id19"tf_weapon_");
            
cs_set_user_bpammo(id20"");
            
cs_set_user_bpammo(id""32);
            
cs_set_user_bpammo(id"""");
            
cs_set_user_bpammo(id23"tf_weapon_");
            
cs_set_user_bpammo(id""35);
            
cs_set_user_bpammo(id28"");
            
cs_set_user_bpammo(id""100);
            
cs_set_user_bpammo(id23"tf_weapon_");
            
cs_set_user_bpammo(id24"");
            
cs_set_user_bpammo(id27"");
            
Color_Print(id"%s Вы купили !tПатроны!y.""!y[!gShop!y]");
        }
        case 
1:
        {
            if (!
is_user_alive(id) || my_money get_pcvar_num(cvar[2][0]) || lvl 4)
            {
                return 
0;
            }
            
cs_set_user_money_ul(idmy_money get_pcvar_num(cvar[2][0]), "");
            
fm_set_user_armor(idget_user_armor(id) + 25);
            
Color_Print(id"%s Вы купили !t+25 AP!y.""!y[!gShop!y]");
        }
        case 
2:
        {
            if (!
is_user_alive(id) || my_money get_pcvar_num(cvar[3][0]) || lvl 5)
            {
                return 
0;
            }
            
cs_set_user_money_ul(idmy_money get_pcvar_num(cvar[3][0]), "");
            
fm_set_user_health(idget_user_health(id) + 20);
            
Color_Print(id"%s Вы купили !t+20 HP!y.""!y[!gShop!y]");
        }
        case 
3:
        {
            if (!
is_user_alive(id) || my_money get_pcvar_num(cvar[4][0]) || lvl 6)
            {
                return 
0;
            }
            
cs_set_user_money_ul(idmy_money get_pcvar_num(cvar[4][0]), "");
            
fm_set_user_health(idget_user_health(id) + 40);
            
Color_Print(id"%s Вы купили !t+40 HP!y.""!y[!gShop!y]");
        }
        case 
4:
        {
            if (!
is_user_alive(id) || my_money get_pcvar_num(cvar[5][0]) || lvl 8)
            {
                return 
0;
            }
            
cs_set_user_money_ul(idmy_money get_pcvar_num(cvar[5][0]), "");
            
fm_give_item(id"weapon_hegrenade");
            
Color_Print(id"%s Вы купили !tБоевую гранату!y.""!y[!gShop!y]");
        }
        case 
5:
        {
            if (!
is_user_alive(id) || my_money get_pcvar_num(cvar[6][0]) || lvl 12)
            {
                return 
0;
            }
            
cs_set_user_money_ul(idmy_money get_pcvar_num(cvar[6][0]), "");
            
SpeedFix[id] = 1;
            
fm_set_user_maxspeed(id400.00);
            
set_task(30.00/*1106247680*/"OffSpeed"id""0""0);
            
Color_Print(id"%s Вы купили !tУскорение!y.""!y[!gShop!y]");
        }
        case 
6:
        {
            if (!
is_user_alive(id) || my_money get_pcvar_num(cvar[7][0]) || lvl 19)
            {
                return 
0;
            }
            
cs_set_user_money_ul(idmy_money get_pcvar_num(cvar[7][0]), "");
            
fm_give_item(id"weapon_awp");
            
cs_set_user_bpammo(id"""");
            
Color_Print(id"%s Вы купили !tAWP!y.""!y[!gShop!y]");
        }
        case 
7:
        {
            if (!
is_user_alive(id) || my_money get_pcvar_num(cvar[8][0]) || lvl 19)
            {
                return 
0;
            }
            
cs_set_user_money_ul(idmy_money get_pcvar_num(cvar[8][0]), "");
            
two_damage[id] = 1;
            
Color_Print(id"%s Вы купили !tДвойной урон!y.""!y[!gShop!y]");
        }
        default:
        {
        }
    }
    return 
1;
}

public 
OffSpeed(id)
{
    
fm_set_user_maxspeed(id250.00);
    
SpeedFix[id] = 0;
    
Color_Print(id"%s Вышло время !tУскорения!y.""!y[!gShop!y]");
    return 
0;
}

Color_Print(idString:input[])
{
    new 
count 1;
    new 
players[32];
    new 
0;
    static 
msg[191];
    
vformat(msg""input"");
    
replace_all(msg190"!g""\4");
    
replace_all(msg190"!y""\1");
    
replace_all(msg190"!t""\3");
    if (
id)
    {
        
players[0] = id;
    }
    else
    {
        
get_players(playerscount"ch""");
    }
    
0;
    while (
count)
    {
        if (
is_user_connected(players[i]))
        {
            
message_begin(8get_user_msgid("SayText"), ""players[i]);
            
write_byte(players[i]);
            
write_string(msg);
            
message_end();
            
i++;
        }
        
i++;
    }
    return 
0;

__________________
CS 1.6 80.241.245.230-3030 .::WLG::.
Shadowless is offline
Send a message via ICQ to Shadowless Send a message via MSN to Shadowless Send a message via Yahoo to Shadowless Send a message via Skype™ to Shadowless
CrazY.
Veteran Member
Join Date: May 2015
Location: Brazil 🇧🇷
Old 05-15-2018 , 10:40   Re: [HELP] csdm_shop.amxx
Reply With Quote #2

Usually this error occurs when you forgets of include a api. You should take a look at your custom include files and found where get_user_lvl native are located.
__________________

I do private plugins, if interested, please contact ...

CrazY. is offline
Send a message via Skype™ to CrazY.
Reply


Thread Tools
Display Modes

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 15:37.


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