Is it existing? - 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: Is it existing? (
/showthread.php?tid=649648)
Is it existing? -
Davidmkd123 - 12.02.2018
Any function maybe like GetPlayerIngamePlayers() ??, or i should make it by myself?
Re: Is it existing? -
Abagail - 12.02.2018
GetPlayerIngamePlayers could be anything, the naming isn't specific at all. It could return: a string of names of connected players, connected player count, an array of player IDs connected. What are you actually trying to do?
Re: Is it existing? -
Mugala - 12.02.2018
what u're trying to make with this function? what do u want to exactly do?
Re: Is it existing? -
PepsiCola23 - 12.02.2018
You want to get the number of players online?isnt that shown when pressing TAB or simply from samp client?explaon better
Re: Is it existing? -
ChristolisTV - 12.02.2018
Well, let's suppose you want to get the
number of players online in your server:
PHP код:
stock GetOnlinePlayersNumber()
{
new res=0;
for(new j=0;j<MAX_PLAYERS;j++) if(IsPlayerConnected(j))res++; else continue;
return res;
}
//Somewhere in your code...
new str[256];
format(str,sizeof str,"We have %d/50 players online",GetOnlinePlayersNumber());
SendClientMessage(playerid,-1,str);
Re: Is it existing? -
Kane - 12.02.2018
https://sampwiki.blast.hk/wiki/GetPlayerPoolSize
Re: Is it existing? -
Mugala - 12.02.2018
Quote:
Originally Posted by Arthur Kane
|
yeah this will be better for optimize and reduce lags (not noticeable, but it really reduces

)
Re: Is it existing? -
Dayrion - 12.02.2018
Quote:
Originally Posted by Mugala
yeah this will be better for optimize and reduce lags (not noticeable, but it really reduces  )
|
Never re-write a native function if you don't change something. Pawn function are always slower than native.
GetPlayerPoolSize(); will be always faster than yours. There is no point to write an alias pawn function.
Re: Is it existing? -
Mugala - 12.02.2018
Quote:
Originally Posted by Dayrion
Never re-write a native function if you don't change something. Pawn function are always slower than native. GetPlayerPoolSize(); will be always faster than yours. There is no point to write an alias pawn function.
|
yeah, that's what I exactly said dude.