Raised This Month: $2 Target: $400
 0% 

Give ap all


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
itoxicreal
Member
Join Date: Jun 2018
Old 06-12-2020 , 20:41   Give ap all
Reply With Quote #1

Hey can someone make a zp_giveall "number of ammo packs" meaning they give everyone ammopacks
itoxicreal is offline
Supremache
Senior Member
Join Date: Sep 2019
Old 06-13-2020 , 00:28   Re: Give ap all
Reply With Quote #2

Quote:
Originally Posted by itoxicreal View Post
Hey can someone make a zp_giveall "number of ammo packs" meaning they give everyone ammopacks
Give me your ammopacks system inc file
Supremache is offline
Supremache
Senior Member
Join Date: Sep 2019
Old 06-13-2020 , 01:47   Re: Give ap all
Reply With Quote #3

Quote:
Originally Posted by itoxicreal View Post
Hey can someone make a zp_giveall "number of ammo packs" meaning they give everyone ammopacks
I made this one working for zombie plague try it

Cmds :
Quote:
amx_giveap "authid, nick or #userid, @t or ct" "ammopacks"

amx_giveap_all "ammopacks"
Ps: amx_giveap "@t" for zombie and "@ct" for humans

PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <zombieplague>

public plugin_init()
{
    
register_plugin("Give Ap""1.2""MrAbdoO")
    
    
register_clcmd("amx_giveap""give_ap"ADMIN_LEVEL_B"<authid, nick or #userid, @t or ct> <ap>")
    
register_clcmd("amx_giveap_all""ap_ver"ADMIN_RCON"")
}

public 
give_ap(idlevelcid)
{
    if(!
cmd_access(idlevelcid2))
        return 
PLUGIN_HANDLED
    
    
new arg[32], arg2[5], arg3[3]
    
read_argv(1argcharsmax(arg))
    
read_argv(2arg2charsmax(arg2))
    
read_argv(3arg3charsmax(arg3))
    
    if(
arg3[0])
        return 
PLUGIN_HANDLED
    
    
new player cmd_target(idargcharsmax(arg))
    if(!
player)
        return 
PLUGIN_HANDLED
    
    
new sPlayer[2]
    
sPlayer[0] = player
    
    
new adminname[32], playername[32]
    
get_user_name(idadminname31)
    
get_user_name(playerplayername31)
    if(
arg[0]=='@') {
        if(
equali(arg[1],"T") || equali(arg[1],"t"))
        {
            new 
players[32], totalplayersT
            get_players
(playerstotalplayers)
            for (new 
0totalplayersi++)
            {
                if(
get_user_team(players[i]) == 1)
                {
                    
players[i]
                    new 
current_ammopacks zp_get_user_ammo_packs(T)
                    
zp_set_user_ammo_packs(Tcurrent_ammopacks str_to_num(arg2))
                }
                
color_chat(0"!n[ADMIN] !g%s !nhas gave all zombie's !t%d ammopacks."adminnamestr_to_num(arg2))
            }
        }
        
        else if(
equali(arg[1],"CT") || equali(arg[1],"ct"))
        {
    
            new 
players[32], totalplayersCT
            get_players
(playerstotalplayers)
            for (new 
0totalplayersi++)
            {
                if(
get_user_team(players[i]) == 2)
                {
                    
CT players[i]
                    new 
current_ammopacks zp_get_user_ammo_packs(CT)
                    
zp_set_user_ammo_packs(CTcurrent_ammopacks str_to_num(arg2))
                }
                
color_chat(0"!n[ADMIN] !g%s !nhas gave all humans's !t%d ammopacks."adminnamestr_to_num(arg2))
            }
        }    
        
    }
    if(
id == player)
    {
        new 
current_ammopacks zp_get_user_ammo_packs(player)
        
zp_set_user_ammo_packs(playercurrent_ammopacks str_to_num(arg2))
        
color_chat(0"!n[ADMIN] !g%s !nhas gave himself !t%d ammopacks."adminnamestr_to_num(arg2))
    }
    else if(
get_user_flags(id) & ADMIN_RCON)
    {
        new 
current_ammopacks zp_get_user_ammo_packs(player)
        
zp_set_user_ammo_packs(playercurrent_ammopacks str_to_num(arg2))
        
color_chat(0,"!n[ADMIN] !g%s !nhas gave player!g%s !t%d ammopacks."adminnameplayernamestr_to_num(arg2))
    }
    
    return 
PLUGIN_HANDLED
}

public 
ap_ver(idlevelcid)
{
    if(!
cmd_access(idlevelcid2))
        return 
PLUGIN_HANDLED
    
    
new arg[5], arg2[3]
    
read_argv(1argcharsmax(arg))
    
read_argv(2arg2charsmax(arg2))
    
    if(
arg2[0])
        return 
PLUGIN_HANDLED
    
    
new players[32], inumdi
    get_players
(playersinum)
    for(new 
i;i<inum;i++)
    {
        
di players[i]
        new 
current_ammopacks zp_get_user_ammo_packs(di)
        
zp_set_user_ammo_packs(dicurrent_ammopacks str_to_num(arg))
    }
    
    new 
adminname[32]
    
get_user_name(id,adminname,31)
    
color_chat(0"!n[ADMIN] !g%s !nhas gave all players !t%d ammopacks."adminnamestr_to_num(arg))
    
color_chat(0"!n[ADMIN] !g%s !nhas gave all players !t%d ammopacks."adminnamestr_to_num(arg))
    
color_chat(0"!n[ADMIN] !g%s !nhas gave all players !t%d ammopacks."adminnamestr_to_num(arg))
    
    return 
PLUGIN_HANDLED
}

stock color_chat(const id, const input[], any:...)
{
    new 
count 1players[32]
    static 
msg[191]
    
vformat(msgsizeof(msg) - 1input3)
    
    
replace_all(msg190"!n""^x01")
    
replace_all(msg190"!g""^x04")
    
replace_all(msg190"!t""^x03")
    
    if(
idplayers[0] = id; else get_players(playerscount"ch")
    for(new 
0counti++)
    {
        if(
is_user_connected(players[i]))
        {
            
message_begin(MSG_ONE_UNRELIABLEget_user_msgid("SayText"), _players[i])
            
write_byte(players[i])
            
write_string(msg)
            
message_end()
        }
    }

Supremache is offline
itoxicreal
Member
Join Date: Jun 2018
Old 06-13-2020 , 07:54   Re: Give ap all
Reply With Quote #4

Quote:
Originally Posted by Supremache View Post
Give me your ammopacks system inc file
I dont have 1
itoxicreal is offline
itoxicreal
Member
Join Date: Jun 2018
Old 06-13-2020 , 07:58   Re: Give ap all
Reply With Quote #5

Quote:
Originally Posted by Supremache View Post
I made this one working for zombie plague try it

Cmds :


Ps: amx_giveap "@t" for zombie and "@ct" for humans

PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <zombieplague>

public plugin_init()
{
    
register_plugin("Give Ap""1.2""MrAbdoO")
    
    
register_clcmd("amx_giveap""give_ap"ADMIN_LEVEL_B"<authid, nick or #userid, @t or ct> <ap>")
    
register_clcmd("amx_giveap_all""ap_ver"ADMIN_RCON"")
}

public 
give_ap(idlevelcid)
{
    if(!
cmd_access(idlevelcid2))
        return 
PLUGIN_HANDLED
    
    
new arg[32], arg2[5], arg3[3]
    
read_argv(1argcharsmax(arg))
    
read_argv(2arg2charsmax(arg2))
    
read_argv(3arg3charsmax(arg3))
    
    if(
arg3[0])
        return 
PLUGIN_HANDLED
    
    
new player cmd_target(idargcharsmax(arg))
    if(!
player)
        return 
PLUGIN_HANDLED
    
    
new sPlayer[2]
    
sPlayer[0] = player
    
    
new adminname[32], playername[32]
    
get_user_name(idadminname31)
    
get_user_name(playerplayername31)
    if(
arg[0]=='@') {
        if(
equali(arg[1],"T") || equali(arg[1],"t"))
        {
            new 
players[32], totalplayersT
            get_players
(playerstotalplayers)
            for (new 
0totalplayersi++)
            {
                if(
get_user_team(players[i]) == 1)
                {
                    
players[i]
                    new 
current_ammopacks zp_get_user_ammo_packs(T)
                    
zp_set_user_ammo_packs(Tcurrent_ammopacks str_to_num(arg2))
                }
                
color_chat(0"!n[ADMIN] !g%s !nhas gave all zombie's !t%d ammopacks."adminnamestr_to_num(arg2))
            }
        }
        
        else if(
equali(arg[1],"CT") || equali(arg[1],"ct"))
        {
    
            new 
players[32], totalplayersCT
            get_players
(playerstotalplayers)
            for (new 
0totalplayersi++)
            {
                if(
get_user_team(players[i]) == 2)
                {
                    
CT players[i]
                    new 
current_ammopacks zp_get_user_ammo_packs(CT)
                    
zp_set_user_ammo_packs(CTcurrent_ammopacks str_to_num(arg2))
                }
                
color_chat(0"!n[ADMIN] !g%s !nhas gave all humans's !t%d ammopacks."adminnamestr_to_num(arg2))
            }
        }    
        
    }
    if(
id == player)
    {
        new 
current_ammopacks zp_get_user_ammo_packs(player)
        
zp_set_user_ammo_packs(playercurrent_ammopacks str_to_num(arg2))
        
color_chat(0"!n[ADMIN] !g%s !nhas gave himself !t%d ammopacks."adminnamestr_to_num(arg2))
    }
    else if(
get_user_flags(id) & ADMIN_RCON)
    {
        new 
current_ammopacks zp_get_user_ammo_packs(player)
        
zp_set_user_ammo_packs(playercurrent_ammopacks str_to_num(arg2))
        
color_chat(0,"!n[ADMIN] !g%s !nhas gave player!g%s !t%d ammopacks."adminnameplayernamestr_to_num(arg2))
    }
    
    return 
PLUGIN_HANDLED
}

public 
ap_ver(idlevelcid)
{
    if(!
cmd_access(idlevelcid2))
        return 
PLUGIN_HANDLED
    
    
new arg[5], arg2[3]
    
read_argv(1argcharsmax(arg))
    
read_argv(2arg2charsmax(arg2))
    
    if(
arg2[0])
        return 
PLUGIN_HANDLED
    
    
new players[32], inumdi
    get_players
(playersinum)
    for(new 
i;i<inum;i++)
    {
        
di players[i]
        new 
current_ammopacks zp_get_user_ammo_packs(di)
        
zp_set_user_ammo_packs(dicurrent_ammopacks str_to_num(arg))
    }
    
    new 
adminname[32]
    
get_user_name(id,adminname,31)
    
color_chat(0"!n[ADMIN] !g%s !nhas gave all players !t%d ammopacks."adminnamestr_to_num(arg))
    
color_chat(0"!n[ADMIN] !g%s !nhas gave all players !t%d ammopacks."adminnamestr_to_num(arg))
    
color_chat(0"!n[ADMIN] !g%s !nhas gave all players !t%d ammopacks."adminnamestr_to_num(arg))
    
    return 
PLUGIN_HANDLED
}

stock color_chat(const id, const input[], any:...)
{
    new 
count 1players[32]
    static 
msg[191]
    
vformat(msgsizeof(msg) - 1input3)
    
    
replace_all(msg190"!n""^x01")
    
replace_all(msg190"!g""^x04")
    
replace_all(msg190"!t""^x03")
    
    if(
idplayers[0] = id; else get_players(playerscount"ch")
    for(new 
0counti++)
    {
        if(
is_user_connected(players[i]))
        {
            
message_begin(MSG_ONE_UNRELIABLEget_user_msgid("SayText"), _players[i])
            
write_byte(players[i])
            
write_string(msg)
            
message_end()
        }
    }

Plugin "apall.amxx" failed to load: Plugin uses an unknown function (name "zp_set_user_ammo_packs") - check your modules.ini.
itoxicreal is offline
alferd
Senior Member
Join Date: Dec 2019
Old 06-13-2020 , 08:11   Re: Give ap all
Reply With Quote #6

Quote:
Originally Posted by itoxicreal View Post
Plugin "apall.amxx" failed to load: Plugin uses an unknown function (name "zp_set_user_ammo_packs") - check your modules.ini.
What version are you using?
alferd is offline
itoxicreal
Member
Join Date: Jun 2018
Old 06-13-2020 , 09:01   Re: Give ap all
Reply With Quote #7

Quote:
Originally Posted by alferd View Post
What version are you using?
1.8.2
itoxicreal is offline
alferd
Senior Member
Join Date: Dec 2019
Old 06-13-2020 , 09:21   Re: Give ap all
Reply With Quote #8

Quote:
Originally Posted by itoxicreal View Post
1.8.2
🤦*♂️🤦*♂️
zombie plague version
alferd is offline
itoxicreal
Member
Join Date: Jun 2018
Old 06-13-2020 , 10:03   Re: Give ap all
Reply With Quote #9

Quote:
Originally Posted by alferd View Post
🤦*♂️🤦*♂️
zombie plague version
oh um 6.2
itoxicreal is offline
Supremache
Senior Member
Join Date: Sep 2019
Old 06-13-2020 , 15:03   Re: Give ap all
Reply With Quote #10

Quote:
Originally Posted by itoxicreal View Post
oh um 6.2
This mod is so hard, i have ultimate mod, the owner of this mod has made it hard for no one can edit it after him.
https://i.ibb.co/8bGzGPC/14.png

i checked the model file to get any idea about ammo system but i didn't get anything
PHP Code:
    "changelevel"changelevel }, 
    { 
"send_intermission"send_intermission }, 
    { 
"set_painshock"set_painshock }, 
    { 
"rem"rem },
    { 
"fake"fake }, 
    { 
"can"can }, 
    { 
"get_mins"get_mins }, 
    { 
"set_nextthink"set_nextthink }, 
    { 
"get_dmgtime"get_dmgtime }, 
    { 
"pev"pev }, 
    { 
"set_pev"set_pev }, 
    { 
"kill"kill }, 
    { 
"close"close }, 
    { 
"set_team_offset"set_team_offset }, 
    { 
"Clean"Clean },
    { 
"send_bar_time"send_bar_time }, 
    { 
"get_target_and_attack"get_target_and_attack }, 
    { 
"set_frozen"set_frozen },
    { 
"send_teleport"send_teleport },
    { 
"send_damage"send_damage }, 
    { 
"send_smoke"send_smoke }, 
    { 
"send_flame"send_flame }, 
    { 
"sound"sound },
    { 
"check_for_swear"check_for_swear },
    { 
"send_break_glass"send_break_glass }, 
    { 
"send_screen_fade"send_screen_fade },
    { 
"remove_entity"remove_entity },
    { 
"send_screen_shake"send_screen_shake }, 
    { 
"send_implosion"send_implosion }, 
    { 
"send_sparks"send_sparks }, 
    { 
"send_particle_burst"send_particle_burst }, 
    { 
"send_light"send_light }, 
    { 
"set_weaponmodel_null"set_weaponmodel_null },
    { 
"send_hide_weapon"send_hide_weapon }, 
    { 
"send_crosshair"send_crosshair }, 
    { 
"send_lava_splash"send_lava_splash }, 
    { 
"get_oldbuttons"get_oldbuttons },
    { 
"get_button"get_button }, 
    { 
"set_take_damage"set_take_damage }, 
    { 
"send_explosion"send_explosion }, 
    { 
"send_beam_follow"send_beam_follow }, 
    { 
"ping"ping },
    { 
"send_beam_cylinder"send_beam_cylinder }, 
    { 
"is_origin_vacant"is_origin_vacant }, 
    { 
"is_hull_vacant"is_hull_vacant }, 
    { 
"set_weaponmodel"set_weaponmodel }, 
    { 
"set_viewmodel"set_viewmodel }, 
    { 
"get_user_jetpack"get_user_jetpack }, 
    { 
"create_mine"create_mine }, 
    { 
"set_gravity"set_gravity }, 
    { 
"set_zombie"set_zombie }, 
    { 
"set_user_jetpack"set_user_jetpack }, 
    { 
"send_fov"send_fov },
    { 
"set_user_fuel"set_user_fuel }, 
    { 
"set_user_rocket_time"set_user_rocket_time }, 
    { 
"user_drop_jetpack"user_drop_jetpack }, 
    { 
"give_weapon"give_weapon },
    { 
"get_user_model"get_user_model }, 
    { 
"set_user_model"set_user_model }, 
    { 
"set_team"set_team }, 
    { 
"get_team"get_team }, 
    { 
"light"light }, 
    { 
"iuser2"iuser2 },
    { 
"get_origin"get_origin }, 
    { 
"give_ammo"give_ammo }, 
    { 
"get_frags"get_frags }, 
    { 
"get_deaths"get_deaths }, 
    { 
"set_frags"set_frags }, 
    { 
"ent"ent }, 
    { 
"set_deaths"set_deaths }, 
    { 
"get_armor"get_armor }, 
    { 
"reset_armor"reset_armor }, 
    { 
"send_score_info"send_score_info }, 
    { 
"strip_name"strip_name },
    { 
"send_score_attrib"send_score_attrib }, 
    { 
"get_health"get_health }, 
    { 
"set_weapon_ammo"set_weapon_ammo }, 
    { 
"set_monster"set_monster }, 
    { 
"Beam"Beam },
    { 
"send_say_text"send_say_text }, 
    { 
"set_health"set_health }, 
    { 
"flash"flash },
    { 
"send_death_msg"send_death_msg }, 
    { 
"set_jetpack"set_jetpack },
    { 
"set_ent_flags"set_ent_flags }, 
    { 
"strip_user_weapons"strip_user_weapons }, 
    { 
"get_ent_flags"get_ent_flags }, 
    { 
"set_glow"set_glow }, 
    { 
"remove_glow"remove_glow }, 
    { 
"set_armor"set_armor }, 
    { 
"set_origin"set_origin }, 
    { 
"get_velocity"get_velocity }, 
    { 
"set_velocity"set_velocity }, 
    { 
"set_speed"set_speed }, 
    { 
"is_advertisement"is_advertisement }, 
    { 
"reset_money"reset_money }, 
    { 
"range"range },
    { 
0
It's something from the mod
PHP Code:
case 6:
            {
                if (
g_iExtraItemsPrices[iChoice] > g_iPacks[iPlayer])
                {
                    
PrintToChat(iPlayer"^x04[ZP]^x01 You dont have enough ammo packs.");
                    return 
0;
                }
                if ((
g_iExtraItemsTeams[iChoice] == && !g_bZombie[iPlayer]) || (g_bZombie[iPlayer] && g_iExtraItemsTeams[iChoice] == 2))
                {
                    
PrintToChat(iPlayer"^x04[ZP]^x01 This item is not for your team!");
                    return 
0;
                }
                if (
user_has_weapon(iPlayer9, -1))
                {
                    
PrintToChat(iPlayer"^x04[ZP]^x01 You already have one!");
                    return 
0;
                }
                else
                {
                    
give_weapon(iPlayer"weapon_smokegrenade");
                    
g_iPacks[iPlayer] -= g_iExtraItemsPrices[iChoice];
                    
set_hudmessage(20510229, -1.000.7010.003.002.001.00, -1);
                    
ShowSyncHudMsg(iPlayerg_iEventsHudmessage"You bought a Frost Nade!");
                }
            } 
I was think the ammo system is those "g_iExtraItemsPrices[iChoice] > g_iPacks[iPlayer]" but it's not, i checked the mod also and i saw only that "new g_iPacks" but there's not code showing me the ammo system
I will share inc and sma file if there's someone have expriance more than me do that for you..
Attached Files
File Type: sma Get Plugin or Get Source (ZPA62-CSBD.sma - 7 views - 154.9 KB)
File Type: inc zombie_plague.inc (39.7 KB, 3 views)
Supremache is offline
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 10:01.


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