Raised This Month: $ Target: $400
 0% 

Auto Ready Plugin


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
LearninG
Senior Member
Join Date: Apr 2019
Location: Iran
Old 08-26-2019 , 07:39   Re: Auto Ready Plugin
Reply With Quote #5

Quote:
Originally Posted by thEsp View Post
@learning
1. There is no reason to declare specific task indexes when you aren't using them.
2. Function "client_start_command2" will send "say .ready" command to server, not a specific user.
3. Use loops instead ^.
4. Don't pass variables to tasks when you don't need them, pass only when you do.
I get it now , but i have 1 problem :
1- how to delay the command "client_cmd(i , "say .ready")" in "Event_TextMsg_Restarting" function ?
PHP Code:
#include <amxmodx> 

#define TASK_TIME        10.0 

new g_MaxPlayers

public plugin_init() 

    
register_plugin("Auto Ready Command" "0.01" "LearninG"
    
register_event("TextMsg""Event_TextMsg_Restarting""a""2=#Game_will_restart_in"
    
g_MaxPlayers get_maxplayers()


public 
client_putinserver(id

    
set_task(TASK_TIME "client_start_command"


public 
Event_TextMsg_Restarting(id
{
    for (new 
1i<= g_MaxPlayersi++)
    {
        
client_cmd("say .ready")
    }


public 
client_start_command(id

    
client_cmd(id "say .ready"

LearninG is offline
 



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 00:50.


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