AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   randomly or team wise (https://forums.alliedmods.net/showthread.php?t=312028)

SHIELD755 11-13-2018 03:23

randomly or team wise
 
hii every body

is it possible to send two command randomly or by team wise
for an example i have a hero plugin and when hero come it buy a gun or send a clientcommand "buy_gun" and he buy a gun and i does not have the soruce code of that hero so i am thinking that how to make a public function in a new plugin which has register_clcmd(buy_gun) so that it send the two client command randomly or by team wise in which the other two plugin will have cmd like clientcmd: buy_gun1 and buy_gun2

i just tried this
PHP Code:

public plugin_init()
{
   
register_plugin(PLUGINVERSIONAUTHOR)
   
register_clcmd("buygun""buygun")
}

public 
buy_gun(id)
}
            switch(
iTeam){
                case 
1:
                {
                    
client_cmd(i"buy_gun1")
                    
                }
                case 
2:
                {
                    
client_cmd("buy_gun2")



i think all clear may be

Relaxing 11-13-2018 05:41

Re: randomly or team wise
 
Correct me if I'm wrong: You have a plugin and don't own the source code of it. With two commands registered, meant to give user a specific weapon, you want those commands merged into one simple command where depending on player's team, you call one of those commands.
Also when you say randomly do you want the first player who writes buygun in console has the opportunity to get the weapon on his team?, or just pickup a random player at the end of freezetime and give 2 players from both teams custom weapons.

SHIELD755 11-13-2018 06:08

Re: randomly or team wise
 
you got the point relaxing
i am saying if it is possible to give randomly than ok or if it is possible to give team wise than also great

Relaxing 11-13-2018 06:32

Re: randomly or team wise
 
Try amxxdump that plugin and try to guess the function's name of that command. Then if successful you can block both those buy gun 1 and 2 from being executed. Calling the function saves more effort other than what you're requesting.

SHIELD755 11-13-2018 06:47

Re: randomly or team wise
 
sound relaxing


All times are GMT -4. The time now is 07:30.

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