Auto Ip Kick Plugin
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>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. |
Re: Auto Ip Kick Plugin
It didnt work if making
Code:
if get_user_ip(id) == 123.123.123.123) |
Re: Auto Ip Kick Plugin
PHP Code:
|
Re: Auto Ip Kick Plugin
Ok, so I edited it to make it kick by steamid. Now I put my steamid as the cvar, but whenever the round starts, I don't get kicked. I'm pretty sure It has to do something with the arrays firstid and authid, but I don't know what's wrong.
Code:
#include <amxmodx> |
Re: Auto Ip Kick Plugin
I just look up at the code very quickly but if you want to compare strings you need to use
equal/equali PHP Code:
|
Re: Auto Ip Kick Plugin
Are you allowed to use the or operator when using equali?
If so, would it be like this? Code:
if(equali(a,b) || equali(c,d) || equali(e,f)) |
Re: Auto Ip Kick Plugin
Quote:
"i" means case insensitive. You need to realize that your cvars are strings, not numbers. I would suggest that you write tbe plugin without any cvars first. Get it working with a single SteamID: new const szSteamID[] = "STEAM_0:0:1234". When you get it working with one SteamID then you can expand it to more and I would not recommend cvars either. Quote:
|
Re: Auto Ip Kick Plugin
I got it to kick myself with steamid, with the steamid placed as a const. Could someone show me how I would make it be read from a text file (the steamids)?
|
Re: Auto Ip Kick Plugin
Now that you have it working with one SteamID you should first make it work with several SteamIDs using:
PHP Code:
|
Re: Auto Ip Kick Plugin
I got it to work using a file, but it only reads the first line. I used fgets.
|
| All times are GMT -4. The time now is 00:07. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.