AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   [AMXX] Run time error 11: divide (https://forums.alliedmods.net/showthread.php?t=190020)

striker07 07-13-2012 18:44

[AMXX] Run time error 11: divide
 
What am i doing wrong here?
ingame it doesnt divide the 2 vallues, the result is always 0.00 no matter ho many kills or deaths id has

PHP Code:

new Msg[512];
new 
ratio = ((g_iKills[id]) / (g_iDeaths[id]));
set_hudmessage(g_Redg_Greeng_Blue0.41, -0.890_0.20.10.11);
 
format(Msg,511," Level: %i   Exp: %i /%i ^n Kills: %i  Deaths: %i  K/D-Ratio: %.2f"g_iLevel[id], g_iXP[id], required_xp(id),  g_iKills[id], g_iDeaths[id], ratio );
 
ShowSyncHudMsg(idg_iSyncMsg); 


Exolent[jNr] 07-13-2012 18:58

Re: [AMXX] Run time error 11: divide
 
Quote:

Originally Posted by striker07 (Post 1749847)
What am i doing wrong here?
ingame it doesnt divide the 2 vallues, the result is always 0.00 no matter ho many kills or deaths id has

PHP Code:

new Msg[512];
new 
ratio = ((g_iKills[id]) / (g_iDeaths[id]));
set_hudmessage(g_Redg_Greeng_Blue0.41, -0.890_0.20.10.11);
 
format(Msg,511," Level: %i   Exp: %i /%i ^n Kills: %i  Deaths: %i  K/D-Ratio: %.2f"g_iLevel[id], g_iXP[id], required_xp(id),  g_iKills[id], g_iDeaths[id], ratio );
 
ShowSyncHudMsg(idg_iSyncMsg); 


PHP Code:

new Float:ratio float(g_iKills[id]) / float(g_iDeaths[id]); 

Quote:

Originally Posted by Artifact (Post 1749854)
required_xp(id) = required_xp[id]

That's not the error.

striker07 07-13-2012 19:39

Re: [AMXX] Run time error 11: divide
 
nice, thanks exolent.
it's working perfectly now :)


All times are GMT -4. The time now is 15:23.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.