Raised This Month: $ Target: $400
 0% 

Auto Ip Kick Plugin


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
nikhilgupta345
Veteran Member
Join Date: Aug 2009
Location: Virginia
Old 07-22-2010 , 02:19   Auto Ip Kick Plugin
Reply With Quote #1

Im completely new at coding, been learning for about 2 days I think? Anyways, I'm trying to make a plugin where the admin sets the cvar as an ip, and then whenever someone joins with that ip, they are autokicked when the round starts. I know it basically a ban, I'm just trying to make some basic plugins. I get these errors, and I don't know how to fix them.


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

#define PLUGIN "AutoKick IP"
#define VERSION "1.0"
#define AUTHOR "H3avY Ra1n"


public plugin_init() {
    //Register Plugin
    register_plugin(PLUGIN, VERSION, AUTHOR)
    register_logevent("round_start", 2, "1=Round_Start")
    register_cvar("amx_firstip", "none")
    register_cvar("amx_secondip", "none")
    register_cvar("amx_thirdip", "none")
    register_cvar("amx_fourthip", "none")
}

public round_start()
{
    new firstip, secondip, thirdip, fourthip;
    new players[32], num, player;
    get_players(players, num);
    firstip=get_cvar_num("amx_firstip")
    secondip=get_cvar_num("amx_secondip")
    thirdip=get_cvar_num("amx_thirdip")
    fourthip=get_cvar_num("fourthip")
    for(new i; i < num; i++)
    {
        new ip[9]
        player=players[i]
        new ipnum= get_user_ip(player, ip, 9, 1);
        if(firstip=str_to_num(ipnum) ||secondip=str_to_num(ipnum) || thirdip=str_to_num(ipnum) || fourthip=str_to_num(ipnum) 
        {
        server_cmd(kick %s, player)
        }
    }
Warning: Possibly unintended assignment on line 36
Error: Must be lvalue (non-constant) on line 36
Error: Argument type mismatch (argument 1) on line 36
Error: Argument type mismatch (argument 1) on line 36
Error: Too many error messages on one line on line 36


That's the error message I get.


Also, I'm curious to know, how could I make it to read ip's from a file. Haven't learned how to have plugins read from files yet.

Last edited by nikhilgupta345; 07-22-2010 at 03:05.
nikhilgupta345 is offline
Send a message via ICQ to nikhilgupta345 Send a message via Yahoo to nikhilgupta345
 



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 00:07.


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