AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Plugin to show owner (https://forums.alliedmods.net/showthread.php?t=220887)

m.touqeerafzal 07-15-2013 12:16

Plugin to show owner
 
can any one plz help me out.......:cry:

i want a plugin of amxmodx for cs1.6 which shows the name of owner when client says "/owner"



i tried some code but it did'nt work.... i did't know this pawn language :@



#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <fun>
static const COLOR[] = "^x04"
new gmsgSayText
gmsgSayText = get_user_msgid("SayText")

public plugin_init()
{
register_plugin("Show Owner", "1.0", "Mirxa TouQeer")

register_clcmd("say /owner", "show_owner")
//register_clcmd("say /restartscore", "reset_score")
//register_clcmd("say /rs", "reset_score")

}

public show_owner(user)
{

new len
len = format(message, 255, "%s Owner: ",COLOR)
print_message(user,message)


}

print_message(id, msg[]) {
message_begin(MSG_ONE, gmsgSayText, {0,0,0}, id)
write_byte(id)
write_string(msg)
message_end()
}






plzz help me........

devilicioux 07-15-2013 12:25

Re: Plugin to show owner
 
Replace the Owner's name with whatever you want to.The Code Dispays a Message at every round start Type /owner to see who is the owner :) .. If you want to disable that .. Just
Comment out register_event("HLTV", "event_round_start", "a", "1=0", "2=0")
like
//register_event("HLTV", "event_round_start", "a", "1=0", "2=0")
in plugin_init()
Hope I Helped :)

PHP Code:

#include <amxmodx>
#include <amxmisc>

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

new g_maxplayers

public plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)    
    
register_clcmd"say /owner""ClientCommand" );
    
register_clcmd"say_team /owner""ClientCommand" );
    
    
register_event("HLTV""event_round_start""a""1=0""2=0")
 
g_maxplayers get_maxplayers()
    
}

public 
ClientCommand(id)
{
colored_print(id"^x04 OWNER_NAME ^x03 is the Owner Of The Server :)")        //<-- 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 MeRcyLeZZ
colored_print(target, const message[], any:...)
{
    static 
buffer[512], iargscountg_msgSayText
    argscount 
numargs()
    
g_msgSayText get_user_msgid("SayText")
    
    
// Send to everyone
    
if (!target)
    {
        static 
player
        
for (player 1player <= g_maxplayersplayer++)
        {
            
// 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 (2argscounti++)
            {
                if (
getarg(i) == LANG_PLAYER)
                {
                    
setarg(i0player)
                    
changed[changedcount] = i
                    changedcount
++
                }
            }
            
            
// Format message for player
            
vformat(buffercharsmax(buffer), message3)
            
            
// Send it
            
message_begin(MSG_ONE_UNRELIABLEg_msgSayText_player)
            
write_byte(player)
            
write_string(buffer)
            
message_end()
            
            
// Replace back player id's with LANG_PLAYER
            
for (0changedcounti++)
                
setarg(changed[i], 0LANG_PLAYER)
        }
    }
    
// Send to specific target
    
else
    {
        
// Format message for player
        
vformat(buffercharsmax(buffer), message3)
        
        
// Send it
        
message_begin(MSG_ONEg_msgSayText_target)
        
write_byte(target)
        
write_string(buffer)
        
message_end()
    }



m.touqeerafzal 07-15-2013 12:35

Re: Plugin to show owner
 
thanx broooo :)

i'm just loving it.... <3 <3

just need little bit changes in format.... i'll try it myself.....

if there is problem then i'll ask u again......

once again thank u sooooooo much

i was in search of this plugin since a month ago....

thanxxxxx :)

devilicioux 07-15-2013 12:43

Re: Plugin to show owner
 
Anytime .. Sure thing. Glad I helped :)

Quote:

Originally Posted by m.touqeerafzal (Post 1991432)
thanx broooo :)

i'm just loving it.... <3 <3

just need little bit changes in format.... i'll try it myself.....

if there is problem then i'll ask u again......

once again thank u sooooooo much

i was in search of this plugin since a month ago....

thanxxxxx :)



All times are GMT -4. The time now is 06:25.

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