Raised This Month: $ Target: $400
 0% 

code doesn't do anything.


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
goldenbuick707
Member
Join Date: Jun 2015
Old 06-28-2015 , 05:28   code doesn't do anything.
Reply With Quote #1

SOLVED.

Last edited by goldenbuick707; 06-30-2015 at 14:30.
goldenbuick707 is offline
Kailo
Senior Member
Join Date: Sep 2014
Location: Moscow, Russia
Old 06-28-2015 , 05:49   Re: Custom tag compile error
Reply With Quote #2

Now you defined Command_tag twice, need remove one. Nad now sm_tag command do nothing. What need do this command?

This dosen't need. RegAdminCmd() check it self.
PHP Code:
public Action Command_tag(int clientint args)
{
    if (!
CheckCommandAccess(client"sm_tag"ADMFLAG_CUSTOM5))
    {
        
ReplyToCommand(client"[CGI] %t""NO ACCESS");
        return 
Plugin_Handled;
    }

This code has no logic. In your 'Usage' you want only 1 argument, but command report 'bad arguments' if < 2.
PHP Code:
public Action Command_tag (int clientint args

    if (
args 2
    { 
        
ReplyToCommand(client"[CGI] Usage: sm_tag <tag>"); 
        return 
Plugin_Handled
    } 

I think you need this
PHP Code:
public Action Command_tag (int clientint args

    if (
GetCmdArgs() != 1
    { 
        
ReplyToCommand(client"[CGI] Usage: sm_tag <tag>"); 
        return 
Plugin_Handled
    }
    
    
char arg[65];
    
GetCmdArg(1argsizeof(arg));
    
    
// Do some actions. arg is your <tag>.
    
    
return Plugin_Handled


Last edited by Kailo; 06-28-2015 at 05:56.
Kailo is offline
goldenbuick707
Member
Join Date: Jun 2015
Old 06-28-2015 , 05:56   Re: Custom tag compile error
Reply With Quote #3

Quote:
Originally Posted by Kailo View Post
Now you defined Command_tag twice, need remove one. Nad now sm_tag command do nothing. What need do this command?

This dosen't need. RegAdminCmd() check it self.
PHP Code:
public Action Command_tag(int clientint args)
{
    if (!
CheckCommandAccess(client"sm_tag"ADMFLAG_CUSTOM5))
    {
        
ReplyToCommand(client"[CGI] %t""NO ACCESS");
        return 
Plugin_Handled;
    }

This code has no logic. In your 'Usage' you want only 1 argument, but command report 'bad arguments' if < 2.
PHP Code:
public Action Command_tag (int clientint args

    if (
args 2
    { 
        
ReplyToCommand(client"[CGI] Usage: sm_tag <tag>"); 
        return 
Plugin_Handled
    } 

I changed the "if (args <2)" to "if (args < 1),
I removed the first code you copied here,
And i got those errors:
/home/groups/sourcemod/upload_tmp/phpK99wjT.sp(2 : warning 209: function "Command_tag" should return a value
/home/groups/sourcemod/upload_tmp/phpK99wjT.sp(33) : error 017: undefined symbol "g_bIsDonator"
/home/groups/sourcemod/upload_tmp/phpK99wjT.sp(33) : warning 215: expression has no effect
/home/groups/sourcemod/upload_tmp/phpK99wjT.sp(33) : error 001: expected token: ";", but found "]"
/home/groups/sourcemod/upload_tmp/phpK99wjT.sp(33) : error 029: invalid expression, assumed zero
/home/groups/sourcemod/upload_tmp/phpK99wjT.sp(33) : fatal error 189: too many error messages on one line
goldenbuick707 is offline
KissLick
Veteran Member
Join Date: Nov 2012
Location: void
Old 06-28-2015 , 05:58   Re: Custom tag compile error
Reply With Quote #4

PHP Code:
#include <sourcemod>

public Plugin:myinfo 
{
    
name "Custom Tags",
    
author "Infection",
    
description "Change tag",
    
version "1.0",
    
url ""
}

public 
OnPluginStart()
{
    
RegAdminCmd("sm_tag"Command_tagADMFLAG_CUSTOM5)
}

public 
Action:Command_tag (int clientint args)
{
    if (
args 2// shouldn't be here (args != 1) ?
    
{
        
ReplyToCommand(client"[CGI] Usage: sm_tag <tag>");
        return 
Plugin_Handled;
    }
    
    
// player used !tag command - do something
    
    
return Plugin_Handled;
}

public 
Action:SayCallback(iClient, const String:command[], argc// where do you call this callback?
{
    if (!
iClient) return Plugin_Continue;
    if (!
g_bIsDonator[iClient]) return Plugin_Continue// where is g_bIsDonator declared?

    
decl String:szArg[255];
    
GetCmdArgString(szArgsizeof(szArg));

    
StripQuotes(szArg);
    
TrimString(szArg);

    if (
StrEqual(command"donator_tag"true))
    {
        
decl String:szTmp[256];
        if (
strlen(szArg) < 1)
        {
            
GetDonatorMessage(iClientszTmpsizeof(szTmp)); // what is GetDonatorMessage ?
            
ReplyToCommand(iClient"[CGI] Your current tag is: %s"szTmp);
        }
        else
        {
            
PrintToChat(iClient"\x01[CGI] You have sucessfully changed your tag to: \x04%s\x01"szArg);
            
SetDonatorMessage(iClientszArg); // what is SetDonatorMessage ?
        
}
    }
    
    return 
Plugin_Handled;

Kailo was faster damn! :-D

Last edited by KissLick; 06-28-2015 at 05:59.
KissLick is offline
goldenbuick707
Member
Join Date: Jun 2015
Old 06-28-2015 , 06:04   Re: Custom tag compile error
Reply With Quote #5

Quote:
Originally Posted by KissLick View Post
PHP Code:
#include <sourcemod>

public Plugin:myinfo 
{
    
name "Custom Tags",
    
author "Infection",
    
description "Change tag",
    
version "1.0",
    
url ""
}

public 
OnPluginStart()
{
    
RegAdminCmd("sm_tag"Command_tagADMFLAG_CUSTOM5)
}

public 
Action:Command_tag (int clientint args)
{
    if (
args 2// shouldn't be here (args != 1) ?
    
{
        
ReplyToCommand(client"[CGI] Usage: sm_tag <tag>");
        return 
Plugin_Handled;
    }
    
    
// player used !tag command - do something
    
    
return Plugin_Handled;
}

public 
Action:SayCallback(iClient, const String:command[], argc// where do you call this callback?
{
    if (!
iClient) return Plugin_Continue;
    if (!
g_bIsDonator[iClient]) return Plugin_Continue// where is g_bIsDonator declared?

    
decl String:szArg[255];
    
GetCmdArgString(szArgsizeof(szArg));

    
StripQuotes(szArg);
    
TrimString(szArg);

    if (
StrEqual(command"donator_tag"true))
    {
        
decl String:szTmp[256];
        if (
strlen(szArg) < 1)
        {
            
GetDonatorMessage(iClientszTmpsizeof(szTmp)); // what is GetDonatorMessage ?
            
ReplyToCommand(iClient"[CGI] Your current tag is: %s"szTmp);
        }
        else
        {
            
PrintToChat(iClient"\x01[CGI] You have sucessfully changed your tag to: \x04%s\x01"szArg);
            
SetDonatorMessage(iClientszArg); // what is SetDonatorMessage ?
        
}
    }
    
    return 
Plugin_Handled;

Kailo was faster damn! :-D
Guys can you just tell me where to fix? I
goldenbuick707 is offline
Kailo
Senior Member
Join Date: Sep 2014
Location: Moscow, Russia
Old 06-28-2015 , 06:04   Re: Custom tag compile error
Reply With Quote #6

KissLick, =)

goldenbuick707, i think also you need add this. (In start of plugin, after '#include <sourcemod>')
PHP Code:
bool g_bIsDonator[MAXPLAYERS+1]; 
But it only fix all compiler errors, but i don't think that this plugin will work correctly.

Last edited by Kailo; 06-28-2015 at 06:05.
Kailo is offline
goldenbuick707
Member
Join Date: Jun 2015
Old 06-28-2015 , 06:10   Re: Custom tag compile error
Reply With Quote #7

Quote:
Originally Posted by Kailo View Post
KissLick, =)

goldenbuick707, i think also you need add this. (In start of plugin, after '#include <sourcemod>')
PHP Code:
bool g_bIsDonator[MAXPLAYERS+1]; 
But it only fix all compiler errors, but i don't think that this plugin will work correctly.
Thanks,I sent you a private message cause i got more some errors.
goldenbuick707 is offline
goldenbuick707
Member
Join Date: Jun 2015
Old 06-28-2015 , 07:35   Re: code doesn't do anything.
Reply With Quote #8

Updated the thread, Now i didn't get errors but plugin doesn't do anything.
goldenbuick707 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 17:15.


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