SA-MP Forums Archive
Required XP - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Required XP (/showthread.php?tid=611381)



Required XP - GoldenLion - 05.07.2016

Hello, I added levels and experience points today to my server but requiredxp doesn't seem to work properly.
Here is the code:

Код:
new Float:requiredxp;
	
if (PlayerData[playerid][pLevel] == 1) requiredxp = 8;
else requiredxp = PlayerData[playerid][pLevel]*6;
The result of it is that the requiredxp is 1000000000+. What's wrong with the code?


Re: Required XP - DTV - 05.07.2016

Why is it a float? Just use "new requiredxp;"


Re: Required XP - Kaliber - 05.07.2016

Quote:
Originally Posted by GoldenLion
Посмотреть сообщение
new Float:requiredxp;
This shoudn't be a float

Just
PHP код:
new requiredxp



Re: Required XP - GoldenLion - 05.07.2016

Oh, I read somewhere that it will be more accurate if it would be a float, I'll try it, thanks.


Re: Required XP - MarkNelson - 05.07.2016

XP for what? Zombie server first?


Re: Required XP - GoldenLion - 05.07.2016

Quote:
Originally Posted by MarkNelson
Посмотреть сообщение
XP for what? Zombie server first?
XP to level up, it's a roleplay server. Removing float helped.