Raised This Month: $51 Target: $400
 12% 

Solved [CSGO] Trying to edit an Chat Tags


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
PorcusorulMagic
Member
Join Date: Dec 2018
Location: Romania
Old 03-23-2019 , 03:33   [CSGO] Trying to edit an Chat Tags
Reply With Quote #1

Hello.
https://forums.alliedmods.net/showthread.php?t=303620
I tried to edit this plugin , but i failed.. did nothing...

PHP Code:
#define PLUGIN_VERSION   "1.0"

public Plugin:myinfo = {
    
name "",
    
author "",
    
description "",
    
version PLUGIN_VERSION,
    
url ""
};

public 
OnPluginStart() 
{
    
AddCommandListener(SayHook"say");   
}

public 
Action:SayHook(client, const String:command[], args)  
{

        new 
String:szText[256];
        
GetCmdArg(1szTextsizeof(szText));
        
        if ( (
GetUserFlagBits client ) & ADMFLAG_ROOT )) {
        if(
IsClientInGame(client)) 
        {
            
PrintToChatAll("★ \x05[\x04Founder\x05] \x07%N : \x01%s"clientszText);
            return 
Plugin_Handled;
        }
        }
        else if ( (
GetUserFlagBits client ) & ADMFLAG_RESERVATION )) {
        if(
IsClientInGame(client)) 
        {
            
PrintToChatAll("★ \x05[\x02V\x03I\x04P\x05] \x07%N : \x01%s"clientszText);
            return 
Plugin_Handled;
        }      
        }
    
    return 
Plugin_Continue;

What have I do wrong?
__________________
Steam - https://steamcommunity.com/id/porcusorulmagic
Discord - PorcusorulMagic#4908

Last edited by PorcusorulMagic; 03-23-2019 at 13:48. Reason: Solved
PorcusorulMagic is offline
impossible_cc
Senior Member
Join Date: Sep 2018
Location: Ukraine
Old 03-23-2019 , 04:11   Re: [CSGO] Trying to edit an Chat Tags
Reply With Quote #2

Quote:
Originally Posted by PorcusorulMagic View Post
Hello.
https://forums.alliedmods.net/showthread.php?t=303620
I tried to edit this plugin , but i failed.. did nothing...

PHP Code:
#define PLUGIN_VERSION   "1.0"

public Plugin:myinfo = {
    
name "",
    
author "",
    
description "",
    
version PLUGIN_VERSION,
    
url ""
};

public 
OnPluginStart() 
{
    
AddCommandListener(SayHook"say");   
}

public 
Action:SayHook(client, const String:command[], args)  
{

        new 
String:szText[256];
        
GetCmdArg(1szTextsizeof(szText));
        
        if ( (
GetUserFlagBits client ) & ADMFLAG_ROOT )) {
        if(
IsClientInGame(client)) 
        {
            
PrintToChatAll("★ \x05[\x04Founder\x05] \x07%N : \x01%s"clientszText);
            return 
Plugin_Handled;
        }
        }
        else if ( (
GetUserFlagBits client ) & ADMFLAG_RESERVATION )) {
        if(
IsClientInGame(client)) 
        {
            
PrintToChatAll("★ \x05[\x02V\x03I\x04P\x05] \x07%N : \x01%s"clientszText);
            return 
Plugin_Handled;
        }      
        }
    
    return 
Plugin_Continue;

What have I do wrong?
Any compile errors?
Or log errors?
__________________

Last edited by impossible_cc; 03-23-2019 at 04:14.
impossible_cc is offline
PorcusorulMagic
Member
Join Date: Dec 2018
Location: Romania
Old 03-23-2019 , 04:17   Re: [CSGO] Trying to edit an Chat Tags
Reply With Quote #3

Quote:
Originally Posted by impossible_cc View Post
Any compile errors?
Or log errors?
PHP Code:
//// tags-custom.sp
//
// tags-custom.sp(38) : warning 217: loose indentation
// Code size:             6612 bytes
// Data size:             2800 bytes
// Stack/heap size:      16384 bytes
// Total requirements:   25796 bytes
//
// 1 Warning.
//
// Compilation Time: 0,19 sec 
__________________
Steam - https://steamcommunity.com/id/porcusorulmagic
Discord - PorcusorulMagic#4908
PorcusorulMagic is offline
CowGod
Senior Member
Join Date: Feb 2015
Old 03-23-2019 , 04:25   Re: [CSGO] Trying to edit an Chat Tags
Reply With Quote #4

It still compiled, loose indentation is just a warning and will not effect anything.
CowGod is offline
Send a message via Skype™ to CowGod
PorcusorulMagic
Member
Join Date: Dec 2018
Location: Romania
Old 03-23-2019 , 04:26   Re: [CSGO] Trying to edit an Chat Tags
Reply With Quote #5

Quote:
Originally Posted by CowGod View Post
It still compiled, loose indentation is just a warning and will not effect anything.
Yes , i compiled it , but it doesn't work... i don't have any Tag near my name or color or something.
__________________
Steam - https://steamcommunity.com/id/porcusorulmagic
Discord - PorcusorulMagic#4908
PorcusorulMagic is offline
adma
Senior Member
Join Date: Oct 2015
Old 03-23-2019 , 08:05   Re: [CSGO] Trying to edit an Chat Tags
Reply With Quote #6

A few things
1. Fix dat syntax
2. Fix dat indentation
3. The IsClientInGame check probably isn't needed
3. Use GetCmdArgString instead of GetCmdArg, as GetCmdArgString will retrieve the whole text

PHP Code:
#define PLUGIN_VERSION   "1.0" 

public Plugin myinfo = { 
  
name ""
  
author ""
  
description ""
  
version PLUGIN_VERSION
  
url "" 
}; 

public 
void OnPluginStart() {
  
AddCommandListener(SayHook"say");


public 
Action SayHook(int iClient, const char[] szCommandint iNumArgs) {
  
int iFlagBits GetUserFlagBits(iClient);

  static 
char szText[256];
  
GetCmdArgString(szTextsizeof(szText));

  if (
iFlagBits ADMFLAG_ROOT) {
    
PrintToChatAll("★ \x05[\x04Founder\x05] \x07%N : \x01%s"iClientszText);
    return 
Plugin_Handled;
  } else if (
iFlagBits ADMFLAG_RESERVATION) {
    
PrintToChatAll("★ \x05[\x02V\x03I\x04P\x05] \x07%N : \x01%s"iClientszText); 
    return 
Plugin_Handled;
  }

  return 
Plugin_Continue

adma is offline
PorcusorulMagic
Member
Join Date: Dec 2018
Location: Romania
Old 03-23-2019 , 09:17   Re: [CSGO] Trying to edit an Chat Tags
Reply With Quote #7

Quote:
Originally Posted by adma View Post
A few things
1. Fix dat syntax
2. Fix dat indentation
3. The IsClientInGame check probably isn't needed
3. Use GetCmdArgString instead of GetCmdArg, as GetCmdArgString will retrieve the whole text

PHP Code:
#define PLUGIN_VERSION   "1.0" 

public Plugin myinfo = { 
  
name ""
  
author ""
  
description ""
  
version PLUGIN_VERSION
  
url "" 
}; 

public 
void OnPluginStart() {
  
AddCommandListener(SayHook"say");


public 
Action SayHook(int iClient, const char[] szCommandint iNumArgs) {
  
int iFlagBits GetUserFlagBits(iClient);

  static 
char szText[256];
  
GetCmdArgString(szTextsizeof(szText));

  if (
iFlagBits ADMFLAG_ROOT) {
    
PrintToChatAll("★ \x05[\x04Founder\x05] \x07%N : \x01%s"iClientszText);
    return 
Plugin_Handled;
  } else if (
iFlagBits ADMFLAG_RESERVATION) {
    
PrintToChatAll("★ \x05[\x02V\x03I\x04P\x05] \x07%N : \x01%s"iClientszText); 
    return 
Plugin_Handled;
  }

  return 
Plugin_Continue

It works , thank you , but i have another problem. When i type something reply with quatation mark (" ")

Example: ★ [Founder] PorcusorulMagic NXS.RO : "test"

And how can i put tags for scoreboard?
__________________
Steam - https://steamcommunity.com/id/porcusorulmagic
Discord - PorcusorulMagic#4908

Last edited by PorcusorulMagic; 03-23-2019 at 09:28.
PorcusorulMagic is offline
adma
Senior Member
Join Date: Oct 2015
Old 03-23-2019 , 09:35   Re: [CSGO] Trying to edit an Chat Tags
Reply With Quote #8

Put StripQuotes(szText); below GetCmdArgString(szText, sizeof(szText);

I'm unsure what you mean by 'tags for scoreboard'. I have added you on Steam though, I will help you out.
adma is offline
PorcusorulMagic
Member
Join Date: Dec 2018
Location: Romania
Old 03-23-2019 , 13:37   Re: [CSGO] Trying to edit an Chat Tags
Reply With Quote #9

Quote:
Originally Posted by adma View Post
Put StripQuotes(szText); below GetCmdArgString(szText, sizeof(szText);

I'm unsure what you mean by 'tags for scoreboard'. I have added you on Steam though, I will help you out.
Mark this topic as Solved. Thank you all!
__________________
Steam - https://steamcommunity.com/id/porcusorulmagic
Discord - PorcusorulMagic#4908
PorcusorulMagic is offline
impossible_cc
Senior Member
Join Date: Sep 2018
Location: Ukraine
Old 03-23-2019 , 13:42   Re: [CSGO] Trying to edit an Chat Tags
Reply With Quote #10

You can mark it as solved.
Press 'Edit' on your first message twice, then set prefix 'Solved'
__________________
impossible_cc is offline
Reply



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 12:18.


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