TextDrawe in server
#1

Hi,
I have the server did tell the time and date and does not show me textdraw and certainly the money, ping, abd death kills the bottom toolbar

Picture:


Код:
#include <a_samp>
new Text:ServerStaticBox[MAX_PLAYERS],Text:ServerCash[MAX_PLAYERS],Text:ServerPing[MAX_PLAYERS],Text:ServerKills[MAX_PLAYERS],Text:ServerDeath[MAX_PLAYERS],Text:ServerName[MAX_PLAYERS];
new Text:ServerDate,Text:ServerTime;
public OnGameModeInit()
{
SetTimer("settime",1000,true);
SetTimer("ServerInfo",1000,true);
 
ServerTime = TextDrawCreate(422.000000, 5.000000, "00:00:00");
TextDrawBackgroundColor(ServerTime, 255);
TextDrawFont(ServerTime, 2);
TextDrawLetterSize(ServerTime, 0.500000, 1.000000);
TextDrawColor(ServerTime, 16711935);
TextDrawSetOutline(ServerTime, 1);
TextDrawSetProportional(ServerTime, 1);
 
ServerDate = TextDrawCreate(534.000000, 5.000000, "01.01.2014");
TextDrawBackgroundColor(ServerDate, 255);
TextDrawFont(ServerDate, 2);
TextDrawLetterSize(ServerDate, 0.500000, 1.000000);
TextDrawColor(ServerDate, 16711935);
TextDrawSetOutline(ServerDate, 1);
TextDrawSetProportional(ServerDate, 1);
return 1;
}
 
public OnPlayerConnect(playerid)
{
ServerStaticBox[playerid] = TextDrawCreate(640.000000, 426.000000, "Nazdar osel");
TextDrawBackgroundColor(ServerStaticBox[playerid], 255);
TextDrawFont(ServerStaticBox[playerid], 1);
TextDrawLetterSize(ServerStaticBox[playerid], 0.500000, 1.000000);
TextDrawColor(ServerStaticBox[playerid], -1);
TextDrawSetOutline(ServerStaticBox[playerid], 0);
TextDrawSetProportional(ServerStaticBox[playerid], 1);
TextDrawSetShadow(ServerStaticBox[playerid], 1);
TextDrawUseBox(ServerStaticBox[playerid], 1);
TextDrawBoxColor(ServerStaticBox[playerid], 255);
TextDrawTextSize(ServerStaticBox[playerid], -1.000000, 100.000000);
 
ServerCash[playerid] = TextDrawCreate(20.000000, 430.000000, "Cash = 0$");
TextDrawBackgroundColor(ServerCash[playerid], -1);
TextDrawFont(ServerCash[playerid], 0);
TextDrawLetterSize(ServerCash[playerid], 0.500000, 1.000000);
TextDrawColor(ServerCash[playerid], -16776961);
TextDrawSetOutline(ServerCash[playerid], 1);
TextDrawSetProportional(ServerCash[playerid], 1);
 
ServerPing[playerid] = TextDrawCreate(190.000000, 429.000000, "Ping = 10");
TextDrawBackgroundColor(ServerPing[playerid], -1);
TextDrawFont(ServerPing[playerid], 0);
TextDrawLetterSize(ServerPing[playerid], 0.500000, 1.000000);
TextDrawColor(ServerPing[playerid], -16776961);
TextDrawSetOutline(ServerPing[playerid], 1);
TextDrawSetProportional(ServerPing[playerid], 1);
 
ServerKills[playerid] = TextDrawCreate(300.000000, 429.000000, "Kills = 0");
TextDrawBackgroundColor(ServerKills[playerid], -1);
TextDrawFont(ServerKills[playerid], 0);
TextDrawLetterSize(ServerKills[playerid], 0.500000, 1.000000);
TextDrawColor(ServerKills[playerid], -16776961);
TextDrawSetOutline(ServerKills[playerid], 1);
TextDrawSetProportional(ServerKills[playerid], 1);
 
ServerDeath[playerid] = TextDrawCreate(400.000000, 429.000000, "Death = 0");
TextDrawBackgroundColor(ServerDeath[playerid], -1);
TextDrawFont(ServerDeath[playerid], 0);
TextDrawLetterSize(ServerDeath[playerid], 0.500000, 1.000000);
TextDrawColor(ServerDeath[playerid], -16776961);
TextDrawSetOutline(ServerDeath[playerid], 1);
TextDrawSetProportional(ServerDeath[playerid], 1);
 
ServerName[playerid] = TextDrawCreate(281.000000, 413.000000, "Virtual Reality Roleplay 1.0");
TextDrawAlignment(ServerName[playerid], 2);
TextDrawBackgroundColor(ServerName[playerid], -65281);
TextDrawFont(ServerName[playerid], 2);
TextDrawLetterSize(ServerName[playerid], 0.500000, 1.400000);
TextDrawColor(ServerName[playerid], 16711935);
TextDrawSetOutline(ServerName[playerid], 1);
TextDrawSetProportional(ServerName[playerid], 1);
 
TextDrawShowForPlayer(playerid, ServerTime);
TextDrawShowForPlayer(playerid, ServerDate);
TextDrawShowForPlayer(playerid, ServerStaticBox[playerid]);
TextDrawShowForPlayer(playerid, ServerName[playerid]);
TextDrawShowForPlayer(playerid, ServerDeath[playerid]);
TextDrawShowForPlayer(playerid, ServerKills[playerid]);
TextDrawShowForPlayer(playerid, ServerPing[playerid]);
TextDrawShowForPlayer(playerid, ServerCash[playerid]);
return 1;
}
 
public OnPlayerDisconnect(playerid, reason)
{
TextDrawHideForPlayer(playerid, ServerTime);
TextDrawHideForPlayer(playerid, ServerDate);
TextDrawHideForPlayer(playerid, ServerStaticBox[playerid]);
TextDrawHideForPlayer(playerid, ServerName[playerid]);
TextDrawHideForPlayer(playerid, ServerDeath[playerid]);
TextDrawHideForPlayer(playerid, ServerKills[playerid]);
TextDrawHideForPlayer(playerid, ServerPing[playerid]);
TextDrawHideForPlayer(playerid, ServerCash[playerid]);
return 1;
}
 
forward ServerInfo(playerid);
public ServerInfo(playerid){
if(IsPlayerConnected(playerid)){
new sing0[256],sing1[256],sing2[256],sing3[256];
format(sing0,sizeof(sing0),"Cash: %d",GetPlayerMoneyEx(playerid));
TextDrawSetString(ServerCash[playerid], sing0);
 
format(sing1,sizeof(sing1),"Ping: %i",GetPlayerPing(playerid));
TextDrawSetString(ServerPing[playerid], sing1);
 
format(sing2,sizeof(sing2),"Kills: %d",PlayerInfo[playerid][pKills]);
TextDrawSetString(ServerKills[playerid], sing2);
 
format(sing3,sizeof(sing3),"Death: %d",PlayerInfo[playerid][pDeaths]);
TextDrawSetString(ServerDeath[playerid], sing3);
}
return 1;
}
 
forward settime(playerid);
public settime(playerid){
new string[256],year,month,day,hours,minutes,seconds;
getdate(year, month, day), gettime(hours, minutes, seconds);
format(string, sizeof string, "%d.%s%d.%s%d", day, ((month < 10) ? ("0") : ("")), month, (year < 10) ? ("0") : (""), year);
TextDrawSetString(ServerDate, string);
format(string, sizeof string, "%s%d:%s%d:%s%d", (hours < 10) ? ("0") : (""), hours, (minutes < 10) ? ("0") : (""), minutes, (seconds < 10) ? ("0") : (""), seconds);
TextDrawSetString(ServerTime, string);
return 1;
}
Help ME Please
Reply
#2

Put the TextDrawShow under playerspawn pal
Reply
#3

does not work
Reply
#4

Help Me?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)