Raised This Month: $ Target: $400
 0% 

Problem with my plugin (probably random func)


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
obiwan
Junior Member
Join Date: Sep 2008
Old 06-14-2010 , 12:19   Problem with my plugin (probably random func)
Reply With Quote #1

Hey, i have problem with plugin. I wrote a simply plugin which types a message every 30 seconds, but it doesnt work properly.

code:

PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <fun>
#include <colorchat>
#include <Vexd_Utilities>

new hostName;
new 
zapraszamy;

public 
plugin_init() {
    
     
    
register_cvar("amx_tag""[cs.obiwanek.pl]")
    
register_cvar("amx_link""cs.obiwanek.pl")
     
    
set_task(30.0,"spam",_,_,_,"b")

    
hostName get_cvar_num("amx_tag")
    
zapraszamy get_cvar_num("amx_link")

    return 
PLUGIN_CONTINUE
    
}


public 
spam()
{
    switch(
random(3))
    {
        case 
0ColorChat(0RED,"%s^x01 Please visit our site^x04 %s."hostNamezapraszamy);
        case 
1ColorChat(0RED"%s^x03 xxxxxxxxxxxxxxxxxxxxxx."hostName);
        case 
2ColorChat(0BLUE,"%s^x01 xxxxxxxxxxxxxxxxxxxxxxxx"hostName);
    }


I would like to make it say something like (thats only example)
Code:
[cs.obiwanek.pl] Please visit our site cs.obiwanek.pl.
But it says
Code:
Please visit our site .
What I did wrong ? Its not full plugin, but i think that's most important.
obiwan is offline
 


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 14:42.


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