SA-MP Forums Archive
When i bet someone the money will come back help me ! - 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)
+--- Thread: When i bet someone the money will come back help me ! (/showthread.php?tid=626937)



When i bet someone the money will come back help me ! - FizzyWalshy - 22.01.2017

Remove -Fixed.


Re: When i bet someone the money will come back help me ! - Sew_Sumi - 22.01.2017

What are you doing?

Код:
GivePlayerMoney(randomNumbers[0] > randomNumbers[1] ? inviter : playerid, amount);
GivePlayerMoney(randomNumbers[0] > randomNumbers[1] ? playerid : inviter, -amount);
This seems advanced, yet for what?



What I'm saying is, why so complicated for such a simple task? It looks like you should redo the entire bottom of this script (From the else down first off, but could extend to the rest of the script needing to be redone somehow)


Re: When i bet someone the money will come back help me ! - SyS - 22.01.2017

Quote:
Originally Posted by Sew_Sumi
Посмотреть сообщение
What are you doing?

Код:
GivePlayerMoney(randomNumbers[0] > randomNumbers[1] ? inviter : playerid, amount);
GivePlayerMoney(randomNumbers[0] > randomNumbers[1] ? playerid : inviter, -amount);
This seems advanced, yet for what?

What I'm saying is, why so complicated for such a simple task? It looks like you should redo the entire bottom of this script (From the else down first off, but could extend to the rest of the script needing to be redone somehow)
Simple he is using dice throwing minigame. Two players will throw dice whomever throws greater number will get money from the other guy

Debug the targeteid on that command.Better one should be using zcmd and scan params instead of that strcmp and cmd text.Also using pvars in this case is not a good idea. Use player enum holding data of each player. As sew said the code can be simplified more and need to rewritten.


Re: When i bet someone the money will come back help me ! - Sew_Sumi - 22.01.2017

I asked the OP to explain so he could be more clear in what he's aiming for, as that alone is quite often a good path towards debugging.

You know, when you run it through yourself when someone asks about it and you go "Oh damn, what the heck was I thinking?!"


I was also hinting at the old "Keep it simple stupid" technique. Making things overly complicated can bite you on the ass at times.


Re: When i bet someone the money will come back help me ! - FizzyWalshy - 22.01.2017

Can someone fixed this to me please!


Re: When i bet someone the money will come back help me ! - Sew_Sumi - 22.01.2017

That's not what this is for... We don't fix things for you, you can learn to do it...


How did you make the code in the first place?


Re: When i bet someone the money will come back help me ! - FizzyWalshy - 22.01.2017

nah i just get that script


Re: When i bet someone the money will come back help me ! - Sew_Sumi - 22.01.2017

Should almost learn to make a new one. Main things to take note of would be where it does do the randomizing and the commands and messages for the script itself.