Raised This Month: $319 Target: $400
 79%   Almost there!

help me...


Post New Thread Reply   
 
Thread Tools Display Modes
aNNNak1N
Junior Member
Join Date: Jan 2012
Location: Normandy, France
Old 02-12-2012 , 10:03   Re: help me...
Reply With Quote #11

Quote:
Originally Posted by Napoleon_be View Post
Did you even test this?
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,...)

Last edited by YamiKaitou; 07-16-2012 at 07:41. Reason: restored post
aNNNak1N is offline
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
aNNNak1N
Junior Member
Join Date: Jan 2012
Location: Normandy, France
Old 02-12-2012 , 10:12   Re: help me...
Reply With Quote #13

ok's

Last edited by YamiKaitou; 07-16-2012 at 07:41. Reason: restored post
aNNNak1N 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 02:28.


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