Quote:
Originally Posted by Arkshine
I know this plugin and it's an ugly method, not practical and not efficient. Anyway I've found another way. There is a function which uses the global var, it will be more reliable.
|
Well since you were busy, I did some brainstorming trying to figure out a plugin capable of changing the weapon cost without modifying the mp.dll usign memhack. Below was the plugin I found that gave me an insane but efficient and effective enough method of changing the weapon cost by amxmodx plugin.
Quote:
#include <amxmodx>
public plugin_init()
{
register_plugin("Blokowane kupowanie", "1", "Sal")
register_clcmd("cl_setautobuy","block")
register_clcmd("cl_autobuy","block")
register_clcmd("cl_setrebuy","block")
register_clcmd("cl_rebuy","block")
register_clcmd("buy","block")
register_clcmd("glock","block")
register_clcmd("usp","block")
register_clcmd("p228","block")
register_clcmd("deagle","block")
register_clcmd("elites","block")
register_clcmd("fn57","block")
register_clcmd("m3","block")
register_clcmd("autoshotgun","block")
register_clcmd("mac10","block")
register_clcmd("tmp","block")
register_clcmd("mp5","block")
register_clcmd("ump45","block")
register_clcmd("p90","block")
register_clcmd("galil","block")
register_clcmd("ak47","block")
register_clcmd("scout","block")
register_clcmd("sg552","block")
register_clcmd("awp","block")
register_clcmd("g3sg1","block")
register_clcmd("famas","block")
register_clcmd("m4a1","block")
register_clcmd("bullpup","block")
register_clcmd("sg550","block")
register_clcmd("m249","block")
register_clcmd("shield","block")
}
public block(id)
{
return PLUGIN_HANDLED
}
|
Using this plugin i can port each of the client buy commands to do a event hook.. For example let say the client excuted the client command ak47....
Normaly this would buy an ak47 at the normal price... But we can hook a new event to the command that would check to see.
-if the client has an ak47 or does not have...
-if the client had enough money to buy the ak47 based on new cost
-if so give ak47 to client than subtract new cost from clients cash
Also if this is done to all the weapon buys and items buys (ex. "ak47" command)
than a new buy menu can be made and ported the same way to the "buy" command.
ex. when "buy" command is issued by client. run the "buymenu" hookevent
which the new buy menu only has to call the modifed client specific buy commands like ... "ak47"
So far this is the best way I can see to modify the weapon cost ingame without to much code execution, basically the codes is only called when the client calls the normall buy commands ^^