Raised This Month: $ Target: $400
 0% 

Plugin {connect announcer}


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
akaddict
Junior Member
Join Date: Mar 2007
Old 05-29-2007 , 18:50   Plugin {connect announcer}
Reply With Quote #1

Well my friend added some /rank features in it, when he added the /rank it changed the way it worked. Now when the people actually connect to server it shows up i want it like the old way when they just joined it. Hope you understand what im saying heres the code:


Code:
 
#include <amxmodx>
#include <csx>
 
#define PLUGIN "Connect Announce"
#define VERSION "0.2"
#define AUTHOR "v3x"
new g_iMsgSayText, g_szSoundFile[] = "buttons/blip1.wav";
 
public plugin_init()
{
    register_plugin(PLUGIN, VERSION, AUTHOR);
    g_iMsgSayText = get_user_msgid("SayText");
}
 
public plugin_precache()
{
    precache_sound(g_szSoundFile);
}
 
public client_putinserver(id)
{
    set_task(0.5, "client_joined", id);
}
public client_joined(id)
{
    if(is_user_bot(id))
    {
        return PLUGIN_CONTINUE;
    }
 
    new szUserName[33];
    get_user_name(id, szUserName, 32);
 
    new szAuthID[33];
    get_user_authid(id, szAuthID, 32);
 
    new izStats[8], izBody[8];
    new iRankPos = get_user_stats(id, izStats, izBody);
    new iRankMax = get_statsnum();    
    new iPlayers[32], iNum, i;
    get_players(iPlayers, iNum);
    for(i = 0; i <= iNum; i++)
    {
        new x = iPlayers[i];
 
        if(!is_user_connected(x) || is_user_bot(x))
        {
            continue;
        }
 
        client_cmd(x, "spk %s", g_szSoundFile);
 
        new szMessage[164];
        format(szMessage, 163, "^x04%s (^x01%s^x04) connected ^x01(RANK: %d of %d)", szUserName, szAuthID, iRankPos, iRankMax);
 
        message_begin(MSG_ONE, g_iMsgSayText, {0,0,0}, x);
        write_byte(x);
        write_string(szMessage);
        message_end();
    }
 
    return PLUGIN_CONTINUE;
}
akaddict is offline
v3x
Veteran Member
Join Date: Oct 2004
Location: US
Old 05-29-2007 , 20:01   Re: Plugin {connect announcer}
Reply With Quote #2

What do you mean by "it changed the way it worked?"

I'd move this to Scripting Help if I still could.
__________________
What am I doing these days? Well, I run my own Rust server. It's heavily modded. If you'd like to join, the ip is 167.114.101.67:28116

I also created a website called Rust Tools. It will calculate and tell you the raw amounts of resources needed to craft items.
v3x is offline
Hawk552
AMX Mod X Moderator
Join Date: Aug 2005
Old 05-29-2007 , 20:04   Re: Plugin {connect announcer}
Reply With Quote #3

Quote:
Originally Posted by v3x View Post
I'd move this to Scripting Help if I still could.
Done.
__________________
Hawk552 is offline
Send a message via AIM to Hawk552
v3x
Veteran Member
Join Date: Oct 2004
Location: US
Old 05-29-2007 , 21:49   Re: Plugin {connect announcer}
Reply With Quote #4

I get what you're talking about now that you explained it via PM.

Just replace client_putinserver with client_connect. client_putinserver is called when the player is initialized in the game.
__________________
What am I doing these days? Well, I run my own Rust server. It's heavily modded. If you'd like to join, the ip is 167.114.101.67:28116

I also created a website called Rust Tools. It will calculate and tell you the raw amounts of resources needed to craft items.
v3x 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 10:44.


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