SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 12/02/2018, 07:39 PM   #1
Davidmkd123
Big Clucker
 
Join Date: Feb 2017
Location: Macedonia
Posts: 59
Reputation: 2
Default Is it existing?

Any function maybe like GetPlayerIngamePlayers() ??, or i should make it by myself?
Davidmkd123 is online now   Reply With Quote
Old 12/02/2018, 07:46 PM   #2
Abagail
High-roller
 
Join Date: Dec 2013
Location: GetPlayerPos(playerid, pos); Scripter/Mapper.
Posts: 3,515
Reputation: 433
Default Re: Is it existing?

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?
Abagail is offline   Reply With Quote
Old 12/02/2018, 08:54 PM   #3
Mugala
Gangsta
 
Mugala's Avatar
 
Join Date: Nov 2012
Location: behind u
Posts: 529
Reputation: 23
Default Re: Is it existing?

what u're trying to make with this function? what do u want to exactly do?
__________________
here to help
Mugala is offline   Reply With Quote
Old 12/02/2018, 09:28 PM   #4
PepsiCola23
Gangsta
 
Join Date: May 2015
Posts: 512
Reputation: 2
Default Re: Is it existing?

You want to get the number of players online?isnt that shown when pressing TAB or simply from samp client?explaon better
PepsiCola23 is offline   Reply With Quote
Old 12/02/2018, 09:49 PM   #5
ChristolisTV
Big Clucker
 
ChristolisTV's Avatar
 
Join Date: Feb 2015
Location: Florida, USA
Posts: 160
Reputation: 12
Default Re: Is it existing?

Well, let's suppose you want to get the number of players online in your server:
PHP Code:
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); 
__________________
YouTube | GitHub
Player since 04.09.2010
"Stop looking down, and look up to success."
- Christolis
ChristolisTV is offline   Reply With Quote
Old 12/02/2018, 09:50 PM   #6
Arthur Kane
Gangsta
 
Join Date: Sep 2012
Location: Los Angeles
Posts: 779
Reputation: 103
Default Re: Is it existing?

http://wiki.sa-mp.com/wiki/GetPlayerPoolSize
__________________

developer @ ba-rp.net


http://forum.bayarearoleplay.com
Arthur Kane is offline   Reply With Quote
Old 12/02/2018, 10:25 PM   #7
Mugala
Gangsta
 
Mugala's Avatar
 
Join Date: Nov 2012
Location: behind u
Posts: 529
Reputation: 23
Default Re: Is it existing?

Quote:
Originally Posted by Arthur Kane View Post
yeah this will be better for optimize and reduce lags (not noticeable, but it really reduces )
__________________
here to help
Mugala is offline   Reply With Quote
Old 12/02/2018, 10:32 PM   #8
Dayrion
High-roller
 
Dayrion's Avatar
 
Join Date: Jan 2016
Location: France
Posts: 1,637
Reputation: 202
Default Re: Is it existing?

Quote:
Originally Posted by Mugala View Post
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.
__________________
actor_plus - v4.1.2
I'm a goner, somebody catch my breath,
I'm a goner, somebody catch my breath
Dayrion is offline   Reply With Quote
Old 12/02/2018, 10:34 PM   #9
Mugala
Gangsta
 
Mugala's Avatar
 
Join Date: Nov 2012
Location: behind u
Posts: 529
Reputation: 23
Default Re: Is it existing?

Quote:
Originally Posted by Dayrion View Post
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.
__________________
here to help
Mugala is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How can I have an existing gamemode? Colonel Server Support 10 26/06/2016 10:54 AM
How can I use an existing gamemode? Colonel Client Support 1 26/06/2016 12:02 AM
[Mysql] Modify an existing value anou1 Scripting Help 7 16/02/2014 04:44 PM
Is there a existing.. Studio Help Archive 2 04/12/2009 09:01 AM


All times are GMT. The time now is 02:53 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.