30.11.2012, 17:31
Hello. I am using textdraw and it works for about 20 seconds, but after that, it dissapears and never reapears again. Im using onplayerupdate. I know it can cause some lag but I need it since the information it gives is dynamic.
Code:
Any ideas?
Code:
Код:
new Text:Textdraw0; // MDC new Text:Textdraw1; // maverick seen new Text:Textdraw2; // siren
Код:
public OnPlayerUpdate(playerid) { TextDrawHideForPlayer(playerid,Textdraw1); TextDrawHideForPlayer(playerid,Textdraw2); /////////////////////////////////////////////////////////////////////////// if(team[playerid]==0) { new mavseenstring[25]; if(newmavseen==0) { format(mavseenstring,sizeof(mavseenstring),"Visual From Sky: ~r~No"); } if(newmavseen==1) { format(mavseenstring,sizeof(mavseenstring),"Visual From Sky: ~r~Yes"); } Textdraw1 = TextDrawCreate(388.000000, 310.000000, mavseenstring); TextDrawBackgroundColor(Textdraw1, 255); TextDrawFont(Textdraw1, 1); TextDrawLetterSize(Textdraw1, 0.500000, 1.000000); // "Visual From Sky: " TextDrawColor(Textdraw1, -16776961); TextDrawSetOutline(Textdraw1, 0); TextDrawSetProportional(Textdraw1, 1); TextDrawSetShadow(Textdraw1, 1); TextDrawShowForPlayer(playerid,Textdraw1); } /////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////// if(team[playerid]==0) { new sirenstring[15]; if(!IsPlayerInAnyVehicle(playerid)) { format(sirenstring,sizeof(sirenstring),"Siren: ~r~No"); } else { new vid=GetPlayerVehicleID(playerid); if(Siren[vid]==0) { format(sirenstring,sizeof(sirenstring),"Siren: ~r~No"); } if(Siren[vid]==1) { // siren info format(sirenstring,sizeof(sirenstring),"Siren: ~r~Yes"); } } Textdraw2 = TextDrawCreate(388.000000, 320.000000, sirenstring); TextDrawBackgroundColor(Textdraw2, 255); TextDrawFont(Textdraw2, 1); TextDrawLetterSize(Textdraw2, 0.500000, 1.000000); TextDrawColor(Textdraw2, -16776961); TextDrawSetOutline(Textdraw2, 0); TextDrawSetProportional(Textdraw2, 1); TextDrawSetShadow(Textdraw2, 1); TextDrawShowForPlayer(playerid,Textdraw2); } /////////////////////////////////////////////////////////////////////////// TextDrawHideForPlayer(playerid,Textdraw0); if(team[playerid]==0) { Textdraw0 = TextDrawCreate(560.000000, 312.000000, "Mobile Data Computer"); TextDrawBackgroundColor(Textdraw0, 255); TextDrawFont(Textdraw0, 1); TextDrawLetterSize(Textdraw0, 0.500000, 1.000000); TextDrawColor(Textdraw0, -1); TextDrawSetOutline(Textdraw0, 1); // Blue police box TextDrawSetProportional(Textdraw0, 1); TextDrawUseBox(Textdraw0, 1); TextDrawBoxColor(Textdraw0, 65535); TextDrawTextSize(Textdraw0, 384.000000, 165.000000); TextDrawShowForPlayer(playerid,Textdraw0); } }