Raised This Month: $ Target: $400
 0% 

[REQ] ran def kit


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
blanko
Senior Member
Join Date: Aug 2008
Old 01-28-2017 , 10:26   [REQ] ran def kit
Reply With Quote #1

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."
__________________

Last edited by blanko; 01-28-2017 at 10:26.
blanko is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 01-28-2017 , 13:07   Re: [REQ] ran def kit
Reply With Quote #2

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)
    }

__________________
OciXCrom is offline
Send a message via Skype™ to OciXCrom
edon1337
Penguin Enthusiast
Join Date: Jun 2016
Location: Macedonia
Old 01-29-2017 , 13:16   Re: [REQ] ran def kit
Reply With Quote #3

Quote:
Originally Posted by OciXCrom View Post
#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 ?
__________________

Last edited by edon1337; 01-29-2017 at 13:16.
edon1337 is offline
blanko
Senior Member
Join Date: Aug 2008
Old 01-29-2017 , 22:29   Re: [REQ] ran def kit
Reply With Quote #4

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?
__________________
blanko is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 01-29-2017 , 13:31   Re: [REQ] ran def kit
Reply With Quote #5

To prevent all kinds of errors when the servers is empty.
__________________

Last edited by OciXCrom; 01-29-2017 at 13:31.
OciXCrom is offline
Send a message via Skype™ to OciXCrom
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 01-30-2017 , 08:16   Re: [REQ] ran def kit
Reply With Quote #6

The only possible conflict can be the same player receiving both items due to extreme luck (randomly chosen from both plugins).
__________________

Last edited by OciXCrom; 01-30-2017 at 08:17.
OciXCrom is offline
Send a message via Skype™ to OciXCrom
blanko
Senior Member
Join Date: Aug 2008
Old 02-26-2017 , 04:36   Re: [REQ] ran def kit
Reply With Quote #7

For terrorist just change the CT to T there?

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

or instead of T goes TERRORIST?
__________________

Last edited by blanko; 02-26-2017 at 04:37.
blanko is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 02-26-2017 , 08:32   Re: [REQ] ran def kit
Reply With Quote #8

The second one. I hope you won't give a defuse kit to the terrorists.
__________________

Last edited by OciXCrom; 02-26-2017 at 08:33.
OciXCrom is offline
Send a message via Skype™ to OciXCrom
Relaxing
AlliedModders Donor
Join Date: Jun 2016
Location: White Plains
Old 02-26-2017 , 08:34   Re: [REQ] ran def kit
Reply With Quote #9

Quote:
Originally Posted by blanko View Post
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.
__________________

Last edited by Relaxing; 02-26-2017 at 08:35.
Relaxing is offline
blanko
Senior Member
Join Date: Aug 2008
Old 02-26-2017 , 10:29   Re: [REQ] ran def kit
Reply With Quote #10

Quote:
Originally Posted by Relaxing View Post
Code:
get_players(iPlayers, iPnum, "aeh", "TERRORIST");
(not for defuse kit) I would suggest blocking HLTV proxies.
Thank you!
__________________
blanko is offline
Reply



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 02:01.


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