Very very weird vars behavior
#1

Hi guys,
I'm doing roleplay test. Everything is fine but when I finish roleplay test I see very weird behavior of vars(two of them).


Code:
	if(_pitanje == 10)
	{
		new _vrijeme_testa = (GetTickCount() - _HRP_RPTestVrijeme[_playerid]) / 1000;
		printf("tik %d - vrijeme %d - uku pno %d", GetTickCount(), _HRP_RPTestVrijeme[_playerid], _vrijeme_testa);
		new _dodatni_bodovi = false;
		new _ocjena = false;
		new Float:_postotak = 0.00;
		new _Upit[312];

		if(0 <= _vrijeme_testa <= 45) _dodatni_bodovi = 4;
		if(45 < _vrijeme_testa <= 60) _dodatni_bodovi = 3;
		if(60 < _vrijeme_testa <= 90) _dodatni_bodovi = 2;
		if(90 < _vrijeme_testa <= 120) _dodatni_bodovi = 1;

		printf("d bodovi %d", _dodatni_bodovi);
		_postotak = ((Bit4_Get(_HRP_RPTestTocnihOdg, _playerid) + _dodatni_bodovi) / 14) * 100;
		printf("postotak %f", _postotak);

		if(0.00 <= _postotak <= 50.00) _ocjena = 1;
		if(50.00 < _postotak <= 65.00) _ocjena = 2;
		if(65.00 < _postotak <= 75.00) _ocjena = 3;
		if(75.00 < _postotak <= 90.00) _ocjena = 4;
		if(90.00 < _postotak <= 100.00) _ocjena = 5;
		if(_dodatni_bodovi == 0) _ocjena = 1; // ZBOG PREVIЉE VREMENA

		printf("d bodovi %d", _dodatni_bodovi);
		printf("postotak %f", _postotak);
		if(_ocjena != 1)
		{
			new _ocjene[4][] =
			{
				""_HRP_NARANCASTA"Dovoljan (2)",
				""_HRP_ZUTA"Dobar (3)",
				""_HRP_TZELENA"Vrlo dobar (4)",
				""_HRP_SZELENA"Odličan (5)"		
			};	

			Bit1_Set(_HRP_RPLekcija, _playerid, 15);		
			if(!_kazna)
			{
				format(_Upit, 312,
				""_HRP_BIJELA"Uspjeљno ste proљli roleplay test, sada ste slobodan igrač!\n\nVaљ Rezultat:\n- Točnih odgovora: "_HRP_SZELENA"%d"_HRP_BIJELA"/10\n- Bodovi: "_HRP_SZELENA"%d"_HRP_BIJELA"/10\n- Ukupno vrijeme: "_HRP_SZELENA"%d"_HRP_BIJELA" s\n- Bodovi na vrijeme: "_HRP_SZELENA"%d"_HRP_BIJELA"/4\n- Postotak: "_HRP_SZELENA"%.2f %%"_HRP_BIJELA"\n- Ocjena: %s",
				Bit4_Get(_HRP_RPTestTocnihOdg, _playerid), Bit4_Get(_HRP_RPTestTocnihOdg, _playerid), _vrijeme_testa, _dodatni_bodovi, _postotak, _ocjene[_ocjena - 2]);
				_HRP_Dialog(_playerid, _HRP_DIALOG_RPTEST_GOTOV, DIALOG_STYLE_MSGBOX, "Čestitamo!", _Upit, "OK", " ");
				PlayerPlaySound(_playerid, 1056, 0.0, 0.0, 0.0);
				printf("lennna %d", strlen(_Upit));
			}

			format(_Upit, 112, "UPDATE "_HRP_MYSQL_USR" SET RPTest = 0, RPTestBodovi = %d, RPTestVrijeme = %d WHERE ID = %d", Bit4_Get(_HRP_RPTestTocnihOdg, _playerid) + _dodatni_bodovi, _vrijeme_testa, _HRP_ID(_playerid));
			mysql_tquery(_HRP_baza, _Upit);
		}
		else
		{
			format(_Upit, 312,
			""_HRP_BIJELA"Naћalost, pali ste roleplay test.\n\nVasљ Rezultat:\n- Točnih odgovora: "_HRP_SCRVENA"%d"_HRP_BIJELA"/10\n- Bodovi: "_HRP_SCRVENA"%d"_HRP_BIJELA"/10\n- Ukupno vrijeme: "_HRP_SCRVENA"%d"_HRP_BIJELA" s\n- Bodovi na vrijeme: "_HRP_SCRVENA"%d"_HRP_BIJELA"/4\n- Postotak: "_HRP_SCRVENA"%.2f %%"_HRP_BIJELA"\n- Ocjena: "_HRP_SCRVENA"Nedovoljan (1)",
			Bit4_Get(_HRP_RPTestTocnihOdg, _playerid), Bit4_Get(_HRP_RPTestTocnihOdg, _playerid), _vrijeme_testa, _dodatni_bodovi, _postotak);
			_HRP_Dialog(_playerid, _HRP_DIALOG_RPTEST_PAO, DIALOG_STYLE_MSGBOX, "Pali ste!", _Upit, "RP lekcija", "Ponovno");
			PlayerPlaySound(_playerid, 1055, 0.0, 0.0, 0.0);
		}
		return (true);
	}


// AT THE START OF THE EXAM
		case 13:
		{
			stop _HRP_RPLekcijaTimer[_playerid];
			_HRP_OcistiChat(_playerid);

			_HRP_HaswellaRPTest(_playerid, _kazna);
			_HRP_RPTestVrijeme[_playerid] = GetTickCount(); // LOOK HERE
			return (true);
		}
Quote:

[13.12.2015. 23:19:54] tik 436208149 - vrijeme 0 - uku pno D (WRONG OPERATOR)
[13.12.2015. 23:19:54] d bodovi 0 (var _dodatni_bodovi)
[13.12.2015. 23:19:54] postotak 0.000000
[13.12.2015. 23:19:54] d bodovi 0 // LAST PRINT OF ADDITIONAL POINTS(_dodatni_bodovi=
[13.12.2015. 23:19:54] postotak 0.000000

I'm not sure where's a problem. Tick is 436208149 but _HRP_RPTestVrijeme[_playerid] is zero(I don't Know how). I check whole statment but there's no problem. Thanks guys

Here's a image from game

http://i.imgur.com/PtG88nq.jpg
Reply


Messages In This Thread
Very very weird vars behavior - by vannesenn - 13.12.2015, 21:36
Re: Very very weird vars behavior - by vannesenn - 13.12.2015, 22:45
Re: Very very weird vars behavior - by vannesenn - 14.12.2015, 08:34
Re: Very very weird vars behavior - by Sithis - 14.12.2015, 14:12
Re: Very very weird vars behavior - by vannesenn - 14.12.2015, 16:38

Forum Jump:


Users browsing this thread: 3 Guest(s)