Guten Tag,
ich habe soeben ein "InfoTextdraw" erstellt was dem Spieler jegliche Infos anzeigen soll wie z.B. Bankguthaben, Uhrzeit etc..
Nur leider funktioniert es nicht so wie ich das will.
Hier meine Codes:
//Statistikbox
new PlayerText:statsbox3[MAX_PLAYERS];
new PlayerText:statsbox4[MAX_PLAYERS];
new PlayerText:statsbox5[MAX_PLAYERS];
new PlayerText:statsbox6[MAX_PLAYERS];
new PlayerText:statsbox7[MAX_PLAYERS];
//new PlayerText:statsbox8[MAX_PLAYERS];
new PlayerText:statsbox9[MAX_PLAYERS];
new PlayerText:statsbox10[MAX_PLAYERS];
new PlayerText:statsbox11[MAX_PLAYERS];
new PlayerText:statsbox12[MAX_PLAYERS];
new PlayerText:statsbox13[MAX_PLAYERS];
new PlayerText:statsbox14[MAX_PLAYERS];
OnPlayerConnect
//Statistikbox Textdraw
statsbox3[playerid] = CreatePlayerTextDraw(playerid,553.000000, 115.000000, "Heisenberg");
PlayerTextDrawAlignment(playerid,statsbox3[playerid], 2);
PlayerTextDrawBackgroundColor(playerid,statsbox3[playerid], 220);
PlayerTextDrawFont(playerid,statsbox3[playerid], 1);
PlayerTextDrawLetterSize(playerid,statsbox3[playerid], 0.230000, 1.199998);
PlayerTextDrawColor(playerid,statsbox3[playerid], -1);
PlayerTextDrawSetOutline(playerid,statsbox3[playerid], 1);
PlayerTextDrawSetProportional(playerid,statsbox3[playerid], 1);
PlayerTextDrawUseBox(playerid,statsbox3[playerid], 1);
PlayerTextDrawBoxColor(playerid,statsbox3[playerid], -678555393);
PlayerTextDrawTextSize(playerid,statsbox3[playerid], -67.000000, 108.000000);
PlayerTextDrawSetSelectable(playerid,statsbox3[playerid], 0);
statsbox4[playerid] = CreatePlayerTextDraw(playerid,610.000000, 129.000000, "~n~~n~~n~~n~~n~~n~~n~~n~");
PlayerTextDrawBackgroundColor(playerid,statsbox4[playerid], 255);
PlayerTextDrawFont(playerid,statsbox4[playerid], 1);
PlayerTextDrawLetterSize(playerid,statsbox4[playerid], 1.139999, 0.699998);
PlayerTextDrawColor(playerid,statsbox4[playerid], 200);
PlayerTextDrawSetOutline(playerid,statsbox4[playerid], 0);
PlayerTextDrawSetProportional(playerid,statsbox4[playerid], 1);
PlayerTextDrawSetShadow(playerid,statsbox4[playerid], 1);
PlayerTextDrawUseBox(playerid,statsbox4[playerid], 1);
PlayerTextDrawBoxColor(playerid,statsbox4[playerid], 150);
PlayerTextDrawTextSize(playerid,statsbox4[playerid], 496.000000, 16.000000);
PlayerTextDrawSetSelectable(playerid,statsbox4[playerid], 0);
statsbox5[playerid] = CreatePlayerTextDraw(playerid,502.000000, 129.000000, "~r~Datum:");
PlayerTextDrawBackgroundColor(playerid,statsbox5[playerid], 255);
PlayerTextDrawFont(playerid,statsbox5[playerid], 1);
PlayerTextDrawLetterSize(playerid,statsbox5[playerid], 0.179997, 1.099997);
PlayerTextDrawColor(playerid,statsbox5[playerid], -1);
PlayerTextDrawSetOutline(playerid,statsbox5[playerid], 0);
PlayerTextDrawSetProportional(playerid,statsbox5[playerid], 1);
PlayerTextDrawSetShadow(playerid,statsbox5[playerid], 1);
PlayerTextDrawSetSelectable(playerid,statsbox5[playerid], 0);
statsbox6[playerid] = CreatePlayerTextDraw(playerid,562.000000, 129.000000, "30.06.2015");
PlayerTextDrawBackgroundColor(playerid,statsbox6[playerid], 255);
PlayerTextDrawFont(playerid,statsbox6[playerid], 1);
PlayerTextDrawLetterSize(playerid,statsbox6[playerid], 0.179997, 1.099997);
PlayerTextDrawColor(playerid,statsbox6[playerid], -1);
PlayerTextDrawSetOutline(playerid,statsbox6[playerid], 0);
PlayerTextDrawSetProportional(playerid,statsbox6[playerid], 1);
PlayerTextDrawSetShadow(playerid,statsbox6[playerid], 1);
PlayerTextDrawSetSelectable(playerid,statsbox6[playerid], 0);
Time = TextDrawCreate(562.000000, 139.000000, "~r~22:35:32");
TextDrawBackgroundColor(Time, 255);
TextDrawFont(Time, 1);
TextDrawLetterSize(Time, 0.179997, 1.099997);
TextDrawColor(Time, -1);
TextDrawSetOutline(Time, 0);
TextDrawSetProportional(Time, 1);
TextDrawSetShadow(Time, 1);
TextDrawSetSelectable(Time, 0);
statsbox7[playerid] = CreatePlayerTextDraw(playerid,502.000000, 139.000000, "~r~Uhrzeit:");
PlayerTextDrawBackgroundColor(playerid,statsbox7[playerid], 255);
PlayerTextDrawFont(playerid,statsbox7[playerid], 1);
PlayerTextDrawLetterSize(playerid,statsbox7[playerid], 0.179997, 1.099997);
PlayerTextDrawColor(playerid,statsbox7[playerid], -1);
PlayerTextDrawSetOutline(playerid,statsbox7[playerid], 0);
PlayerTextDrawSetProportional(playerid,statsbox7[playerid], 1);
PlayerTextDrawSetShadow(playerid,statsbox7[playerid], 1);
PlayerTextDrawSetSelectable(playerid,statsbox7[playerid], 0);
statsbox9[playerid] = CreatePlayerTextDraw(playerid,503.000000, 149.000000, "~y~Payday vor");
PlayerTextDrawBackgroundColor(playerid,statsbox9[playerid], 255);
PlayerTextDrawFont(playerid,statsbox9[playerid], 1);
PlayerTextDrawLetterSize(playerid,statsbox9[playerid], 0.179997, 1.099997);
PlayerTextDrawColor(playerid,statsbox9[playerid], -1);
PlayerTextDrawSetOutline(playerid,statsbox9[playerid], 0);
PlayerTextDrawSetProportional(playerid,statsbox9[playerid], 1);
PlayerTextDrawSetShadow(playerid,statsbox9[playerid], 1);
PlayerTextDrawSetSelectable(playerid,statsbox9[playerid], 0);
statsbox10[playerid] = CreatePlayerTextDraw(playerid,562.000000, 149.000000, "~r~ 45~w~ Minuten");
PlayerTextDrawBackgroundColor(playerid,statsbox10[playerid], 255);
PlayerTextDrawFont(playerid,statsbox10[playerid], 1);
PlayerTextDrawLetterSize(playerid,statsbox10[playerid], 0.179997, 1.099997);
PlayerTextDrawColor(playerid,statsbox10[playerid], -1);
PlayerTextDrawSetOutline(playerid,statsbox10[playerid], 0);
PlayerTextDrawSetProportional(playerid,statsbox10[playerid], 1);
PlayerTextDrawSetShadow(playerid,statsbox10[playerid], 1);
PlayerTextDrawSetSelectable(playerid,statsbox10[playerid], 0);
statsbox11[playerid] = CreatePlayerTextDraw(playerid,503.000000, 159.000000, "~y~Gehalt am Payday");
PlayerTextDrawBackgroundColor(playerid,statsbox11[playerid], 255);
PlayerTextDrawFont(playerid,statsbox11[playerid], 1);
PlayerTextDrawLetterSize(playerid,statsbox11[playerid], 0.179997, 1.099997);
PlayerTextDrawColor(playerid,statsbox11[playerid], -1);
PlayerTextDrawSetOutline(playerid,statsbox11[playerid], 0);
PlayerTextDrawSetProportional(playerid,statsbox11[playerid], 1);
PlayerTextDrawSetShadow(playerid,statsbox11[playerid], 1);
PlayerTextDrawSetSelectable(playerid,statsbox11[playerid], 0);
statsbox12[playerid] = CreatePlayerTextDraw(playerid,562.000000, 159.000000, "~r~20.999~w~$");
PlayerTextDrawBackgroundColor(playerid,statsbox12[playerid], 255);
PlayerTextDrawFont(playerid,statsbox12[playerid], 1);
PlayerTextDrawLetterSize(playerid,statsbox12[playerid], 0.179997, 1.099997);
PlayerTextDrawColor(playerid,statsbox12[playerid], -1);
PlayerTextDrawSetOutline(playerid,statsbox12[playerid], 0);
PlayerTextDrawSetProportional(playerid,statsbox12[playerid], 1);
PlayerTextDrawSetShadow(playerid,statsbox12[playerid], 1);
PlayerTextDrawSetSelectable(playerid,statsbox12[playerid], 0);
statsbox13[playerid] = CreatePlayerTextDraw(playerid,503.000000, 169.000000, "~b~Bankkonto:");
PlayerTextDrawBackgroundColor(playerid,statsbox13[playerid], 255);
PlayerTextDrawFont(playerid,statsbox13[playerid], 1);
PlayerTextDrawLetterSize(playerid,statsbox13[playerid], 0.179997, 1.099997);
PlayerTextDrawColor(playerid,statsbox13[playerid], -1);
PlayerTextDrawSetOutline(playerid,statsbox13[playerid], 0);
PlayerTextDrawSetProportional(playerid,statsbox13[playerid], 1);
PlayerTextDrawSetShadow(playerid,statsbox13[playerid], 1);
PlayerTextDrawSetSelectable(playerid,statsbox13[playerid], 0);
statsbox14[playerid] = CreatePlayerTextDraw(playerid,562.000000, 169.000000, "~r~20.000.000~w~$");
PlayerTextDrawBackgroundColor(playerid,statsbox14[playerid], 255);
PlayerTextDrawFont(playerid,statsbox14[playerid], 1);
PlayerTextDrawLetterSize(playerid,statsbox14[playerid], 0.179997, 1.099997);
PlayerTextDrawColor(playerid,statsbox14[playerid], -1);
PlayerTextDrawSetOutline(playerid,statsbox14[playerid], 0);
PlayerTextDrawSetProportional(playerid,statsbox14[playerid], 1);
PlayerTextDrawSetShadow(playerid,statsbox14[playerid], 1);
PlayerTextDrawSetSelectable(playerid,statsbox14[playerid], 0);
stock LoadStatistik(playerid)
{
PlayerTextDrawShow(playerid,statsbox3[playerid]);
PlayerTextDrawShow(playerid,statsbox4[playerid]);
PlayerTextDrawShow(playerid,statsbox5[playerid]);
PlayerTextDrawShow(playerid,statsbox6[playerid]);
PlayerTextDrawShow(playerid,statsbox7[playerid]);
// PlayerTextDrawShow(playerid,statsbox8[playerid]);
PlayerTextDrawShow(playerid,statsbox9[playerid]);
PlayerTextDrawShow(playerid,statsbox10[playerid]);
PlayerTextDrawShow(playerid,statsbox11[playerid]);
PlayerTextDrawShow(playerid,statsbox12[playerid]);
PlayerTextDrawShow(playerid,statsbox13[playerid]);
PlayerTextDrawShow(playerid,statsbox14[playerid]);
//Payday in Minuten
new paydayin[50];
format(paydayin,sizeof(paydayin),"~r~%d~w~ Minuten",SpielerInfo[playerid][sPayDay]);
PlayerTextDrawSetString(playerid, statsbox10[playerid], paydayin);
//Geld auf der Bank
new bankg[50];
format(bankg,sizeof(bankg),"~r~%d~w~$",SpielerInfo[playerid][sBankkonto]);
PlayerTextDrawSetString(playerid, statsbox14[playerid], bankg);
//Datum Anzeige
new Datums[50];
getdate(Year, Month, Day);
format(Datums,sizeof(Datums),"%d/%02d/%02d",Day,Month,Year);
PlayerTextDrawSetString(playerid, statsbox6[playerid], Datums);
//Geld am Payday
new PaydayL[50];
format(PaydayL,sizeof(PaydayL),"~r~%d~w~$",SpielerInfo[playerid][sPayDayGeld]);
PlayerTextDrawSetString(playerid, statsbox12[playerid], PaydayL);
//Der Name
new namee[50];
format(namee,sizeof(namee),"%s",SpielerInfo[playerid][sName]);
PlayerTextDrawSetString(playerid, statsbox3[playerid], namee);
return 1;
}
Das zwanzigste was mir anzeigt wird in die Uhrzeit.
MfG
//EDIT, Fehler behoben
//EDIT, zu Quellencode gewechselt