Raised This Month: $ Target: $400
 0% 

Function on all


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Diegorkable
Veteran Member
Join Date: Jun 2011
Old 06-24-2011 , 05:49   Function on all
Reply With Quote #1

Hey.
I want to make a plugin that includes round_start()
it means that it is called when the round starts, now my question is, how do I do inside the public function that it checks all the players that are currently logged in the server and checks if they are CT?
Diegorkable is offline
Nyuszy
Senior Member
Join Date: Apr 2009
Old 06-24-2011 , 06:46   Re: Function on all
Reply With Quote #2

PHP Code:
public round_start()
{
    new 
players[32], numid
    get_players
(playersnum"eh""CT")
    for(new 
0numi++)
    {
        
id players[i]
        
// ...
    
}

Nyuszy is offline
Diegorkable
Veteran Member
Join Date: Jun 2011
Old 06-24-2011 , 13:25   Re: Function on all
Reply With Quote #3

Hey!

I made a code that is supposed to give all the CT players each round a defusal kit.

Still it is not working, tell me why?

PHP Code:
/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <amxmisc>
#include <fun>
#include <cstrike>

#define PLUGIN "Defuse Kit"
#define VERSION "1.0"
#define AUTHOR "p1Mp"


public plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
// Add your code here...
}

public 
round_start()
{
    new 
players[32], numid
    get_players
(playersnum"aeh""CT")
    for(new 
0numi++)
    {
        
id players[i]
        
give_item(id"item_thighpack")
    }

Diegorkable is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 06-24-2011 , 13:26   Re: Function on all
Reply With Quote #4

Because you never hooked round_start() to anything.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
Diegorkable
Veteran Member
Join Date: Jun 2011
Old 06-24-2011 , 13:33   Re: Function on all
Reply With Quote #5

what do you mean? could you please elaborate?
I did the same with the public function player_connect() and didn't have to 'hook' it up to anything and it worked.

How do I hook up round_start() to something that it will work?? please tell me

Last edited by Diegorkable; 06-24-2011 at 13:40.
Diegorkable is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 06-24-2011 , 14:18   Re: Function on all
Reply With Quote #6

https://forums.alliedmods.net/showthread.php?t=42159
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
Diegorkable
Veteran Member
Join Date: Jun 2011
Old 06-24-2011 , 15:04   Re: Function on all
Reply With Quote #7

Here is the new code, it doesn't work either.
Whats wrong?!?

PHP Code:
/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <amxmisc>
#include <fun>
#include <cstrike>

#define PLUGIN "Defuse Kit"
#define VERSION "1.0"
#define AUTHOR "p1Mp"


public plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
register_logevent("round_start"2"1=Round_Start")  
}

public 
round_start()
{
    new 
players[32], numid
    get_players
(playersnum"aeh""CT")
    for(new 
0numi++)
    {
        
id players[i]
        
give_item(i"item_thighpack")
    }


Last edited by Diegorkable; 06-24-2011 at 15:11.
Diegorkable is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 06-24-2011 , 15:14   Re: Function on all
Reply With Quote #8

Because you changed part of your code.

Quote:
Originally Posted by Diegorkable View Post
PHP Code:
        give_item(id"item_thighpack"
Quote:
Originally Posted by Diegorkable View Post
PHP Code:
        give_item(i"item_thighpack"
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
Diegorkable
Veteran Member
Join Date: Jun 2011
Old 06-24-2011 , 15:31   Re: Function on all
Reply With Quote #9

thank you very much!!
Diegorkable is offline
Reply


Thread Tools
Display Modes

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 23:31.


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