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.