thus aint wurk
#1

Hey guys, i wanted to limit registrations to max 3 accounts on 1 IP, so i wrote this check,
Код:
		new pIP[16];
		GetPlayerIp(playerid, pIP, sizeof(pIP));
		mysql_format(mysql, query, sizeof(query), "SELECT * FROM `players` WHERE `IP` = '%s'", pIP);
		mysql_tquery(mysql, query, "", "");
		new numrows = cache_num_rows();
		if(numrows >= 3) return SendClientMessage(playerid, COLOR_WHITE, "{ff387a}[Server]:{ffffff} You have reached the max registered accounts on this IP, please use your previous account.");
However its not working, i placed this at OnPlayerConnect
Reply
#2

That is not how threaded queries work(mysql_tquery).

pawn Код:
new pIP[16];
        GetPlayerIp(playerid, pIP, sizeof(pIP));
        mysql_format(mysql, query, sizeof(query), "SELECT * FROM `players` WHERE `IP` = '%s'", pIP);
        mysql_tquery(mysql, query, "OnRegistrationCheck", "d", playerid);
pawn Код:
forward OnRegistrationCheck(playerid);
public OnRegistrationCheck(playerid)
{
      if(cache_get_row_count() >= 3) return SendClientMessage(playerid, COLOR_WHITE, "{ff387a}[Server]:{ffffff} You have reached the max registered accounts on this IP, please use your previous account.");
   
      // put the rest of the code here
      return 1;
}
Reply
#3

So, i have to forward it?
where would i place the actual query now?
Reply
#4

You leave the format and query at the same spot. However, you check the amount of rows returned inside the public.
Reply
#5

This is not working. i've tried it all possible ways.
Reply
#6

Anyone any idea on how to fix this issue,
I tried some stuff but it just aint working unfortunately.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)