Onlie Players
#9

Try this:
Код:
new PlayersOnline;
public OnGameModeInit()
{

	OnlineRecordTD[2] = TextDrawCreate(112.666671, 290.551269, "0");
	TextDrawLetterSize(OnlineRecordTD[2], 0.400000, 1.600000);
	TextDrawAlignment(OnlineRecordTD[2], 1);
	TextDrawColor(OnlineRecordTD[2], 16777215);
	TextDrawSetShadow(OnlineRecordTD[2], 0);
	TextDrawSetOutline(OnlineRecordTD[2], 0);
	TextDrawBackgroundColor(OnlineRecordTD[2], 255);
	TextDrawFont(OnlineRecordTD[2], 1);
	TextDrawSetProportional(OnlineRecordTD[2], 1);
	TextDrawSetShadow(OnlineRecordTD[2], 0);

	return 1;
}

public OnPlayerConnect(playerid)
{

	if(!IsPlayerNPC(playerid))
	{
		new pcount[5];
		valstr(pcount, ++PlayersOnline);
		TextDrawSetString(OnlineRecordTD[2], pcount);
		TextDrawShowForPlayer(playerid, OnlineRecordTD[2]);
	}

	return 1;
}

public OnPlayerDisconnect(playerid, reason)
{

	if(!IsPlayerNPC(playerid))
	{
		new pcount[5];
		valstr(pcount, --PlayersOnline);
		TextDrawSetString(OnlineRecordTD[2], pcount);
	}
	
	return 1;
}
EDIT: Of course, you have to declare new OnlineRecordTD[] as global as well.

Sorry for my bad english.
Reply


Messages In This Thread
Online Players - by Micko123 - 03.11.2016, 21:19
Re: Onlie Players - by oMa37 - 03.11.2016, 21:51
Respuesta: Re: Onlie Players - by Ner0x96 - 04.11.2016, 01:22
Re: Onlie Players - by Micko123 - 04.11.2016, 06:57
Re: Onlie Players - by Hunud - 04.11.2016, 07:01
Re: Onlie Players - by Micko123 - 04.11.2016, 07:03
Re: Onlie Players - by Hunud - 04.11.2016, 07:06
Re: Onlie Players - by Micko123 - 04.11.2016, 07:09
Re: Onlie Players - by RoboN1X - 04.11.2016, 07:27
Re: Onlie Players - by Micko123 - 04.11.2016, 07:34

Forum Jump:


Users browsing this thread: 3 Guest(s)