27.06.2014, 09:33
Bad idea:
Why the usage of string "txdstring", where you could make that even without it. Here you go:
Secondly the textdraw "new Text:Statement;" must be a Player textdraw, Its because it may be irritating for users. If multiple users use 2 different commands that have usage of this textdraw, then its collapsing.
Third thing is that everywhere you have made usage of "formats" by creating string and so on.
just like this one:
Instead you could simply use TextDrawSetString.
* Actually must be a PlayerTextDraw.
Here, SetTimerEx("HideTextdraws", 4000, false, "i", playerid);, this timer, What if this timer is callback again after 2000 ms. You know, the text will disappear after 2000ms instead of 4000ms and after continuous interals, for some reason, it will be hided. So you need to have a variable for the timer and also KillTimer before setting it.
No unloading of houses or i may say no resetting of vars and destroying the 3Dtexts,mapicons,.....
>> This is some of the things i noticed were wrong. (just got quick through your code)
So i may say, you must correct it.
pawn Code:
stock Showlock(playerid)
{
new txdstring[128];
format(txdstring, sizeof(txdstring), "Locked");
TextDrawSetString(boxtext, txdstring);
TextDrawShowForPlayer(playerid, Box);
TextDrawShowForPlayer(playerid, boxtext);
SetTimerEx("HideTextdraws", 4000, false, "i", playerid);
return 1;
}
pawn Code:
stock Showlock(playerid)
{
TextDrawSetString(boxtext, "Locked");
TextDrawShowForPlayer(playerid, Box);
TextDrawShowForPlayer(playerid, boxtext);
SetTimerEx("HideTextdraws", 4000, false, "i", playerid);
return 1;
}
Third thing is that everywhere you have made usage of "formats" by creating string and so on.
just like this one:
pawn Code:
format(txdstring, sizeof(txdstring), "Locked");
* Actually must be a PlayerTextDraw.
Here, SetTimerEx("HideTextdraws", 4000, false, "i", playerid);, this timer, What if this timer is callback again after 2000 ms. You know, the text will disappear after 2000ms instead of 4000ms and after continuous interals, for some reason, it will be hided. So you need to have a variable for the timer and also KillTimer before setting it.
No unloading of houses or i may say no resetting of vars and destroying the 3Dtexts,mapicons,.....
>> This is some of the things i noticed were wrong. (just got quick through your code)
So i may say, you must correct it.

