AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   format [Problem] ( Solved ) (https://forums.alliedmods.net/showthread.php?t=253241)

Natsheh 12-18-2014 11:54

format [Problem] ( Solved )
 
the plugin works fine but when you say its dosent change the color!WHY?

PHP Code:

/* Plugin generated by AMXX-Studio */
     
#include <amxmodx>
#include <amxmisc>
//#include <vip>
     
#define PLUGIN "[VIP] Chat Prefix"
#define VERSION "1.0"
#define AUTHOR "Natsheh"
     

enum 

Udead 0,
Ualive 
}
     
new const 
prefix[] = "[VIP]"
     
new const stats_prefix[][] = { 
"*DEAD*"
"*ALIVE*"
}
     
new const 
team_prefix[][] = {
"*Spectator*",
"*Terrorist*",
"*CT*"
}
     
new 
msgid_saytext
     
public plugin_init()
{
register_plugin(PLUGINVERSIONAUTHOR)

msgid_saytext get_user_msgid("SayText")

register_message(msgid_saytext"vip_cmd_saytext")
}
     
public 
vip_cmd_saytext(msgidmsgdestid)
{
if(
/*!is_user_vip(id) && */!is_user_connected(id)) return

new 
sMsg[192], sBuffer[192], szArgs[64], szName[32], szChannel[32]

get_user_name(idszName32-1)
get_msg_arg_string(4szArgs64-1)
get_msg_arg_string(2szChannel32-1)

if(
equal(szChannel"#Cstrike_Chat_All"16))
{
format(sBuffer191"%s %c%s %c%s: %s"stats_prefix[is_user_alive(id) ? Ualive:Udead],
'^x04'prefix'^x01'szNameszArgs)
}
else
{
format(sBuffer191"%s %c%s %c%s %c%s: %s"stats_prefix[is_user_alive(id) ? Ualive:Udead],
'^x03'team_prefix[get_user_team(id)], '^x04'prefix'^x01'szNameszArgs)
}

add(sMsg191sBuffer)
set_msg_arg_string(2sMsg)



YamiKaitou 12-18-2014 11:56

Re: format [Problem]
 
Where is the rest of the code?

Natsheh 12-18-2014 11:57

Re: format [Problem]
 
Quote:

Originally Posted by YamiKaitou (Post 2236834)
Where is the rest of the code?

i updated it take a look

Natsheh 12-18-2014 12:36

Re: format [Problem]
 
Fixed :SSS

PHP Code:


public vip_cmd_saytext(msgidmsgdestid)
{
    if(
/*!is_user_vip(id) && */!is_user_connected(id)) return
    
    new 
sMsg[192], sBuffer[192], szArgs[64], szName[32], szChannel[32]
    
    
get_user_name(idszName32-1)
    
get_msg_arg_string(4szArgs64-1)
    
get_msg_arg_string(2szChannel32-1)
    
    if(
equal(szChannel"#Cstrike_Chat_All"16))
    {
        
format(sBuffer191"%s %c%s %c%s%c: %c%s"stats_prefix[is_user_alive(id) ? Ualive:Udead],
        
'^x04'prefix'^x01'szName'^x03''^x01'szArgs)
    }
    else
    {
        
format(sBuffer191"%s %c%s %c%s %c%s%c: %c%s"stats_prefix[is_user_alive(id) ? Ualive:Udead],
        
'^x03'team_prefix[get_user_team(id)], '^x04'prefix'^x01'szName'^x03''^x01'szArgs)
    }
    
    
add(sMsg191"^x01")
    
add(sMsg191sBuffer)
    
set_msg_arg_string(2sMsg)



Kuma77 12-20-2014 10:54

Re: format [Problem] ( Solved )
 
Why you dont show us what is problem and how it is sloved to make people benefit


All times are GMT -4. The time now is 15:26.

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