Thread: help me...
View Single Post
RoaR
Member
Join Date: Dec 2011
Old 02-12-2012 , 10:10   Re: help me...
Reply With Quote #12

Quote:
Originally Posted by aNNNak1N View Post
don't work

this work
Code:
#include <amxmodx>
#include <geoip>
#include <colorchat>

#define VERSION "1.0.0"

new szIP[16]

public plugin_init() {
    register_plugin("User Connected", VERSION, "NapoleoN#")
    
}

public client_putinserver(id) {
    set_task(1.0, "ShowMessage", id)
}

public ShowMessage(id) {
    new szCountry[32]; geoip_country(szIP, szCountry)
    new szName[32] ; get_user_name(id, szName, charsmax(szName))
    
    ColorChat(id, GREEN, "%s^x01 connected^x03 [%s].", szName, szCountry)
}


But y don't understand why set_task(1.0,...)
It will show the message first second after connected!

PHP Code:
set_task Float:time, const function[], id 0parameter[]=""len 0flags[]=""repeat 
What each thing in set_task does:
Code:
* Float:time - Interval of timer in second. (minimum 0.1 seconds) 
* function[] - A string that contains the public function to run on the timer. 
* id - A unique id to assign to the task. 
* parameter - An array contain data to send to the timer function. 
* len - Size of the array to send to the timer function. 
* flags - One of the following:  
-- "a" - Repeat task a specified number of times  
-- "b" - Loop task infinitely  
-- "c" - do task on time after a map timeleft  
-- "d" - do task on time before a map timeleft 
* repeat - If flags is "a", specifies the number of times to repeat the task.
RoaR is offline