Hey,
mein Textdraw kommt nur wenn ich im Fahrzeug sitze.
Ich habe keine Ahnung warum
Hier der Code:
//oben
new Text:WantedTextdraw[MAX_PLAYERS];
//OnPlayerConnect
WantedTextdraw[playerid] = TextDrawCreate(499.000000, 102.000000, "~y~]: ~w~0");
TextDrawBackgroundColor(WantedTextdraw[playerid], 255);
TextDrawFont(WantedTextdraw[playerid], 2);
TextDrawLetterSize(WantedTextdraw[playerid], 0.480000, 2.000000);
TextDrawColor(WantedTextdraw[playerid], -1);
TextDrawSetOutline(WantedTextdraw[playerid], 1);
TextDrawSetProportional(WantedTextdraw[playerid], 1);
//stocks
stock SaveWanteds(playerid)
{
if(!IsPlayerNPC(playerid)){
#if defined LOADSAFEWANTEDS
mysql_SetInt("spieler", "Wantedlevel",GetPVarInt(playerid,"Wantedlevel"), "Name", SpielerName(playerid));
#endif
TextDrawDestroy(WantedTextdraw[playerid]);
#if defined WANTEDTIMER
KillTimer(WantedTimer[playerid]);
#endif
DeletePVar(playerid,"Wantedlevel");
return 1;
}return 1;
}
stock GetWantedLevel(playerid)return GetPVarInt(playerid,"Wantedlevel");
stock SetWantedLevel(playerid,wantedlevel)
{
SetPVarInt(playerid,"Wantedlevel",wantedlevel);
mysql_SetInt("spieler", "Wantedlevel",GetPVarInt(playerid,"Wantedlevel"), "Name", SpielerName(playerid));
UpdateWantedDraw(playerid);
return 1;
}
stock UpdateWantedDraw(playerid)
{
if(GetWantedLevel(playerid)==0)return TextDrawHideForPlayer(playerid,WantedTextdraw[playerid]);
else
{
TextDrawHideForPlayer(playerid, WantedTextdraw[playerid]);
new str[30];
format(str,sizeof(str),"~y~]: ~w~%d",GetWantedLevel(playerid));
TextDrawSetString(WantedTextdraw[playerid], str);
TextDrawShowForPlayer(playerid, WantedTextdraw[playerid]);
}
return 1;
}