How do I check if the remainder is zero?
#1

Yes it's just math but I don't know how to write it in Pawn, First time I use Remainder in my script

Let's say FireHealth is the HP of the ongoing fire
I want to gametext the player something when FireHealth is divided by 20 and remainder equals 0
(Fire HP starts with 100, it will gametext on 80 60 40 20)

if(FireHealth/20 == 0)
{
GameTextForPlayer etc etc
}

Is there a shorter version for FireHealth/20 == 0 ?
Reply
#2

Simply use the modulo operator.
PHP код:
if(FireHealth 20 == 0
Reply
#3

Quote:
Originally Posted by Vince
Посмотреть сообщение
Simply use the modulo operator.
PHP код:
if(FireHealth 20 == 0
Exactly ! I forgot the percent sign
Thanks
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)