21.12.2018, 14:20
So guys i trying to create a Basic Fuel FileScript at ZERO i'm not copying anyone!!! i'm having a bad situation my TextDrawTextSize don't change in screen whe the fuel goes down.
i will show you what have in my code.
i have a Settimer when the player enter into the CAR!!
In this image every show the line X in the chat changing and the BAR in left side not change !!!
HERE HAVE DEBUG SERVER !! --------
i will show you what have in my code.
i have a Settimer when the player enter into the CAR!!
Код:
TDEditor_TD[17] = TextDrawCreate(529.375000, 268.066772, "box"); TextDrawLetterSize(TDEditor_TD[17], 0.000000, 0.875000); TextDrawTextSize(TDEditor_TD[17], 524.500000, 0.000000); // 80 px TextDrawUseBox(TDEditor_TD[17], 1); TextDrawBoxColor(TDEditor_TD[17], 344064255);
Код:
rodando = SetTimerEx("Gasolinadoveiculo", 100, true, "i", playerid);
Код:
forward Gasolinadoveiculo(playerid); public Gasolinadoveiculo(playerid) { new Float:gasol = VeiculoInfo[playerid][gasolina];// << this value come 80.000 = full car tank!! new Float:xgaz = 524.500 + gasol; // 524.500 = Empty TANK || 604.500 = FULL TAN.K so 524.500+80.000 = 604.500 new string[128]; format(string, sizeof(string),"%f", xgaz); SendClientMessage(playerid, C_Avisos, string); VeiculoInfo[playerid][gasolina] = gasol - 1.0; // the fuel goes DOWN 604.5 now is 603.5 TextDrawTextSize(TDEditor_TD[17], xgaz, 0.0); // HERE IS THE PROBLEM IT DOES NOT UPDATE THE SCREEN OF THE BAR if ( gasol == 0) { // when the gas 80 == 0 again, call this line and stop timer and kick player from car !! SendClientMessage(playerid, C_Avisos, "there's no more gas in this car"); KillTimer(rodando); RemovePlayerFromVehicle(playerid); } }
Код HTML:
https://imgur.com/HazwIPG
Код:
[12:57:18] 1 - new Float:gasol(0.0) = VeiculoInfo[playerid][gasolina](80.000000); [12:57:18] Resultado 1 | gasol = 80.000000 / VeiculoInfo[playerid][gasolina] = 80.000000 [12:57:18] 2 - new Float:xgaz(0.0) = 524.500 + gasol(80.000000); [12:57:18] Resultado 2 | xgaz = 604.500000 / gasol = 80.000000 [12:57:18] 3 - VeiculoInfo[playerid][gasolina](80.000000) = gasol(80.000000) - 1.0; [12:57:18] Resultado 3 | VeiculoInfo[playerid][gasolina] = 79.000000 / gasol = 80.000000 [12:57:18] 4 - TextDrawTextSize(TDEditor_TD[17], xgaz[604.500000], 0.0); [12:57:18] Resultado 4 | xgaz = 604.500000 ====================================================================== [12:57:18] 1 - new Float:gasol(0.0) = VeiculoInfo[playerid][gasolina](79.000000); [12:57:18] Resultado 1 | gasol = 79.000000 / VeiculoInfo[playerid][gasolina] = 79.000000 [12:57:18] 2 - new Float:xgaz(0.0) = 524.500 + gasol(79.000000); [12:57:18] Resultado 2 | xgaz = 603.500000 / gasol = 79.000000 [12:57:18] 3 - VeiculoInfo[playerid][gasolina](79.000000) = gasol(79.000000) - 1.0; [12:57:18] Resultado 3 | VeiculoInfo[playerid][gasolina] = 78.000000 / gasol = 79.000000 [12:57:18] 4 - TextDrawTextSize(TDEditor_TD[17], xgaz[603.500000], 0.0); [12:57:18] Resultado 4 | xgaz = 603.500000 ====================================================================== [12:57:18] 1 - new Float:gasol(0.0) = VeiculoInfo[playerid][gasolina](78.000000); [12:57:18] Resultado 1 | gasol = 78.000000 / VeiculoInfo[playerid][gasolina] = 78.000000 [12:57:18] 2 - new Float:xgaz(0.0) = 524.500 + gasol(78.000000); [12:57:18] Resultado 2 | xgaz = 602.500000 / gasol = 78.000000 [12:57:18] 3 - VeiculoInfo[playerid][gasolina](78.000000) = gasol(78.000000) - 1.0; [12:57:18] Resultado 3 | VeiculoInfo[playerid][gasolina] = 77.000000 / gasol = 78.000000 [12:57:18] 4 - TextDrawTextSize(TDEditor_TD[17], xgaz[602.500000], 0.0); [12:57:18] Resultado 4 | xgaz = 602.500000 ====================================================================== [12:57:18] 1 - new Float:gasol(0.0) = VeiculoInfo[playerid][gasolina](77.000000); [12:57:18] Resultado 1 | gasol = 77.000000 / VeiculoInfo[playerid][gasolina] = 77.000000 [12:57:18] 2 - new Float:xgaz(0.0) = 524.500 + gasol(77.000000); [12:57:18] Resultado 2 | xgaz = 601.500000 / gasol = 77.000000 [12:57:18] 3 - VeiculoInfo[playerid][gasolina](77.000000) = gasol(77.000000) - 1.0; [12:57:18] Resultado 3 | VeiculoInfo[playerid][gasolina] = 76.000000 / gasol = 77.000000 [12:57:18] 4 - TextDrawTextSize(TDEditor_TD[17], xgaz[601.500000], 0.0); [12:57:18] Resultado 4 | xgaz = 601.500000 ======================================================================