AlliedModders

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

Bladell 12-26-2013 10:25

Message
 
I have a message like this: "Your privileges as VIP are: " and I want to show after "speed" (if player have a certain flag acces), "lower gravity" (if player have other certain flag access) "more health" (if player have other certain flag access).
My message should look like this: "Your privileges as VIP are: more speed, lower gravity, more health"...
My question is how can I make this message? If player have just last two flag access the message should look like this: "Your privileges as VIP are: lower gravity, more health"
Also, if player have only one flag acces the message should look like this: "Your privileges as VIP are: more health" (for example)
Is there a way to make a mesasge like this? I thought to use formatex but I have no ideea how can I create the message after ":".

Baws 12-26-2013 12:39

Re: Message
 
use client_print ?

Bladell 12-26-2013 13:04

Re: Message
 
You didn't understand what I want...

ConnorMcLeod 12-26-2013 14:40

Re: Message
 
Show flags and messages (or messages parts) please.

Bladell 12-26-2013 17:07

Re: Message
 
"^4[AMXX]^1(VIP) Your VIP privileges are: "
if player have flag n "gravity, hp regeneration"
if player have flag o "health"
if player have flag p "speed"
if player have flag q "+50% XP, revive"
if player have flag r, all messages above + "4000$ money, +100% XP" <instead of 50% XP> "acces to <a hero> and amx_startvote"

ConnorMcLeod 12-27-2013 05:32

Re: Message
 
A way :

PHP Code:

const FLAG_VIP_GRAV_REGEN ADMIN_LEVEL_B;
const 
FLAG_VIP_HEALTH ADMIN_LEVEL_C;
const 
FLAG_VIP_GRAV_SPEED ADMIN_LEVEL_D;
const 
FLAG_VIP_GRAV_XP_REVIVE ADMIN_LEVEL_E;
const 
FLAG_VIP_ALL ADMIN_LEVEL_F;

format_player_messageid )
{
    new 
flags get_user_flags(id);

    new 
szMessage[190], n;
    
+= formatex(szMessage[n], charsmax(szMessage)-n"^4[AMXX]^1(VIP) Your VIP privileges are:");
    if( 
flags FLAG_VIP_ALL )
    {
        
+= formatex(szMessage[n], charsmax(szMessage)-n" gravity, hp regen, health, speed, 4000$ money, +100% XP, acces to <a hero> and amx_startvote");
    }
    else
    {
        if( 
flags FLAG_VIP_GRAV_REGEN )
        {
            
+= formatex(szMessage[n], charsmax(szMessage)-n" gravity, hp regen,");
        }
        if( 
flags FLAG_VIP_HEALTH )
        {
            
+= formatex(szMessage[n], charsmax(szMessage)-n" health,");
        }
        if( 
flags FLAG_VIP_GRAV_SPEED )
        {
            
+= formatex(szMessage[n], charsmax(szMessage)-n" speed,");
        }
        if( 
flags FLAG_VIP_GRAV_XP_REVIVE )
        {
            
+= formatex(szMessage[n], charsmax(szMessage)-n"+50% XP, revive");
        }
        if( 
szMessage[n-1] == ',' )
        {
            
szMessage[n-1] = EOS;
        }
    }
    
client_print_color(idprint_team_blueszMessage);



Bladell 12-27-2013 08:14

Re: Message
 
Thanks Connor :)

Baws 12-27-2013 11:58

Re: Message
 
Off topic sorry: client_print_color needs a stock or it's already included? Knowing that ColorChat needs a .inc file.

Bladell 12-27-2013 12:14

Re: Message
 
I use ColorChat stock version...

ConnorMcLeod 12-27-2013 12:44

Re: Message
 
Better to use included one from amxx1.8.3

Edit :

I had completely messed up formatting, it is fixed now.


All times are GMT -4. The time now is 10:12.

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