21.05.2011, 18:45
Hi all,
I have came across a problem with textdraws.
I create an array by this way:
This can hold 2000*5 = 10000 textdraw entry.
In OnVehicleSpawn i use:
OnPlayerEnterVehicle:
My problem is the TextDraw does not get shown for anyone who enters the vehicle.
What can be the problem here? I thought of textdraw limits. SAMP Wiki says maximum 2048 textdraw can be created serverwise. I load my vehicles from SQLite, I have about ~150 vehicle in the table.
It's about 150*5 = 750 TD, and I have MAX_PLAYERS*7 textdraws for other things. But that is working.
If the problem is the limit, how can I solve that?
If it is not the limit, what is it?
Please help me
Thanks
I have came across a problem with textdraws.
I create an array by this way:
pawn Код:
enum KMOraEnum { Text:csik, Text:benzin, Text:sebesseg, Text:szazmeter, Text:kilometer };
new Text:kmora[MAX_VEHICLES][KMOraEnum];
In OnVehicleSpawn i use:
pawn Код:
public OnVehicleSpawn(vehicleid)
{
kmora[vehicleid][benzin] = TextDrawCreate(479.000000,358.000000,"Benzin: 0 liter");
kmora[vehicleid][sebesseg] = TextDrawCreate(494.000000,330.000000,"0 km / h");
kmora[vehicleid][kilometer] = TextDrawCreate(476.000000,346.000000,"000000");
kmora[vehicleid][szazmeter] = TextDrawCreate(601.000000,346.000000,"1");
kmora[vehicleid][csik] = TextDrawCreate(623.000000,320.000000,"----------");
// other textdraw things...
pawn Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
// some code
if (!ispassenger)
{
TextDrawShowForPlayer(playerid, kmora[vehicleid][kilometer]);
TextDrawShowForPlayer(playerid, kmora[vehicleid][szazmeter]);
TextDrawShowForPlayer(playerid, kmora[vehicleid][benzin]);
TextDrawShowForPlayer(playerid, kmora[vehicleid][csik]);
TextDrawShowForPlayer(playerid, kmora[vehicleid][sebesseg]);
T_kmora[playerid] = SetTimerEx("OnDistanceUpdate", 5000, 1, "d", GetPlayerVehicleID(playerid));
}
// some other code
What can be the problem here? I thought of textdraw limits. SAMP Wiki says maximum 2048 textdraw can be created serverwise. I load my vehicles from SQLite, I have about ~150 vehicle in the table.
It's about 150*5 = 750 TD, and I have MAX_PLAYERS*7 textdraws for other things. But that is working.
If the problem is the limit, how can I solve that?
If it is not the limit, what is it?
Please help me
Thanks