16.07.2011, 11:06
Nice One man
Player Admin Reason Time Time Left JaTochNietDan Stumpy Deathmatching 2011-07-15 04:12:10 -2,174
It's probably this problem:
https://sampforum.blast.hk/showthread.php?tid=268432 I had it with my MySQL ban system too. |
Ehm when i include this in my script, i can't start up my server, and when i look inside the inlclude i notice that you have J_sscanf defined in a stock.
But i'm already using sscanf sow could you explain what J_sscanf is? |
I'll have to investigate further, it really doesn't make any sense that it would do that.
j_sscanf is just sscanf, I'm not using a compiler if statement to check if it is already included because there wouldn't be a way of recognizing if it's the plugin version or the include version and they both have different syntax so it would cause problems with the script if you were using the plugin version with it. If your server shuts down on start up, it's most likely caused by the script not being able to connect to the MySQL server, check the details in the include and enable logging so you can see what the last print was in the console, it would not be caused by a stock function, if it was the stock function causing a problem, you would notice that immediately on compilation. |
BanID int(6) No None auto_increment
user_banned varchar(24) latin1_swedish_ci No None
user_banned_ip varchar(15) latin1_swedish_ci No None
user_banner varchar(24) latin1_swedish_ci No None
ban_reason varchar(40) latin1_swedish_ci No None
ban_timestamp timestamp on update CURRENT_TIMESTAMP No CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP
ban_time int(10)
COMMAND:ban(playerid, params[]) { if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, COLOR_RED, "[jBan]: You need to be logged in as an RCON administrator to perform this!"); if(j_sscanf(params, "usi", ban_target, ban_reason, ban_time)) return SendClientMessage(playerid, COLOR_RED, "[jBan]: Correct usage -> /ban <player> <reason> <time (minutes)>"); //>>> if(!IsPlayerConnected(ban_target)) return SendClientMessage(playerid, COLOR_RED, "[jBan]: Player was not found!"); if(ban_time < 0) SendClientMessage(playerid, COLOR_RED, "[jBan]: Please input a valid ban time!"); jBan(ban_target, playerid, ban_reason, ban_time); return 1; }
Hi. First of all, thank you for this nice ban system. I have done everything ok, it says the connection to mysql server has succeeded, but when I enter in game it says: "[jBan]: You have an existing ban from "" for "", it will expire in 0 minutes!", why?
|
if(mysql_num_rows() != 0)
if(mysql_num_rows() > 0)
Nice, gonna use this.
But can you explain native jUnbanIP(IP[], bool:expired = false); a little more and give an example how to use it and what it does. |