AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Mesage fix (https://forums.alliedmods.net/showthread.php?t=225628)

raducuursu 09-07-2013 04:37

Mesage fix
 
anyone who can fix this bug, messages appear one after another
should not appear the same message 2 times in a row

PHP Code:

#include < amxmodx >
#include < amxmisc >
#include <colorchat>

#define PLUGIN "Messages Shower"
#define VERSION "1.0"
#define AUTHOR "Alka"

#define ADVERTISING_TIME 35.0

stock const messages [ ] [ ] =
{
    
"^x04[ZP]^x01 Te rugam sa citesti regulamentul pe^x03 http://csoutstanding.com",
    
"^x04[ZP]^x01 IP: ^x04178.168.55.213 ^x01PORT: ^x0327015",
    
"^x04[ZP]^x01 Type^x03 /donate^x04 <name> <packs>^x01 to donate ammo packs!",
    
"^x04Co-Owner^x01+^x04Vip ^x03PERMANENT ^x045Euro ^x03Cosmote/Paypal^x01! : ^x03add ! [email protected] ^x01!",
    
"^x04[ZP]^x01Thank you for your decision you made!^x03 .:: HellZm.CsOutStanding.Com ::."
}

public 
plugin_init ( )
{
    
register_plugin PLUGINVERSIONAUTHOR )
    
    
set_task ADVERTISING_TIME"show_messages"___,"b" );
}

public 
show_messages ( )
{
    
client_print_color(0Grey"%s"messages[random(sizeof messages)])



ConnorMcLeod 09-07-2013 05:14

Re: Mesage fix
 
Fixed your problem + added support for next amxx release (or actual builds).
Also, amxx version on your server is outdated.

PHP Code:

#include < amxmodx >

#if !defined client_print_color // fix for amx1.8.3
    #include < colorchat >
#else
    #define Grey print_team_grey
#endif

#define PLUGIN "Messages Shower"
#define VERSION "1.1"
#define AUTHOR "Alka"

#define ADVERTISING_TIME 35.0

new const messages [ ] [ ] =
{
    
"^4[ZP]^1 Te rugam sa citesti regulamentul pe^3 http://csoutstanding.com",
    
"^4[ZP]^1 IP: ^4178.168.55.213 ^1PORT: ^327015",
    
"^4[ZP]^1 Type^3 /donate^4 <name> <packs>^1 to donate ammo packs!",
    
"^4Co-Owner^1+^4Vip ^3PERMANENT ^45Euro ^3Cosmote/Paypal^1! : ^3add ! [email protected] ^1!",
    
"^4[ZP]^1Thank you for your decision you made!^3 .:: HellZm.CsOutStanding.Com ::."
};

public 
plugin_init ( )
{
    
register_plugin PLUGINVERSIONAUTHOR );

    
set_task ADVERTISING_TIME"show_messages"___,"b" );
}

public 
show_messages ( )
{
    static 
count = -1;
    if( ++
count >= sizeof(messages) )
    {
        
count 0;
    }
    
client_print_color(0Greymessagescount ]);



raducuursu 09-07-2013 06:39

Re: Mesage fix
 
thanks


All times are GMT -4. The time now is 19:14.

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