#1

Hi,

How to sleep your code without while? because i know when you use while for a long time, then sometimes server will be always crashed even the time will be passed...
Reply
#2

Use timer?
Reply
#3

Because i want to do, when a lot of queries is not completed, then i want to sleep my server for a while, when queries is completed then again on. I know how to check how much queries is not completed, just how well sleep your server. If with timer, please show how.
Reply
#4

I really don't understand what you're trying to say but a timer will be your best bet

pawn Код:
forward blahblah();

//Under OnGameModeInit
SetTimer("blahblah", 1000, true); //1000 Is the time (In milliseconds) and True/False repeat or not


//Anywhere
public blahblah()
{
//code here
}
Reply
#5

This timer don't sleep my server... I need a function which can sleep server like that:

Код:
new bool:TWQEWEQEWt;
while(TWQEWEQEWt==false)
{

}
If i do like that, even i have a settimer made like:


Код:
new bool:TWQEWEQEWt;


SetTimer("OFFTQWEQWE",20000,false);
while(TWQEWEQEWt==false)
{

}
Код:
forward OFFTQWEQWE( );
public OFFTQWEQWE( )
{
TWQEWEQEWt = true;
}
I make this function when player spawn for test.

But here even 20 sec. have passed code is still hang.
Reply
#6

Use mysql_query because this native sends a non-threaded query to the MySQL server. The SA:MP server (the main PAWN thread) waits until the query has been executed and then returns the cache handle.

pawn Код:
native mysql_query(conhandle, query[], bool:use_cache = true); // BlueG's R33+
Reply
#7

But know i have all make into R37, and i don't remake everything to R33 or lower...
Reply
#8

Quote:
Originally Posted by audriuxxx
Посмотреть сообщение
But know i have all make into R37, and i don't remake everything to R33 or lower...
R33+ means R33 and above. It can be used with R37 too. :facepalm:
Reply
#9

But here:

native mysql_query(conhandle, query[], bool:use_cache = true); // BlueG's R33+

Is no callback. Because in mysql_tquery you have to put a callback.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)