Raised This Month: $ Target: $400
 0% 

global var ?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
DaniDin
Member
Join Date: Oct 2008
Old 01-09-2009 , 10:13   global var ?
Reply With Quote #1

hi i want to do timer that i can change the time how to do it ?
PHP Code:
#include <amxmodx>
#include <amxmisc>

new Gtime 10;

public 
plugin_init()
{
set_task(Gtime ,"HelloMSG",0,_,_,"b")
}
public 
HelloMSG(id)
{
    
server_cmd("amx_say Hi , Welcome to my server .")
     
Gtime 300;

DaniDin is offline
kyler
BANNED
Join Date: Dec 2008
Old 01-09-2009 , 10:38   Re: global var ?
Reply With Quote #2

try this instead the 1 on the end represents repeating, put to 0 to do this once
the 10 is the ammount of time in seconds i believe so that task will do the Function HelloMSG every 10 seconds
PHP Code:
set_task(10"HelloMSG"0""0""1

Last edited by kyler; 01-09-2009 at 10:41.
kyler is offline
DaniDin
Member
Join Date: Oct 2008
Old 01-09-2009 , 10:46   Re: global var ?
Reply With Quote #3

i want it will say the hello 5 times (timer 10 sec) and if it over the 5 so the timer will be 300 sec
like this
PHP Code:
#include <amxmodx>
#include <amxmisc>

new Gtime 10;
new 
GTMSEC 1;
public 
plugin_init()
{
set_task(Gtime ,"HelloMSG",0,_,_,"b")
}
public 
HelloMSG(id)
{
    
server_cmd("amx_say Hi , Welcome to my server .")
GTMSEC GTMSEC +1;
if(
GTMSEC >= 5)
     
Gtime 300;

DaniDin is offline
Spunky
Senior Member
Join Date: May 2008
Location: Orlando, Fl.
Old 01-09-2009 , 23:30   Re: global var ?
Reply With Quote #4

PHP Code:
#include <amxmodx>
#include <amxmisc>

new g_iCount

public plugin_init()
{
    
set_task(100.0"fnHello"1337__"b")
}

public 
fnHello()
{
    
server_cmd("amx_say Hi, welcome to my server.")

    if (
g_iCount 5)
        
g_iCount++
    else
        
remove_task(13370)

    return 
PLUGIN_HANDLED


Last edited by Spunky; 01-10-2009 at 00:12.
Spunky is offline
Send a message via AIM to Spunky
Emp`
AMX Mod X Plugin Approver
Join Date: Aug 2005
Location: Decapod 10
Old 01-10-2009 , 00:44   Re: global var ?
Reply With Quote #5

PHP Code:
#include <amxmodx>
#include <amxmisc>

new Float:Gtime 10;
new 
GTMSEC 1;
public 
plugin_init()
{
    
set_task(Gtime ,"HelloMSG")
}
public 
HelloMSG()
{
    
server_cmd("amx_say Hi , Welcome to my server .")
    if( ++
GTMSEC )
        
Gtime 300.0;
    
set_task(Gtime ,"HelloMSG")

Emp` is offline
Send a message via AIM to Emp` Send a message via MSN to Emp` Send a message via Yahoo to Emp` Send a message via Skype™ to Emp`
AntiBots
Veteran Member
Join Date: May 2008
Location: Brazil
Old 01-10-2009 , 19:55   Re: global var ?
Reply With Quote #6

PHP Code:
#include <amxmodx>
 
new contador[33]
 
public 
client_putinserver(id)
{
         
contador[id] = 0
         set_task
(10.0"mensaje"id__"b")
}
 
public 
client_disconnect(id)
         
remove_task(id)
 
public 
mensaje(id)
{
         if( 
contador[id] <= )
         {
                  
change_task(id300.0)
         }
         else
         {
                  
contador[id]++;
         }
 
         
client_print(idprint_chat"amx_say Hi , Welcome to my server .")

__________________

Last edited by AntiBots; 01-10-2009 at 19:57. Reason: correct [php]
AntiBots is offline
Send a message via ICQ to AntiBots Send a message via MSN to AntiBots Send a message via Skype™ to AntiBots
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 09:10.


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