SA-MP Forums Archive
news - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: news (/showthread.php?tid=443586)



news - audriuxxx - 12.06.2013

Hi,

I want to ask, i have like that:

Код:
new ALLPLAYERS = ReturnUserCount( );
Код:
stock ReturnUserCount()
{
	mysql_free_result( );
    mysql_query("SELECT Vardas FROM players");
    mysql_store_result();
    new users = mysql_num_rows();
    mysql_free_result();
    return users;
}
When i use this in my code, like in command

new ALLPLAYERS = ReturnUserCount( );

Does, returnusercount will be called, or i have to use ALLPLAYERS in anywhere, then all scripts in that stock will be called?


Re: news - park4bmx - 12.06.2013

you cant do that, it will probably crash!
you need to define the sizeof it as it has to hold a string also you need to use it under On-Gm/Fs-Init
to have the effect you want!


Re: news - Scenario - 12.06.2013

Look into the COUNT MySQL query.