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

I need help with my plugin


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
RayCodeCSC
Junior Member
Join Date: Sep 2019
Old 09-01-2019 , 19:13   I need help with my plugin
Reply With Quote #1

Hi, I need help with my plugin. I have created a store in which I have a list with items such as "Power 1", "Power 2", etc.

and I need to do that when a player presses, for example, "Power 1", it sets the damage to 50.0. I'd like to do it through hamsandwich.

Originally I wanted to do this as follows:
Code:
public plugin_init()
{
	register_plugin("My first shop", "1.0", "RayCodeCSC")

	register_clcmd("say /test", "test_function")

	RegisterHam(Ham_TakeDamage, "player", "isDamaged")
}

public test_function(id)
{
	//What exactly do I write in brackets?
	isDamaged(victim, attacker, inflictor, Float:damage, damagebits)
}

public isDamaged(victim, attacker, inflictor, Float:damage, damagebits)
{
	if(get_user_weapon(attacker) == CSW_KNIFE)
	{
		SetHamParamFloat(4, damage = 30.0)
	}
}
But I can't work enough to call a function.
So the question is: How do I call a function?

When I tried it like this, it doesn't work for me:
Code:
isDamaged(victim, attacker, inflictor, Float:damage, damagebits)
So what do I write in brackets isDamaged() to make it public isDamaged()?

In a nutshell: I just want to explain how a function call works and possibly correct my code.

I apologize for my English, perhaps you'll understand what I want from you :-).
RayCodeCSC 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 01:57.


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