Creating a stock of offline ban
#7

The code will not compile as the first parameter of function offlineban takes a string (player's name) as argument but in the function itself, you have it as integer and have variables for it. This will not work for offline, here is what you should do:
  • Execute a SELECT query to fetch the last ip used by the said player and pass in mysql_tquery callback parameters (admin's name, reason)
    • No rows? Player does not exist in database
    • Rows found? Retrieve ip, format a new query with all the information you now have and execute the INSERT query.
Before doing anything of it, pass the player's name in sscanf to check if the player is online and inform admins to use the normal commands to avoid more job than really needed.

Your sscanf specifiers are also wrong. You never store to ban_reason or ban_time.
Reply


Messages In This Thread
Creating a stock of offline ban - by Zeus666 - 20.09.2018, 15:10
Re: Creating a stock of offline ban - by v1k1nG - 20.09.2018, 15:21
Re: Creating a stock of offline ban - by Zeus666 - 20.09.2018, 15:42
Re: Creating a stock of offline ban - by UFF - 20.09.2018, 16:07
Re: Creating a stock of offline ban - by solstice_ - 20.09.2018, 16:10
Re: Creating a stock of offline ban - by Zeus666 - 20.09.2018, 16:47
Re: Creating a stock of offline ban - by Calisthenics - 20.09.2018, 17:31

Forum Jump:


Users browsing this thread: 1 Guest(s)