Raised This Month: $51 Target: $400
 12% 

Run time error 11: divide


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Id0x.
Junior Member
Join Date: Dec 2020
Old 02-13-2022 , 07:52   Run time error 11: divide
Reply With Quote #1

HTML Code:
L 02/08/2022 - 10:47:33: [AMXX] Displaying debug trace (plugin "dmc233.amxx", version "2.33")
L 02/08/2022 - 10:47:33: [AMXX] Run time error 11: divide 
L 02/08/2022 - 10:47:33: [AMXX]    [0] dmc233.sma::ShowVoteMenu (line 1122)
L 02/08/2022 - 10:47:33: [AMXX]    [1] dmc233.sma::Counter (line 1074)
L 02/08/2022 - 10:47:33: [AMXX]    [2] dmc233.sma::StartMapChooser (line 961)
L 02/08/2022 - 10:47:33: [AMXX]    [3] dmc233.sma::VoteCounter (line 711)
Line 1122:
PHP Code:
MapPercent[Num] = ((MapVote[Num]*100)/(AllVotes)); 
Line 1074:
PHP Code:
ShowVoteMenu(Num); 
Line 961:
PHP Code:
Counter(); 
Line 711:
PHP Code:
StartMapChooser(); 
Attached Files
File Type: sma Get Plugin or Get Source (dmc233.sma - 59 views - 41.9 KB)

Last edited by Id0x.; 02-13-2022 at 07:53.
Id0x. is offline
Shadows Adi
AlliedModders Donor
Join Date: Aug 2019
Location: Romania
Old 02-13-2022 , 08:08   Re: Run time error 11: divide
Reply With Quote #2

Try to round the number using floatround()

Code:
MapPercent[Num] = floatround((MapVote[Num]*100 ) / AllVotes);
__________________


Accepting Paid Requests, contact PM.

MVP Of The Round View project on GITHUB / AlliedModders
CSGO REMAKE ~ CSGO MOD [STABLE + SOURCE CODE]
Shadows Adi is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 02-13-2022 , 11:32   Re: Run time error 11: divide
Reply With Quote #3

Make sure AllVotes is not 0 before you divide by it. You can not divide something by 0.
__________________
HamletEagle is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 09:45.


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