SA-MP Forums Archive
My Server dosent want anyone to loose money :( - 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: My Server dosent want anyone to loose money :( (/showthread.php?tid=70046)



My Server dosent want anyone to loose money :( - mirkoiz - 22.03.2009

Hello, i have this System:

pawn Код:
new Float:strafkmh = 20;
                                new Float:strafkmh2 = distance-70;
                                new Float:strafe = strafkmh2*strafkmh;
                                SendClientMessage(i, COLOR_YELLOW, "~~~~~~~~~~~~~~~~~~ Geblitzt ~~~~~~~~~~~~~~~~~~");
                                format(string, 256, " Geschwindigkeit: %.0f KM/H        erlaubt: 50 KM/H",distance);
                                SendClientMessage(i, COLOR_YELLOW, string);
                                format(string, 256, " Kosten: %.0f",strafe);
                                SendClientMessage(i, COLOR_YELLOW, string);
                                GivePlayerPCash(i, -strafe);
                                SendClientMessage(i, COLOR_YELLOW, "~~~~~~~~~~~~~~~~~~ Geblitzt ~~~~~~~~~~~~~~~~~~");
All works fine, exempt the GivePLayerPCash...

Pawno says:
pawn Код:
C:\Dokumente und Einstellungen\Plato\Desktop\GM\Euro Version\gamemodes\grl.pwn(8108) : warning 213: tag mismatch

Line:
pawn Код:
GivePlayerPCash(i, -strafe);
Has anyone a Idea?


Re: My Server dosent want anyone to loose money :( - Dujma - 22.03.2009

Because money is not float, it is numeric.


Re: My Server dosent want anyone to loose money :( - mirkoiz - 22.03.2009

Quote:
Originally Posted by Dujma
Because money is not float
any way to get it work?


Re: My Server dosent want anyone to loose money :( - FUNExtreme - 22.03.2009

Change
pawn Код:
new Float:strafe = strafkmh2*strafkmh;
to
new strafe = strafkmh2*strafkmh;



Re: My Server dosent want anyone to loose money :( - mirkoiz - 22.03.2009

i thing this wont work.. because then it says again

2185621795621789 Euro......

but i will try it... but not now because i must get my Visual Basic to work first...

EDIT: WTF?? Again the same warning....


Re: My Server dosent want anyone to loose money :( - Dujma - 22.03.2009

Quote:
Originally Posted by Plato
i thing this wont work.. because then it says again

2185621795621789 Euro......

but i will try it... but not now because i must get my Visual Basic to work first...

EDIT: WTF?? Again the same warning....
Leave those floats and try to change this
pawn Код:
new Float:strafkmh = 20.0;
new Float:strafkmh2 = distance-70.0;
I think the money should work because you are not using any decimals %.0f


Re: My Server dosent want anyone to loose money :( - mirkoiz - 22.03.2009

You are Wrong!

pawn Код:
new Float:strafkmh = 20;
                                new Float:strafkmh2 = distance-70;
                                new Float:strafe = strafkmh2*strafkmh;
                                SendClientMessage(i, COLOR_YELLOW, "~~~~~~~~~~~~~~~~~~ Geblitzt ~~~~~~~~~~~~~~~~~~");
                                format(string, 256, " Geschwindigkeit: %.0f KM/H        erlaubt: 50 KM/H",distance);
                                SendClientMessage(i, COLOR_YELLOW, string);
        Look Here!! >>>>>           format(string, 256, " Kosten: %.0f",strafe);
                                SendClientMessage(i, COLOR_YELLOW, string);
                                GivePlayerPCash(i, -strafe);
                                SendClientMessage(i, COLOR_YELLOW, "~~~~~~~~~~~~~~~~~~ Geblitzt ~~~~~~~~~~~~~~~~~~");

and when i remove the %.Of... then it says xxxxxxxxxxxxxxxxxxxx Money exempt the Real Money


Re: My Server dosent want anyone to loose money :( - Dujma - 22.03.2009

Quote:
Originally Posted by Plato
You are Wrong!

pawn Код:
new Float:strafkmh = 20;
                                new Float:strafkmh2 = distance-70;
                                new Float:strafe = strafkmh2*strafkmh;
                                SendClientMessage(i, COLOR_YELLOW, "~~~~~~~~~~~~~~~~~~ Geblitzt ~~~~~~~~~~~~~~~~~~");
                                format(string, 256, " Geschwindigkeit: %.0f KM/H        erlaubt: 50 KM/H",distance);
                                SendClientMessage(i, COLOR_YELLOW, string);
        Look Here!! >>>>>           format(string, 256, " Kosten: %.0f",strafe);
                                SendClientMessage(i, COLOR_YELLOW, string);
                                GivePlayerPCash(i, -strafe);
                                SendClientMessage(i, COLOR_YELLOW, "~~~~~~~~~~~~~~~~~~ Geblitzt ~~~~~~~~~~~~~~~~~~");
lol I'm saying that you are not using any decimals (1.decimals). That means that you are using %.0f not something like %.3f, %.4f...


Re: My Server dosent want anyone to loose money :( - mirkoiz - 22.03.2009

okay then sry... but why it still says the same when i do this 20.0 and 70.0??


Re: My Server dosent want anyone to loose money :( - ICECOLDKILLAK8 - 22.03.2009

use floatround