AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Suggestions / Requests (https://forums.alliedmods.net/forumdisplay.php?f=12)
-   -   [REQ] ran def kit (https://forums.alliedmods.net/showthread.php?t=293291)

blanko 01-28-2017 10:26

[REQ] ran def kit
 
On every round at roundstart a random CT will receive a free defuser kit. Message will show up for everyone CTs and Ts: "NAME received a defuser kit."

OciXCrom 01-28-2017 13:07

Re: [REQ] ran def kit
 
PHP Code:

#include <amxmodx>
#include <fun>

public plugin_init()
{
    
register_plugin("Random Defuse Kit""1.0""OciXCrom @ alliedmods.net")
    
register_logevent("OnRoundStart"2"1=Round_Start")
}

public 
OnRoundStart()
{
    new 
iPlayers[32], iPnum
    get_players
(iPlayersiPnum"ae""CT")
    
    if(
iPnum)
    {
        new 
iPlayer iPlayers[random(iPnum)]
        
give_item(iPlayer"item_thighpack")
        
        new 
szName[32]
        
get_user_name(iPlayerszNamecharsmax(szName))
        
client_print(0print_chat"* %s received a free defuse kit."szName)
    }



edon1337 01-29-2017 13:16

Re: [REQ] ran def kit
 
Quote:

Originally Posted by OciXCrom (Post 2490600)
#include <amxmodx>
#include <fun>

public plugin_init()
{
register_plugin("Random Defuse Kit", "1.0", "OciXCrom @ alliedmods.net")
register_logevent("OnRoundStart", 2, "1=Round_Start")
}

public OnRoundStart()
{
new iPlayers[32], iPnum
get_players(iPlayers, iPnum, "ae", "CT")

if(iPnum)
{
new iPlayer = iPlayers[random(iPnum)]
give_item(iPlayer, "item_thighpack")

new szName[32]
get_user_name(iPlayer, szName, charsmax(szName))
client_print(0, print_chat, "* %s received a free defuse kit.", szName)
}
}

What's that for ?

OciXCrom 01-29-2017 13:31

Re: [REQ] ran def kit
 
To prevent all kinds of errors when the servers is empty.

blanko 01-29-2017 22:29

Re: [REQ] ran def kit
 
Thank you, OciXCrom! If I wanna randomize this and plus another item too, wanna do I need to change so the two plugins won't conflict each other?

OciXCrom 01-30-2017 08:16

Re: [REQ] ran def kit
 
The only possible conflict can be the same player receiving both items due to extreme luck (randomly chosen from both plugins).

blanko 02-26-2017 04:36

Re: [REQ] ran def kit
 
For terrorist just change the CT to T there?

" get_players(iPlayers, iPnum, "ae", "T")"

or instead of T goes TERRORIST?

OciXCrom 02-26-2017 08:32

Re: [REQ] ran def kit
 
The second one. I hope you won't give a defuse kit to the terrorists.

Relaxing 02-26-2017 08:34

Re: [REQ] ran def kit
 
Quote:

Originally Posted by blanko (Post 2498612)
For terrorist just change the CT to T there?

" get_players(iPlayers, iPnum, "ae", "T")"

or instead of T goes TERRORIST?

Code:
get_players(iPlayers, iPnum, "aeh", "TERRORIST");
(not for defuse kit) I would suggest blocking HLTV proxies.

OciXCrom 02-26-2017 08:39

Re: [REQ] ran def kit
 
Why? They can be alive?


All times are GMT -4. The time now is 02:00.

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