This site is a testing version, but all data is shared with the live forum.


Raised This Month: $ Target: $400
 0% 

Owner Show


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
bakugan
Member
Join Date: Dec 2023
Location: Bulgaria
Old 04-21-2024 , 07:37   Owner Show
Reply With Quote #1

Can you tell me where my mistake is?



Code:
Code:
//
// AMX Mod X, based on AMX Mod by Harvey Williams ("HarveyWNvm").
// Copyright (C) The AMX Mod X Development Team.
//
// This software is licensed under the GNU General Public License, version 3 or higher.
// Additional exceptions apply. For full license details, see LICENSE.txt or visit:
//    http://gameservers.rf.gd/forum/viewtopic.php?f=13&t=23&sid=f118bd9f95bcae808616ce98ebea4e20


#include <amxmodx>
#include <fun>
#include <engine>
#include <cstrike>


#define PLUGIN  "Show Owner"
#define VERSION  "2.1"
#define AUTHOR  "HarveyWNvm LLC."


new g_maxplayers

public plugin_init() {
    register_plugin(PLUGIN, VERSION, AUTHOR)    
    register_clcmd( "say /owner", "ClientCommand" );
    register_clcmd( "say_team /owner", "ClientCommand" );
    
    register_event("HLTV", "event_round_start", "l", "1=0", "2=0")
 g_maxplayers = get_maxplayers()
    
}

public ClientCommand(id)
{
colored_print(id, "^x04 Owner Server List: ^x03 by nFL // BaKuGan. [c], fOrest,")        //<-- Replace OWNER_NAME with the Whatever the owners name is.
}

public event_round_start()
{
colored_print(0, "^x04Type ^x03 ^"/owner^" ^x04 to see who is the owner :)")
}

// Colored print by HarveyWNvm
colored_print(target, const message[], any:...)
{
    static buffer[512], i, argscount, g_msgSayText
    argscount = numargs()
    g_msgSayText = get_user_msgid("SayText")
    
    // Send to everyone
    if (!target)
    {
        static player
        for (player = 1; player <= g_maxplayers; player++)
        {
            // Not connected
            if (!is_user_connected(player))
                continue;
            
            // Remember changed arguments
            static changed[5], changedcount // [5] = max LANG_PLAYER occurencies
            changedcount = 0
            
            // Replace LANG_PLAYER with player id
            for (i = 2; i < argscount; i++)
            {
                if (getarg(i) == LANG_PLAYER)
                {
                    setarg(i, 0, player)
                    changed[changedcount] = i
                    changedcount++
                }
            }
            
            // Format message for player
            vformat(buffer, charsmax(buffer), message, 3)
            
            // Send it
            message_begin(MSG_ONE_UNRELIABLE, g_msgSayText, _, player)
            write_byte(player)
            write_string(buffer)
            message_end()
            
            // Replace back player id's with LANG_PLAYER
            for (i = 0; i < changedcount; i++)
                setarg(changed[i], 0, LANG_PLAYER)
        }
    }
    // Send to specific target
    else
    {
        // Format message for player
        vformat(buffer, charsmax(buffer), message, 3)
        
        // Send it
        message_begin(MSG_ONE, g_msgSayText, _, target)
        write_byte(target)
        write_string(buffer)
        message_end()
    }
__________________
WebSite
bakugan is offline
tedaimlocks
Member
Join Date: Jan 2024
Old 04-21-2024 , 07:53   Re: Owner Show
Reply With Quote #2

HTML Code:
#include <amxmodx>
#include <colorchat>

#define PLUGIN "Show Owner"
#define VERSION "1.0"
#define AUTHOR "tedaimlocks"

public plugin_init() {
	register_plugin(PLUGIN, VERSION, AUTHOR)
        register_logevent("logevent_RoundStart", 2, "1=Round_Start");
	register_clcmd("say /owner", "ShowOwner")
	register_clcmd("say_team /owner", "ShowOwner")
}

public logevent_RoundStart()
	set_task(1.0, "ShowOwner");

public ShowOwner() {
    ColorChat(0, GREEN, "^x04Server Owners are: ^x03nFL // BaKuGan. [c], fOrest")
}

Last edited by tedaimlocks; 04-21-2024 at 08:03.
tedaimlocks is offline
bakugan
Member
Join Date: Dec 2023
Location: Bulgaria
Old 04-21-2024 , 07:59   Re: Owner Show
Reply With Quote #3

Quote:
Originally Posted by tedaimlocks View Post
HTML Code:
#include <amxmodx>
#include <colorchat>

#define PLUGIN "Show Owner"
#define VERSION "1.0"
#define AUTHOR "tedaimlocks"

public plugin_init() {
	register_plugin(PLUGIN, VERSION, AUTHOR)
        register_logevent("logevent_RoundStart", 2, "1=Round_Start");
	register_clcmd("say /owner", "ShowOwner")
	register_clcmd("say_team /owner", "ShowOwner")
}

public logevent_RoundStart()
	set_task(1.0, "ShowOwner");

public ShowOwner(id) {
    ColorChat(0, GREEN, "^x04Server Owners are: ^x03nFL // BaKuGan. [c], fOrest")
}
Why on earth does everything have to be calculated since I have a custom made plugin? Just to fix the error from the side, I don't need a new plugin
__________________
WebSite
bakugan is offline
tedaimlocks
Member
Join Date: Jan 2024
Old 04-21-2024 , 08:05   Re: Owner Show
Reply With Quote #4

Because ur plugin is coded messy af and you can make it in just 5 lines not 100 lines
tedaimlocks is offline
tedaimlocks
Member
Join Date: Jan 2024
Old 04-21-2024 , 08:07   Re: Owner Show
Reply With Quote #5

HTML Code:
#include <amxmodx>
#include <fun>
#include <engine>
#include <cstrike>


#define PLUGIN  "Show Owner"
#define VERSION  "2.1"
#define AUTHOR  "HarveyWNvm LLC."


new g_maxplayers

public plugin_init() {
    register_plugin(PLUGIN, VERSION, AUTHOR)    
    register_clcmd( "say /owner", "ClientCommand" );
    register_clcmd( "say_team /owner", "ClientCommand" );
    
    register_event("HLTV", "event_round_start", "l", "1=0", "2=0")
    g_maxplayers = get_maxplayers()
    
}

public ClientCommand(id)
{
colored_print(id, "^x04 Owner Server List: ^x03 by nFL // BaKuGan. [c], fOrest,")        //<-- Replace OWNER_NAME with the Whatever the owners name is.
}

public event_round_start()
{
colored_print(0, "^x04Type ^x03 ^"/owner^" ^x04 to see who is the owner :)")
}

// Colored print by HarveyWNvm
colored_print(target, const message[], any:...)
{
    static buffer[512], i, argscount, g_msgSayText
    argscount = numargs()
    g_msgSayText = get_user_msgid("SayText")
    
    // Send to everyone
    if (!target)
    {
        static player
        for (player = 1; player <= g_maxplayers; player++)
        {
            // Not connected
            if (!is_user_connected(player))
                continue;
            
            // Remember changed arguments
            static changed[5], changedcount // [5] = max LANG_PLAYER occurencies
            changedcount = 0
            
            // Replace LANG_PLAYER with player id
            for (i = 2; i < argscount; i++)
            {
                if (getarg(i) == LANG_PLAYER)
                {
                    setarg(i, 0, player)
                    changed[changedcount] = i
                    changedcount++
                }
            }
            
            // Format message for player
            vformat(buffer, charsmax(buffer), message, 3)
            
            // Send it
            message_begin(MSG_ONE_UNRELIABLE, g_msgSayText, _, player)
            write_byte(player)
            write_string(buffer)
            message_end()
            
            // Replace back player id's with LANG_PLAYER
            for (i = 0; i < changedcount; i++)
                setarg(changed[i], 0, LANG_PLAYER)
        }
    }
    // Send to specific target
    else
    {
        // Format message for player
        vformat(buffer, charsmax(buffer), message, 3)
        
        // Send it
        message_begin(MSG_ONE, g_msgSayText, _, target)
        write_byte(target)
        write_string(buffer)
        message_end()
    }
}
tedaimlocks is offline
bakugan
Member
Join Date: Dec 2023
Location: Bulgaria
Old 04-21-2024 , 08:36   Re: Owner Show
Reply With Quote #6

Quote:
Originally Posted by tedaimlocks View Post
HTML Code:
#include <amxmodx>
#include <fun>
#include <engine>
#include <cstrike>


#define PLUGIN  "Show Owner"
#define VERSION  "2.1"
#define AUTHOR  "HarveyWNvm LLC."


new g_maxplayers

public plugin_init() {
    register_plugin(PLUGIN, VERSION, AUTHOR)    
    register_clcmd( "say /owner", "ClientCommand" );
    register_clcmd( "say_team /owner", "ClientCommand" );
    
    register_event("HLTV", "event_round_start", "l", "1=0", "2=0")
    g_maxplayers = get_maxplayers()
    
}

public ClientCommand(id)
{
colored_print(id, "^x04 Owner Server List: ^x03 by nFL // BaKuGan. [c], fOrest,")        //<-- Replace OWNER_NAME with the Whatever the owners name is.
}

public event_round_start()
{
colored_print(0, "^x04Type ^x03 ^"/owner^" ^x04 to see who is the owner :)")
}

// Colored print by HarveyWNvm
colored_print(target, const message[], any:...)
{
    static buffer[512], i, argscount, g_msgSayText
    argscount = numargs()
    g_msgSayText = get_user_msgid("SayText")
    
    // Send to everyone
    if (!target)
    {
        static player
        for (player = 1; player <= g_maxplayers; player++)
        {
            // Not connected
            if (!is_user_connected(player))
                continue;
            
            // Remember changed arguments
            static changed[5], changedcount // [5] = max LANG_PLAYER occurencies
            changedcount = 0
            
            // Replace LANG_PLAYER with player id
            for (i = 2; i < argscount; i++)
            {
                if (getarg(i) == LANG_PLAYER)
                {
                    setarg(i, 0, player)
                    changed[changedcount] = i
                    changedcount++
                }
            }
            
            // Format message for player
            vformat(buffer, charsmax(buffer), message, 3)
            
            // Send it
            message_begin(MSG_ONE_UNRELIABLE, g_msgSayText, _, player)
            write_byte(player)
            write_string(buffer)
            message_end()
            
            // Replace back player id's with LANG_PLAYER
            for (i = 0; i < changedcount; i++)
                setarg(changed[i], 0, LANG_PLAYER)
        }
    }
    // Send to specific target
    else
    {
        // Format message for player
        vformat(buffer, charsmax(buffer), message, 3)
        
        // Send it
        message_begin(MSG_ONE, g_msgSayText, _, target)
        write_byte(target)
        write_string(buffer)
        message_end()
    }
}



Now as you gave the code it works but here is my result
HTML Code:
//
// AMX Mod X, based on AMX Mod by Harvey Williams ("HarveyWNvm").
// Copyright (C) The AMX Mod X Development Team.
//
// This software is licensed under the GNU General Public License, version 3 or higher.
// Additional exceptions apply. For full license details, see LICENSE.txt or visit:
//    http://gameservers.rf.gd/forum/viewtopic.php?f=13&t=23&sid=f118bd9f95bcae808616ce98ebea4e20

#include <amxmodx>
#include <fun>
#include <engine>


#define PLUGIN  "Show Owner"
#define VERSION  "2.1"
#define AUTHOR  "HarveyWNvm LLC."


new g_maxplayers

public plugin_init() {
    register_plugin(PLUGIN, VERSION, AUTHOR)    
    register_clcmd( "say /owner", "ClientCommand" );
    register_clcmd( "say_team /owner", "ClientCommand" );
    
    register_event("HLTV", "event_round_start", "l", "1=0", "2=0")
    g_maxplayers = get_maxplayers()
    
}

public ClientCommand(id)
{
colored_print(id, "^x04 Owner Server List: ^x03 by nFL // BaKuGan. [c], fOrest,")        //<-- Replace OWNER_NAME with the Whatever the owners name is.
}

public event_round_start()
{
colored_print(0, "^x04Type ^x03 ^"/owner^" ^x04 to see who is the owner :)")
}

// Colored print by HarveyWNvm
colored_print(target, const message[], any:...)
{
    static buffer[512], i, argscount, g_msgSayText
    argscount = numargs()
    g_msgSayText = get_user_msgid("SayText")
    
    // Send to everyone
    if (!target)
    {
        static player
        for (player = 1; player <= g_maxplayers; player++)
        {
            // Not connected
            if (!is_user_connected(player))
                continue;
            
            // Remember changed arguments
            static changed[5], changedcount // [5] = max LANG_PLAYER occurencies
            changedcount = 0
            
            // Replace LANG_PLAYER with player id
            for (i = 2; i < argscount; i++)
            {
                if (getarg(i) == LANG_PLAYER)
                {
                    setarg(i, 0, player)
                    changed[changedcount] = i
                    changedcount++
                }
            }
            
            // Format message for player
            vformat(buffer, charsmax(buffer), message, 3)
            
            // Send it
            message_begin(MSG_ONE_UNRELIABLE, g_msgSayText, _, player)
            write_byte(player)
            write_string(buffer)
            message_end()
            
            // Replace back player id's with LANG_PLAYER
            for (i = 0; i < changedcount; i++)
                setarg(changed[i], 0, LANG_PLAYER)
        }
    }
    // Send to specific target
    else
    {
        // Format message for player
        vformat(buffer, charsmax(buffer), message, 3)
        
        // Send it
        message_begin(MSG_ONE, g_msgSayText, _, target)
        write_byte(target)
        write_string(buffer)
        message_end()
    }
}
__________________
WebSite
bakugan 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 11:09.


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