Raised This Month: $ Target: $400
 0% 

Kick no-steam ppl


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
regalis
Veteran Member
Join Date: Jan 2007
Location: F*cking Germany
Old 05-27-2007 , 20:25   Re: Kick no-steam ppl
Reply With Quote #3

Im bored so i fixed cheap_suit's suggestions/hints and optimized a little..
Hope that is ok ;)

The returns are strange i would return PLUGIN_HANDLED or PLUGIN_CONTINUE, but i don't know which is better so i don't touched this..0o

Code:
#include <amxmodx>
#include <amxmisc>

#define PLUGIN "Advanced Steam slot"
#define VERSION "1.0"
#define AUTHOR "Alka"

new g_maxplayers

public plugin_init()
{
    register_plugin(PLUGIN, VERSION, AUTHOR)
    g_maxplayers = get_maxplayers();
}

public client_connect(id)
{
    if(is_user_bot(id)) return 0;
    
    new players = get_playersnum(1);
    new limit = g_maxplayers - get_cvar_num("amx_reservation");
        
    if(players > limit) 
    {
        new authid[32];
        get_user_authid(id,authid,31);
        if(containi(authid,"STEAM_ID_PENDING") != -1)
        {
            player_kick();
        }
    }
    return 0;
}

public player_kick()
{
    new players[32], inum, i, player;
    get_players(players,inum);
    
    for(i = 0; i < inum; i++)
    {
        player = players[i];
        
        new authid[32];
        get_user_authid(player,authid,31);
        
        if(!equal(authid,"STEAM_ID_PENDING") && (containi(authid,"STEAM_0:0") == -1) && (containi(authid,"STEAM_0:1") == -1))
        {
            server_cmd("kick #%i A player with SteamID connected! Buy Steam for reserved slot!",get_user_userid(player));
        }
    }
    return 1;
}
greetz regalis
__________________
regalis is offline
 



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:33.


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