whats wrong - 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: whats wrong (
/showthread.php?tid=65310)
whats wrong -
Robbin237 - 11.02.2009
if(FirstTime = true)
{
printf("The Bank Has Currently $%s To Give Away To Poor Players.", BankMoney);
FirstTime = false;
}
NewMoney = BankMoney;
OldMoney = BankMoney;
if(NewMoney > OldMoney)
{
printf("The Bank Has Currently $%s To Give Away To Poor Players.", BankMoney);
}
Whats wrong with this??!
Re: whats wrong -
Nero_3D - 11.02.2009
it looks like (for me it looks so with that piece of code)
NewMoney and OldMoney is the same so the if statment would never be true
And I think its hard to image your problem, maybe just explain whats not working so we dont need first so search whats not ok
Re: whats wrong -
Robbin237 - 11.02.2009
Ok look, this function is in a timer (ive put on the top firsttime = true ) so it displays its only once at the start as you can see. I want to check if the value in the ini changed, and then if it did, display the message again. Thats what i want.
Re: whats wrong -
Nero_3D - 11.02.2009
than post next time a complete script with headers :S or say where it belongs too (how you did now)
pawn Код:
public Timer()
{
static OldMoney = 0x7F800000;
new NewMoney = dini_Int("status.ini", "BankMoney");
if(NewMoney > OldMoney)
{
printf("The Bank Has Currently $%s To Give Away To Poor Players.", NewMoney - OldMoney);
}
else if(OldMoney > NewMoney)
{
printf("The Bank Has Currently Lost $%s.", OldMoney - NewMoney);
}
OldMoney = NewMoney;
}
Now it will print something when the value got raised and when it got lowered
and you dont need to write each word with a big starting letter