22.08.2010, 16:19
wouldn't creating a text-draw on player spawn make a new one every time someone spawned so why not make it on the filter-script int with a loop or make one when they join and then delete when they or leave?
for(new i=0;i<MAX_VEHICLES;i++) {
fuel[i] = 100; //sets every car's fuel to 100 in a loop
}
new fuel[MAX_VEHICLES] = {100, 100, ...}; // exactly like this. This will set them all to 100
Improvement: This
pawn Code:
pawn Code:
|
new fuel[MAX_VEHICLES] = 100;
• Progressive initializers for arrays The ellipsis operator continues the progression of the initialization constants for an array, based on the last two initialized elements. The ellipsis operator (three dots, or “...”) initializes the array up to its declared size. Examples: Listing: array initializers new a[10] = { 1, ... } // sets all ten elements to 1 new b[10] = { 1, 2, ... } // b = 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 new c[8] = { 1, 2, 40, 50, ... } // c = 1, 2, 40, 50, 60, 70, 80, 90 new d[10] = { 10, 9, ... } // d = 10, 9, 8, 7, 6, 5, 4, 3, 2, 1 |
Do you have other textdraws ? here it was bugged with grandlarc's spawn texts (San Fierro, Las Venturas etc)
try to define it if you have (so instead of "TextDrawCreate(..." use new "td_name = TextDrawCreate...)" And if you reload the filterscript it can be buggedtoo, you can fix that with a loop killing the textdraw for everyone on filterscript exit. I used the tutorial script for my speedometer which you can find here: https://sampforum.blast.hk/showthread.php?tid=169469 |