AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Problem with colored text (https://forums.alliedmods.net/showthread.php?t=144032)

J4CK 11-27-2010 22:53

Problem with colored text
 
lang file:
PHP Code:

SCAN_CLEAN human
SCAN_INFECTED 
zombie
SCAN_RESULTS 
= [ZombieModYou are

zm mod:
PHP Code:

public task_newround()
{
    static 
players[32], numiidnewzombie
    get_players
(playersnum"a")

    
newzombie players[_random(num)]
    if(
num && is_user_connected(g_zombieoftheround))
    {
        while(
g_zombieoftheround == newzombie)
            
newzombie players[_random(num)]
    }
    
g_zombieoftheround newzombie

    
for(0numi++)
    {
        
id players[i]
        
ColorChat(idRED"%L %L"id"^x04SCAN_RESULTS"idg_zombieoftheround == id "^x03SCAN_INFECTED" "^x04SCAN_CLEAN")
    }
    
    if(
get_pcvar_num(cvar_randomspawn))
        
randomly_place_everyone()


need:
[ZombieMod] You are: human
[ZombieMod] You are: zombie

Jacob 11-28-2010 00:32

Re: Problem with colored text
 
^x04%L instead of ^x04SCAN_RESULTS

J4CK 12-09-2010 22:08

Re: Problem with colored text
 
Quote:

Originally Posted by Jacob (Post 1358553)
^x04%L instead of ^x04SCAN_RESULTS

(Nooooo) :nono: all text will be green

Quote:

I want, if player is normal: (text will be)
[ZombieMod] You are: human

If player is zombie: (text will be)
[ZombieMod] You are: zombie
:cry:
i'm not understand why my method don't works

PHP Code:

ColorChat(idRED"%L %L"id"^x04SCAN_RESULTS"idg_zombieoftheround == id "^x03SCAN_INFECTED" "^x04SCAN_CLEAN"


Exolent[jNr] 12-09-2010 22:12

Re: Problem with colored text
 
Remove the color codes from the lang names.

Code:
if(g_zombieoftheround == id) {     ColorChat(id, RED, "^x04%L ^x03%L", id, "SCAN_RESULTS", id, "SCAN_INFECTED") } else {     ColorChat(id, GREEN, "%L %L", id, "SCAN_RESULTS", id, "SCAN_CLEAN") }

Jacob 12-09-2010 22:51

Re: Problem with colored text
 
Quote:

Originally Posted by J4CK (Post 1367445)
(Nooooo) :nono: all text will be green



:cry:
i'm not understand why my method don't works

PHP Code:

ColorChat(idRED"%L %L"id"^x04SCAN_RESULTS"idg_zombieoftheround == id "^x03SCAN_INFECTED" "^x04SCAN_CLEAN"


I just want to tell you that ^04 should not be before SCAN_RESULTS,


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

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