MySQL Adding +1
#1

Hi sorry if this has been asked before but cant find anything and searching plus one or +1 wont work in the forums search results.

Im trying to make it so i can see how many times a player has been kicked from the server
Im currently converting from ini to mysql and its going well but im stuck with adding +1 on a number in a row.

So like
If times kicked is 1 then this script adds a +1 to that making it 2

This is what iv done so far.

pawn Код:
stock ServerKick2(playerid, reason[])
{
    new string[158];
    new handle = SQL::OpenEx(SQL::READ, ""PLAYERS_TABLE"", "username", GetName(playerid));
    SQL::WriteString(handle, "LastKickReason", reason);
    SQL::WriteInt(handle, "TimesKicked", +1);
    SQL::Close(handle);
    Kick(playerid);
This was my old dini code that i used and am going off

pawn Код:
if(dini_Exists(file))
    {
        dini_Set(file, "LastKickReason", reason);
        dini_IntSet(file, "TimesKicked", (dini_Int(file, "TimesKicked") + 1));
    }
Sorry if i explaned this a bit weird. Thanks in advance.

Edit: Sorry just relised this is proberbly in the wrong section. sorry about that.
Reply


Messages In This Thread
MySQL Adding +1 - by morris91 - 30.07.2016, 20:43
Re: MySQL Adding +1 - by Konstantinos - 30.07.2016, 21:00
Re: MySQL Adding +1 - by morris91 - 30.07.2016, 22:04
Re: MySQL Adding +1 - by Vince - 30.07.2016, 22:10
Re: MySQL Adding +1 - by morris91 - 30.07.2016, 22:28
Re: MySQL Adding +1 - by Konstantinos - 30.07.2016, 23:04

Forum Jump:


Users browsing this thread: 1 Guest(s)