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

Solved give grenade to player


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
kww
Senior Member
Join Date: Feb 2021
Location: Russia
Old 06-10-2021 , 00:43   give grenade to player
Reply With Quote #1

hi! how to use fun's give_item() properly? I'm trying to give grenades to player when he throwing 'em but it gives me only flashbangs. Can someone help me and tell where are errors here?
Code:
#include <amxmodx>
#include <fun>
#include <csx>

new pCvar

public plugin_init() {
	register_plugin("infinite_grenades", "latest", "kww")
	pCvar = register_cvar("sv_testcvar", "1", FCVAR_SERVER)
}

public grenade_throw(id, gid, wid) {
	if(!get_pcvar_num(pCvar))
		return PLUGIN_HANDLED
	
	switch(wid) {
		case CSW_HEGRENADE: give_item(id, "weapon_hegrenade")
		case CSW_FLASHBANG: give_item(id, "weapon_flashbang")
		case CSW_SMOKEGRENADE: give_item(id, "weapon_smokegrenade")
	}
	
	return PLUGIN_CONTINUE
}

Last edited by kww; 06-11-2021 at 10:34.
kww is offline
 



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 04:42.


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