AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   AWP with 1 bullet (https://forums.alliedmods.net/showthread.php?t=331544)

MihailoZ 03-25-2021 14:14

AWP with 1 bullet
 
How to give a player an AWP with 1 bullet.

This code:

Code:

cs_set_weapon_ammo(give_item(id, "weapon_awp"), 1);
cs_set_user_bpammo(id, CSW_AWP, 0);

Is not working because when I fire that 1 bullet I "have", bpammo RESETS and it shows 0/30 and it reloads the gun and I have 10/30.

How to fix that?


Thanks.

OciXCrom 03-25-2021 14:48

Re: AWP with 1 bullet
 
You have another plugin that resets it.

MihailoZ 03-25-2021 14:50

Re: AWP with 1 bullet
 
Which one can it be? I have no idea...

Crackhead69 03-25-2021 14:56

Re: AWP with 1 bullet
 
It should work with just
PHP Code:

cs_set_weapon_ammo(give_item(id"weapon_awp"), 1

bpammo is automaticly at 0 when item is given, therefore unnecessary

Check for plugin which can reset your weapon bpammo, there's no other way for it to do so
EDIT:
Answered a bit late.

You should know which plugin might, because we have 0 clue.

OciXCrom 03-25-2021 15:11

Re: AWP with 1 bullet
 
Quote:

Originally Posted by Crackhead69 (Post 2741803)
It should work with just
PHP Code:

cs_set_weapon_ammo(give_item(id"weapon_awp"), 1

bpammo is automaticly at 0 when item is given, therefore unnecessary

There are hundreds of scenarios where he could have picked up AWP ammo before it was given to him. The ammo is stored on the player, not on the weapon.

MihailoZ 03-25-2021 15:17

Re: AWP with 1 bullet
 
I'll get back to this issue soon.

I have this code:

Code:

actionAWP(id, OverrideTimer)
{
        new Float:fTime = halflife_time();
       
        if (fTime >= gfAWPNextUse[id] || OverrideTimer && cs_get_user_team(id) == CS_TEAM_T)
        {
               
                cs_set_weapon_ammo(give_item(id, "weapon_awp"), 1);
                cs_set_user_bpammo(id, CSW_AWP, 0);
               
                gfAWPNextUse[id] = fTime + get_cvar_float("awpcooldown");
        }
        else
        {
                set_hudmessage(gHudRed, gHudGreen, gHudBlue, gfTextX, gfTextY, gHudEffects, gfHudFxTime, gfHudHoldTime, gfHudFadeInTime, gfHudFadeOutTime, gHudChannel);
                show_hudmessage(id, "AWP next use: %.1f", gfAWPNextUse[id] - fTime);
               
        }
       
}

I have an issue with teams. Even though I set cs_get_user_team(id) == CS_TEAM_T, CT can still pick a weapon. Is this because of ELSE?

MihailoZ 03-25-2021 15:52

Re: AWP with 1 bullet
 
Quote:

Originally Posted by MihailoZ (Post 2741808)
I'll get back to this issue soon.

I have this code:

Code:

actionAWP(id, OverrideTimer)
{
        new Float:fTime = halflife_time();
       
        if (fTime >= gfAWPNextUse[id] || OverrideTimer && cs_get_user_team(id) == CS_TEAM_T)
        {
               
                cs_set_weapon_ammo(give_item(id, "weapon_awp"), 1);
                cs_set_user_bpammo(id, CSW_AWP, 0);
               
                gfAWPNextUse[id] = fTime + get_cvar_float("awpcooldown");
        }
        else
        {
                set_hudmessage(gHudRed, gHudGreen, gHudBlue, gfTextX, gfTextY, gHudEffects, gfHudFxTime, gfHudHoldTime, gfHudFadeInTime, gfHudFadeOutTime, gHudChannel);
                show_hudmessage(id, "AWP next use: %.1f", gfAWPNextUse[id] - fTime);
               
        }
       
}

I have an issue with teams. Even though I set cs_get_user_team(id) == CS_TEAM_T, CT can still pick a weapon. Is this because of ELSE?

I fixed this, can you please now help me with 1 bullet issue.
What plugin could reset bpammo?

Can I like set BPAmmo to 0 at client_connect?

DON KHAN 1 03-25-2021 15:57

Re: AWP with 1 bullet
 
Quote:

I fixed this, can you please now help me with 1 bullet issue.
What plugin could reset bpammo?
Show your plugins name in plugins.ini

MihailoZ 03-25-2021 16:00

Re: AWP with 1 bullet
 
Code:

advanced_bans.amxx
blockmaker_v3.60.amxx
uq_jumpstats.amxx
uq_jumpstats_tops.amxx
hudTextArgsBlock.amxx
; AMX Mod X plugins

; Admin Base - Always one has to be activated
admin.amxx                ; admin base (required for any admin-related)

; Basic
admincmd.amxx        ; basic admin console commands
adminhelp.amxx                ; help command for admin console commands
adminslots.amxx                ; slot reservation
multilingual.amxx                ; Multi-Lingual management

; Menus
menufront.amxx                ; front-end for admin menus
cmdmenu.amxx                ; command menu (speech, settings)
plmenu.amxx                ; players menu (kick, ban, client cmds.)
;telemenu.amxx                ; teleport menu (Fun Module required!)
pausecfg.amxx
mapsmenu.amxx                ; maps menu (vote, changelevel)
pluginmenu.amxx                ; Menus for commands/cvars organized by plugin

; Chat / Messages
antiflood.amxx                ; prevent clients from chat-flooding the server
scrollmsg.amxx                ; displays a scrolling message
imessage.amxx                ; displays information messages
adminvote.amxx                ; vote commands

; Map related
nextmap.amxx                ; displays next map in mapcycle
;mapchooser.amxx                ; allows to vote for next map
timeleft.amxx                ; displays time left on map
;roundsleft_nospeak.amxx

; Configuration
statscfg.amxx                ; allows to manage stats plugins via menu and commands

; Counter-Strike
restmenu.amxx                ; restrict weapons menu
statsx.amxx                ; stats on death or round end (CSX Module required!)
miscstats3.amxx                ; bunch of events announcement for Counter-Strike
stats_logging.amxx        ; weapons stats logging (CSX Module required!)


amx_ejl_adminchat.amxx debug
admin_freelook2.amxx
Map_Spawns_Editor.amxx debug
task_scheduler.amxx debug
;ressetscore.amxx debug
ad_manager.amxx


hidenseek.amxx
kgbbots.amxx
buyzonerange.amxx
;roundsleft.amxx
amx_gag.amxx
specinfo.amxx
;GHW_Weapon_Replacement.amxx
kz_bugs_stats.amxx


MihailoZ 03-25-2021 16:24

Re: AWP with 1 bullet
 
I fixed it.
mp_infiniteammo was the problem.


All times are GMT -4. The time now is 23:48.

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