03.02.2011, 21:53
I got a TextDraw...
---------------
| My Location |
---------------
but in "My Location" TD ir changes from the clock to location, to clock , to location, ect...
And the "FakeStars" dont appear at all
---------------
| My Location |
---------------
but in "My Location" TD ir changes from the clock to location, to clock , to location, ect...
And the "FakeStars" dont appear at all
pawn Код:
//On Top
new Text:LocationTextdraw[MAX_PLAYERS];
new Text:GameClock[MAX_PLAYERS];
new Text:FakeStar0[MAX_PLAYERS];
new Text:FakeStar1[MAX_PLAYERS];
new Text:FakeStar2[MAX_PLAYERS];
new Text:FakeStar3[MAX_PLAYERS];
new Text:FakeStar4[MAX_PLAYERS];
new Text:FakeStar5[MAX_PLAYERS];
new GPS[MAX_PLAYERS];
new RealClock[MAX_PLAYERS];
public OnGameModeInit()
{
//i have the "Player Classes" here
//I have some timers here to other things
for(new i;i<MAX_PLAYERS;i++)
{
//GPS
LocationTextdraw[i] = TextDrawCreate(501.000000, 130.000000, "-------------------------------");
TextDrawBackgroundColor(LocationTextdraw[i], 255);
TextDrawFont(LocationTextdraw[i], 1);
TextDrawLetterSize(LocationTextdraw[i], 0.239999, 0.899999);
TextDrawColor(LocationTextdraw[i], -1);
TextDrawSetOutline(LocationTextdraw[i], 0);
TextDrawSetProportional(LocationTextdraw[i], 1);
TextDrawSetShadow(LocationTextdraw[i], 1);
TextDrawUseBox(LocationTextdraw[i], 1);
TextDrawBoxColor(LocationTextdraw[i], 0x000000AA);
TextDrawTextSize(LocationTextdraw[i], 604.000000, 0.000000);
//RealClock
GameClock[i] = TextDrawCreate(545.000000, 22.000000, "00:00");
TextDrawBackgroundColor(GameClock[i], 255);
TextDrawFont(GameClock[i], 3);
TextDrawLetterSize(GameClock[i], 0.660000, 2.200000);
TextDrawColor(GameClock[i], 0x808080FF);
TextDrawSetOutline(GameClock[i], 0);
TextDrawSetProportional(GameClock[i], 1);
TextDrawSetShadow(GameClock[i], 1);
//FakeStars
FakeStar0[i] = TextDrawCreate(499.000000, 102.000000, "]");
FakeStar1[i] = TextDrawCreate(516.000000, 102.000000, "]");
FakeStar2[i] = TextDrawCreate(534.000000, 102.000000, "]");
FakeStar3[i] = TextDrawCreate(552.000000, 102.000000, "]");
FakeStar4[i] = TextDrawCreate(570.000000, 102.000000, "]");
FakeStar5[i] = TextDrawCreate(590.000000, 102.000000, "]");
TextDrawBackgroundColor(FakeStar0[i], 0x000000AA);
TextDrawBackgroundColor(FakeStar1[i], 0x000000AA);
TextDrawBackgroundColor(FakeStar2[i], 0x000000AA);
TextDrawBackgroundColor(FakeStar3[i], 0x000000AA);
TextDrawBackgroundColor(FakeStar4[i], 0x000000AA);
TextDrawBackgroundColor(FakeStar5[i], 0x000000AA);
TextDrawFont(FakeStar0[i], 0);
TextDrawFont(FakeStar1[i], 0);
TextDrawFont(FakeStar2[i], 0);
TextDrawFont(FakeStar3[i], 0);
TextDrawFont(FakeStar4[i], 0);
TextDrawFont(FakeStar5[i], 0);
TextDrawLetterSize(FakeStar0[i], 0.629999, 2.399999);
TextDrawLetterSize(FakeStar1[i], 0.629999, 2.399999);
TextDrawLetterSize(FakeStar2[i], 0.629999, 2.399999);
TextDrawLetterSize(FakeStar3[i], 0.629999, 2.399999);
TextDrawLetterSize(FakeStar4[i], 0.629999, 2.399999);
TextDrawLetterSize(FakeStar5[i], 0.629999, 2.399999);
TextDrawColor(FakeStar0[i], 286331391);
TextDrawColor(FakeStar1[i], 286331391);
TextDrawColor(FakeStar2[i], 286331391);
TextDrawColor(FakeStar3[i], 286331391);
TextDrawColor(FakeStar4[i], 286331391);
TextDrawColor(FakeStar5[i], 286331391);
TextDrawSetOutline(FakeStar0[i], 0);
TextDrawSetOutline(FakeStar1[i], 0);
TextDrawSetOutline(FakeStar2[i], 0);
TextDrawSetOutline(FakeStar3[i], 0);
TextDrawSetOutline(FakeStar4[i], 0);
TextDrawSetOutline(FakeStar5[i], 0);
TextDrawSetProportional(FakeStar0[i], 1);
TextDrawSetProportional(FakeStar1[i], 1);
TextDrawSetProportional(FakeStar2[i], 1);
TextDrawSetProportional(FakeStar3[i], 1);
TextDrawSetProportional(FakeStar4[i], 1);
TextDrawSetProportional(FakeStar5[i], 1);
TextDrawSetShadow(FakeStar0[i], 0);
TextDrawSetShadow(FakeStar1[i], 0);
TextDrawSetShadow(FakeStar2[i], 0);
TextDrawSetShadow(FakeStar3[i], 0);
TextDrawSetShadow(FakeStar4[i], 0);
TextDrawSetShadow(FakeStar5[i], 0);
return 1;
}
return 1;
}
public OnPlayerConnect(playerid)
{
GPS[playerid] = 1;
RealClock[playerid] = 1;
TextDrawShowForPlayer(playerid, LocationTextdraw[playerid]);
TextDrawShowForPlayer(playerid, GameClock[playerid]);
TextDrawShowForPlayer(playerid, FakeStar0[playerid]);
TextDrawShowForPlayer(playerid, FakeStar1[playerid]);
TextDrawShowForPlayer(playerid, FakeStar2[playerid]);
TextDrawShowForPlayer(playerid, FakeStar3[playerid]);
TextDrawShowForPlayer(playerid, FakeStar4[playerid]);
TextDrawShowForPlayer(playerid, FakeStar5[playerid]);
//Register thing here
return 1;
}
public OnPlayerDisconnect(playerid, reason)
{
GPS[playerid] = 0;
RealClock[playerid] = 0;
TextDrawHideForPlayer(playerid, LocationTextdraw[playerid]);
TextDrawHideForPlayer(playerid, GameClock[playerid]);
//Register thing here
return 1;
}
//The Commands for the TD
public OnPlayerCommandText(playerid, cmdtext[])
{
dcmd(gps, 3, cmdtext);
dcmd(clock, 5, cmdtext);
}
dcmd_gps(playerid, params[])
{
#pragma unused params
if(GPS[playerid] == 1)
{
TextDrawHideForPlayer(playerid, LocationTextdraw[playerid]);
SendClientMessage(playerid, 0xFFFFFFAA, "You turned the GPS {FF0000}off");
GPS[playerid] = 0;
return 1;
}
else
{
if(GPS[playerid] == 0)
{
TextDrawShowForPlayer(playerid, LocationTextdraw[playerid]);
SendClientMessage(playerid, 0xFFFFFFAA, "You turned the GPS {FF0000}on");
GPS[playerid] = 1;
return 1;
}
}
return 1;
}
dcmd_clock(playerid, params[])
{
#pragma unused params
if(RealClock[playerid] == 1)
{
TextDrawHideForPlayer(playerid, GameClock[playerid]);
SendClientMessage(playerid, 0xFFFFFFAA, "You turned the Clock {FF0000}off");
RealClock[playerid] = 0;
return 1;
}
else
{
if(RealClock[playerid] == 0)
{
TextDrawShowForPlayer(playerid, GameClock[playerid]);
SendClientMessage(playerid, 0xFFFFFFAA, "You turned the Clock {FF0000}on");
RealClock[playerid] = 1;
return 1;
}
}
return 1;
}
//And finally
public OnPlayerUpdate(playerid)
{
new string[128], Hour, Minute, Wantedlevel;
gettime(Hour, Minute);
Wantedlevel = GetPlayerWantedLevel(playerid);
//GPS
format(string, sizeof(string), "%s", GetPlayerZone(playerid));
TextDrawSetString(LocationTextdraw[playerid], string);
//RealClock
format(string, sizeof(string), "%02d:%02d", Hour, Minute);
TextDrawSetString(GameClock[playerid], string);
if(Wantedlevel > 0)
{
TextDrawHideForPlayer(playerid, FakeStar0[playerid]);
TextDrawHideForPlayer(playerid, FakeStar1[playerid]);
TextDrawHideForPlayer(playerid, FakeStar2[playerid]);
TextDrawHideForPlayer(playerid, FakeStar3[playerid]);
TextDrawHideForPlayer(playerid, FakeStar4[playerid]);
TextDrawHideForPlayer(playerid, FakeStar5[playerid]);
}
else
{
TextDrawShowForPlayer(playerid, FakeStar0[playerid]);
TextDrawShowForPlayer(playerid, FakeStar1[playerid]);
TextDrawShowForPlayer(playerid, FakeStar2[playerid]);
TextDrawShowForPlayer(playerid, FakeStar3[playerid]);
TextDrawShowForPlayer(playerid, FakeStar4[playerid]);
TextDrawShowForPlayer(playerid, FakeStar5[playerid]);
}
return 1;
}