Raised This Month: $51 Target: $400
 12% 

AWP with 1 bullet


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
MihailoZ
Member
Join Date: Aug 2013
Old 03-25-2021 , 14:14   AWP with 1 bullet
Reply With Quote #1

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.
__________________
mhvtnns
MihailoZ is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 03-25-2021 , 14:48   Re: AWP with 1 bullet
Reply With Quote #2

You have another plugin that resets it.
__________________
OciXCrom is offline
Send a message via Skype™ to OciXCrom
MihailoZ
Member
Join Date: Aug 2013
Old 03-25-2021 , 14:50   Re: AWP with 1 bullet
Reply With Quote #3

Which one can it be? I have no idea...
__________________
mhvtnns
MihailoZ is offline
Crackhead69
Member
Join Date: Feb 2021
Old 03-25-2021 , 14:56   Re: AWP with 1 bullet
Reply With Quote #4

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.

Last edited by Crackhead69; 03-25-2021 at 14:59.
Crackhead69 is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 03-25-2021 , 15:11   Re: AWP with 1 bullet
Reply With Quote #5

Quote:
Originally Posted by Crackhead69 View Post
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.
__________________

Last edited by OciXCrom; 03-25-2021 at 15:12.
OciXCrom is offline
Send a message via Skype™ to OciXCrom
MihailoZ
Member
Join Date: Aug 2013
Old 03-25-2021 , 15:17   Re: AWP with 1 bullet
Reply With Quote #6

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?
__________________
mhvtnns
MihailoZ is offline
MihailoZ
Member
Join Date: Aug 2013
Old 03-25-2021 , 15:52   Re: AWP with 1 bullet
Reply With Quote #7

Quote:
Originally Posted by MihailoZ View Post
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?
__________________
mhvtnns

Last edited by MihailoZ; 03-25-2021 at 15:56.
MihailoZ is offline
DON KHAN 1
Senior Member
Join Date: Mar 2019
Location: Pakistan
Old 03-25-2021 , 15:57   Re: AWP with 1 bullet
Reply With Quote #8

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
__________________
Facebook
My YouTube
Ro{Y}aL WarLanD CommuniTy
Selling Zombie CSO 4.3 Money System Mod
DON KHAN 1 is offline
MihailoZ
Member
Join Date: Aug 2013
Old 03-25-2021 , 16:00   Re: AWP with 1 bullet
Reply With Quote #9

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
__________________
mhvtnns

Last edited by MihailoZ; 03-26-2021 at 09:00.
MihailoZ is offline
MihailoZ
Member
Join Date: Aug 2013
Old 03-25-2021 , 16:24   Re: AWP with 1 bullet
Reply With Quote #10

I fixed it.
mp_infiniteammo was the problem.
__________________
mhvtnns
MihailoZ is offline
Reply



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 11:00.


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