HeyHoo,
Ich habe mir grade einen Textdraw mit folgendem Textdraw-Editor erstellt: http://bsndesign.webs.com/tde.htm
Leider, wird der PlayerTextDraw nicht angezeigt!
Hier der Code:
new PlayerText:PDTime[MAX_PLAYERS];
public PaydayTimeCheck(playerid)
{
new string[64];
if(SpielerInfo[playerid][pNextPayday] < 60)
{
SpielerInfo[playerid][pNextPayday] += 1;
format(string,sizeof(string),"Payday: %d/60",SpielerInfo[playerid][pNextPayday]);
PlayerTextDrawSetString(playerid, PDTime[playerid], string);
SavePlayer(playerid);
}
if(SpielerInfo[playerid][pNextPayday] == 60)
{
Payday(playerid);
SpielerInfo[playerid][pNextPayday] = 0;
format(string,sizeof(string),"Payday: %d/60",SpielerInfo[playerid][pNextPayday]);
PlayerTextDrawSetString(playerid, PDTime[playerid], string);
SavePlayer(playerid);
}
}
{
new string[64];
if(SpielerInfo[playerid][pNextPayday] < 60)
{
SpielerInfo[playerid][pNextPayday] += 1;
format(string,sizeof(string),"Payday: %d/60",SpielerInfo[playerid][pNextPayday]);
PlayerTextDrawSetString(playerid, PDTime[playerid], string);
SavePlayer(playerid);
}
if(SpielerInfo[playerid][pNextPayday] == 60)
{
Payday(playerid);
SpielerInfo[playerid][pNextPayday] = 0;
format(string,sizeof(string),"Payday: %d/60",SpielerInfo[playerid][pNextPayday]);
PlayerTextDrawSetString(playerid, PDTime[playerid], string);
SavePlayer(playerid);
}
}
public OnPlayerConnect(playerid)
{
if(IsPlayerNPC(playerid))return 1;
PDTime[playerid] = CreatePlayerTextDraw (playerid, 24 ,455 , "Payday: 00/60");
PlayerTextDrawBackgroundColor(playerid, PDTime[playerid], 255);
PlayerTextDrawFont(playerid, PDTime[playerid] , 3);
PlayerTextDrawLetterSize(playerid, PDTime[playerid] , 0.5, 3.5);
PlayerTextDrawColor(playerid, PDTime[playerid] , 0x33ff00FF);
PlayerTextDrawSetOutline(playerid, PDTime[playerid] , false);
PlayerTextDrawSetProportional(playerid, PDTime[playerid] , true);
PlayerTextDrawSetShadow(playerid, PDTime [playerid], 0);
return 1;
}
{
if(IsPlayerNPC(playerid))return 1;
PDTime[playerid] = CreatePlayerTextDraw (playerid, 24 ,455 , "Payday: 00/60");
PlayerTextDrawBackgroundColor(playerid, PDTime[playerid], 255);
PlayerTextDrawFont(playerid, PDTime[playerid] , 3);
PlayerTextDrawLetterSize(playerid, PDTime[playerid] , 0.5, 3.5);
PlayerTextDrawColor(playerid, PDTime[playerid] , 0x33ff00FF);
PlayerTextDrawSetOutline(playerid, PDTime[playerid] , false);
PlayerTextDrawSetProportional(playerid, PDTime[playerid] , true);
PlayerTextDrawSetShadow(playerid, PDTime [playerid], 0);
return 1;
}
public OnPlayerSpawn(playerid)
{
PlayerTextDrawShow(playerid, PDTime[playerid]);
return 1;
}
{
PlayerTextDrawShow(playerid, PDTime[playerid]);
return 1;
}
Hier der Dialog_Login (wo der Timer gesetzt wird, weil Ich den Textdraw mit dem Paydaysystem verschmelzen lassen habe:
case DIALOG_LOGIN:
{
if(response)
{
if(strlen(inputtext) == 0)
{
ShowPlayerDialog(playerid,DIALOG_LOGIN,DIALOG_STYLE_INPUT,"Login","Das eingegebene Passwort war falsch!\nBitte logge dich mit deinem Passwort ein:","Login","Abbrechen");
return 1;
}
else
{
new SpielerNamee[MAX_PLAYER_NAME];
GetPlayerName(playerid, SpielerNamee, MAX_PLAYER_NAME);
if(!strcmp(MD5_Hash(inputtext), mysql_ReturnPasswort(SpielerNamee), true))
{
new str[64];
format(str,sizeof(str),"Willkommen zurück, %s",PlayerName(playerid));
SetPVarInt(playerid,"Eingeloggt",1);
LoadPlayer(playerid);
SpawnPlayer(playerid);
SCM(playerid,COLOR_WHITE,"");
SCM(playerid,COLOR_WHITE,str);
SCM(playerid,COLOR_WHITE,"");
SpielerInfo[playerid][pNextPayday] = mysql_GetInt("accounts", "NextPayday", "Name", SpielerInfo[playerid][pName]);//Aus dem Tutorial
SpielerInfo[playerid][P_Timer] = SetTimerEx("PaydayTimeCheck",60000,1,"i",playerid);//<-- DAAA
return 1;
}
else
{
ShowPlayerDialog(playerid,DIALOG_LOGIN,DIALOG_STYLE_INPUT,"Login","Das eingegebene Passwort war falsch!\nBitte logge dich mit deinem Passwort ein:","Login","Abbrechen");
return 1;
}
}
}
else
{
Kick(playerid);
}
{
if(response)
{
if(strlen(inputtext) == 0)
{
ShowPlayerDialog(playerid,DIALOG_LOGIN,DIALOG_STYLE_INPUT,"Login","Das eingegebene Passwort war falsch!\nBitte logge dich mit deinem Passwort ein:","Login","Abbrechen");
return 1;
}
else
{
new SpielerNamee[MAX_PLAYER_NAME];
GetPlayerName(playerid, SpielerNamee, MAX_PLAYER_NAME);
if(!strcmp(MD5_Hash(inputtext), mysql_ReturnPasswort(SpielerNamee), true))
{
new str[64];
format(str,sizeof(str),"Willkommen zurück, %s",PlayerName(playerid));
SetPVarInt(playerid,"Eingeloggt",1);
LoadPlayer(playerid);
SpawnPlayer(playerid);
SCM(playerid,COLOR_WHITE,"");
SCM(playerid,COLOR_WHITE,str);
SCM(playerid,COLOR_WHITE,"");
SpielerInfo[playerid][pNextPayday] = mysql_GetInt("accounts", "NextPayday", "Name", SpielerInfo[playerid][pName]);//Aus dem Tutorial
SpielerInfo[playerid][P_Timer] = SetTimerEx("PaydayTimeCheck",60000,1,"i",playerid);//<-- DAAA
return 1;
}
else
{
ShowPlayerDialog(playerid,DIALOG_LOGIN,DIALOG_STYLE_INPUT,"Login","Das eingegebene Passwort war falsch!\nBitte logge dich mit deinem Passwort ein:","Login","Abbrechen");
return 1;
}
}
}
else
{
Kick(playerid);
}
Leider, wird nichts angezeigt :0
lg