[Help] With some clientmessege [How to do this?] REP+1 !!
#1

Hello guys...
i need help how to do this like in picture
i need it ingame like this: P
i can do this in randommsg but how to shows players ? i can do this *** Number of players in (nameserver) is (here players) i dont know how to shows players?
help meh pls! thanks!


Uploaded with ImageShack.us

_______________
IP : 188.40.57.132:7777
Drift - Generation
Reply
#2

Format a string with the amount of players.
then SendClientMessageToAll(COLOR_GREY, string);
Reply
#3

i allrdy do it on sendclientmessagetoall but dont shows players...
can ya help me with format string?
____________________
IP : 188.40.57.132:7777
Drift - Generation
Reply
#4

What is your way to check the amount of players online?

I would do: at ongamemodeinit players = 0

Onplayerconnect players = players + 1;
Onplayersdisconnect players = players -1

new string[128];
format(string, sizeof(string), "There are now %d players online!", players);
SendClientMessageToAll(COLOR_GREY, string);
Reply
#5

pawn Код:
new player_count; // OUTSIDE ALL CALLBACKS

public OnPlayerConnect(playerid)
{
    player_count++;
    return 1;
}

public OnPlayerDisconnect(playerid, reason)
{
    player_count--;
    return 1;
}

// To show the message:
new sPlay[64];
format(sPlay, sizeof(sPlay), "%i/%i players online.", player_count, GetMaxPlayers());
SendClientMessageToAll(COLOR_GREY, sPlay);
Reply
#6

MP2 bro thank you so much!
Reply
#7

Hey MP2 I think you have a error in ur code.You have the created the variable as player_count but in onplayerdisconnect u r subtracting 1 from players_online.
What is players_online??
Reply
#8

Yes, because a player disconnected.
Reply
#9

Quote:

public OnPlayerDisconnect(playerid, reason)
{
players_online--;
return 1;
}

i dont put this 1 cuz it shows error , and without this works perfect..
Reply
#10

Well, if you don't put that it's not going to go down when players leave. Sorry, I made a typo. Change players_online to player_count.
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)