• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[Pawn] Error with TextDrawSetString ??
#1
Hello i want to create a TD of FUEL And i get error when i use?TextDrawSetString?



Quote:C:\Users\user\Desktop\Samp\samp server\gamemodes\SFUD.pwn(5445) : error 029: invalid expression, assumed zero

C:\Users\user\Desktop\Samp\samp server\gamemodes\SFUD.pwn(5445) : warning 215: expression has no effect

C:\Users\user\Desktop\Samp\samp server\gamemodes\SFUD.pwn(5445) : error 001: expected token: ";", but found "]"

C:\Users\user\Desktop\Samp\samp server\gamemodes\SFUD.pwn(5445) : error 029: invalid expression, assumed zero

C:\Users\user\Desktop\Samp\samp server\gamemodes\SFUD.pwn(5445) : fatal error 107: too many error messages on one line





This is on Gamemodeini :



Quote:g_Player[playerid][td_fuel] = CreatePlayerTextDraw(playerid,45.000000,324.000000,"Fuel: 100");

? ? PlayerTextDrawBackgroundColor(playerid,g_Player[playerid][td_fuel],0x00000033);

? ? PlayerTextDrawFont(playerid,g_Player[playerid][td_fuel],3); /

? ? PlayerTextDrawLetterSize(playerid,g_Player[playerid][td_fuel],0.699999,1.700000);

? ? PlayerTextDrawColor(playerid,g_Player[playerid][td_fuel],0x000000ff);

? ? TextDrawSetShadow(playerid,g_Player[playerid][td_fuel],3);







Quote:public timer_fuel_lower()

{

? ? for(new i=0;i<MAX_PLAYERS;i) { //

? ? ? ? if (isrefuelling[i]) continue; //

? ? ? ? new vid = GetPlayerVehicleID(i); //

? ? ? ? if (GetPlayerVehicleSeat(i) == 0) { //

? ? ? ? ? ? fuel[vid] = fuel[vid] -1; //

? ? ? ? ? ? if (fuel[vid]<1) //

? ? ? ? ? ? {

? ? ? ? ? ? ? ? fuel[vid] = 0; //

? ? ? ? ? ? ? ? RemovePlayerFromVehicle(i); //

? ? ? ? ? ? ? ? GameTextForPlayer(i,"~r~You are out of ~w~fuel~r~!",5000,4); //

? ? ? ? ? ? }

? ? ? ? }

? ? ? ?

? ? ? ? new tdstring[32];

? ? ? ?format(tdstring,sizeof tdstring,"Fuel:%i",fuel[vid]);

? ? ? ? TextDrawSetString([td_fuel][i], tdstring); < Line 5445



? ? }



}





Whats wrong please ??
  Reply
#2
F
TextDrawSetString([td_fuel][i], tdstring);


btw,
start using this: sizeof( tdstring ) -1
So:


PHP Code:
new tdstring32 ];
formattdstringsizeoftdstring ) - 1"Fuel:%i"fuelvid ] );
TextDrawSetStringg_Player][ td_fuel ], tdstring ); 

Also, you should check if g_Player[ i ][ td_fuel ] - Textdraw is created and used.
  Reply
#3
(2020-10-24, 05:35 PM)Expert* Wrote: F

TextDrawSetString([td_fuel][i], tdstring);





btw,

start using this: sizeof( tdstring ) -1

So:





PHP Code:
new tdstring32 ];

formattdstringsizeoftdstring ) - 1"Fuel:%i"fuelvid ] );

TextDrawSetStringg_Player][ td_fuel ], tdstring ); 



Also, you should check if g_Player[ i ][ td_fuel ] - Textdraw is created and used.





Thank You that helping me so much :)
  Reply


Forum Jump: