SA-MP Forums

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

Reply
 
Thread Tools Display Modes
Old 08/09/2012, 05:47 PM   #1
kbalor
High-roller
 
kbalor's Avatar
 
Join Date: May 2012
Location: Philippines
Posts: 1,240
Reputation: 54
Default Show online players...

Could anyone help make a simple online players, with timer that shows every 10 minutes. then sendclienttoall like this
"Online players 42"
__________________
kbalor is offline   Reply With Quote
Old 08/09/2012, 05:51 PM   #2
leonardo1434
High-roller
 
leonardo1434's Avatar
 
Join Date: Mar 2012
Posts: 1,670
Reputation: 179
Default Re: Show online players...

just make a loop.
__________________
c++
leonardo1434 is offline   Reply With Quote
Old 08/09/2012, 06:20 PM   #3
detter
Big Clucker
 
Join Date: Dec 2010
Posts: 161
Reputation: 10
Default Re: Show online players...

you make simple variable that tracks numer of players...
everytime someone join you incremet it and vice versa.
then you create timer that reapet it self and sends a message
detter is offline   Reply With Quote
Old 08/09/2012, 08:08 PM   #4
SuperViper
High-roller
 
SuperViper's Avatar
 
Join Date: Sep 2011
Posts: 1,178
Reputation: 315
Default Re: Show online players...

pawn Code:
public OnGameModeInit()
{
    SetTimer("OnlinePlayersAnnounce", 600000, 1);
    return 1;
}

forward OnlinePlayersAnnounce();
public OnlinePlayersAnnounce()
{
    new playersOnlineString[30];
    format(playersOnlineString, sizeof(playersOnlineString), "Online players: %d", GetTotalPlayerCount());
    SendClientMessageToAll(-1, playersOnlineString);
    return 1;
}

GetTotalPlayerCount()
{
    new playerCount;
   
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        if(IsPlayerConnected(i))
        {
            playerCount++;
        }
    }

    return playerCount;
}
__________________
Release NameUse
FairPlayKeep the cheaters out of your server
Object Model ArrayArray of every single object model in the game
RCON PanelControl any server as you like with RCON controls
SlopeClimb up a steep hill against other players with cars falling down

I do not play on any SAMP server. Anyone with the name Ricky Phelps in-game is an imposter.
SuperViper 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
[HELP]Show Players Rank Above Players Head/Name Eminem 2ka9 Scripting Help 13 07/08/2012 03:24 AM
[Online Adm] Only show 1 line. kbalor Scripting Help 4 27/06/2012 05:36 PM
How to show a list of all online players? Torran Help Archive 6 10/03/2010 10:19 AM


All times are GMT. The time now is 11:36 PM.


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