Zdravím , mam menši problem mam tu online hrači cez textdraw, ale ked sa hrač pripoji pripočita ho do textdrawu, ale ked ten hrač odide v textdrawe je pripočitany a až ked odide alebo pride hrač sa to odpočita.. tu je pawno ..
-- Pawno --
////////includy//////////// #include <a_samp> /////////stock///////////// stock GetOnLinePlayers() { new OnLine; for(new i, g = GetMaxPlayers(); i < g; i++) if(IsPlayerConnected(i)) OnLine++; return OnLine; } ////////////news//////////// new Text:Hraci; //////////////////////// public OnGameModeInit() { Hraci = TextDrawCreate(501.000000, 125.000000, "_"); TextDrawBackgroundColor(Hraci, 255); TextDrawFont(Hraci, 2); TextDrawLetterSize(Hraci, 0.340000, 1.000000); TextDrawColor(Hraci, -1); TextDrawSetOutline(Hraci, 0); TextDrawSetProportional(Hraci, 1); TextDrawSetShadow(Hraci, 1);
for(new i; i < MAX_PLAYERS; i ++) { if(IsPlayerConnected(i)) { TextDrawShowForPlayer(i, Hraci); } } return 1; } ////////////////////////////////////////////// public OnPlayerConnect(playerid) { new string[250]; format(string,250,"~b~ONLINE ~b~HRACI: ~r~%d/50",GetOnLinePlayers()); TextDrawSetString(Hraci,string); TextDrawShowForPlayer(playerid,Hraci); return 1; } ////////////////////////////////////////////// public OnPlayerDisconnect(playerid, reason) { return 1; }
Dotaz
Mikoo 8
Zdravím , mam menši problem mam tu online hrači cez textdraw, ale ked sa hrač pripoji pripočita ho do textdrawu, ale ked ten hrač odide v textdrawe je pripočitany a až ked odide alebo pride hrač sa to odpočita.. tu je pawno ..
-- Pawno --
////////includy////////////
#include <a_samp>
/////////stock/////////////
stock GetOnLinePlayers()
{
new OnLine;
for(new i, g = GetMaxPlayers(); i < g; i++)
if(IsPlayerConnected(i))
OnLine++;
return OnLine;
}
////////////news////////////
new Text:Hraci;
////////////////////////
public OnGameModeInit()
{
Hraci = TextDrawCreate(501.000000, 125.000000, "_");
TextDrawBackgroundColor(Hraci, 255);
TextDrawFont(Hraci, 2);
TextDrawLetterSize(Hraci, 0.340000, 1.000000);
TextDrawColor(Hraci, -1);
TextDrawSetOutline(Hraci, 0);
TextDrawSetProportional(Hraci, 1);
TextDrawSetShadow(Hraci, 1);
for(new i; i < MAX_PLAYERS; i ++)
{
if(IsPlayerConnected(i))
{
TextDrawShowForPlayer(i, Hraci);
}
}
return 1;
}
//////////////////////////////////////////////
public OnPlayerConnect(playerid)
{
new string[250];
format(string,250,"~b~ONLINE ~b~HRACI: ~r~%d/50",GetOnLinePlayers());
TextDrawSetString(Hraci,string);
TextDrawShowForPlayer(playerid,Hraci);
return 1;
}
//////////////////////////////////////////////
public OnPlayerDisconnect(playerid, reason)
{
return 1;
}
Link to comment
Share on other sites
14 odpovědí na tuto otázku
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now