SA-MP Forums Archive
Rob cmd - 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: Rob cmd (/showthread.php?tid=366661)



Rob cmd - DizzY2306 - 07.08.2012

Hello guys i was thinking about learning rob command.I know how to take all player money and give it to another player but thats not what i want. I want that /rob commands take different amount of money,not all.Eg. i have 300,000 and someone comes to rob me, ill lose sometimes 10 000, sometimes 26 000 sometiems 120 500 etc...so i want randomize stolen money.
Thanks.
I use:
a_samp
zcmd
sscanf2
streamer
YSI\y_ini
foreach>
YSI\y_timers


Re: Rob cmd - DarrenReeder - 07.08.2012

make it then


Re: Rob cmd - Jstylezzz - 07.08.2012

pawn Код:
new money = GetPlayerMoney(targetid);//we get the targets money and store it in the money variable
new givenmoney = random(money);//here we randomize the money of the target, and store it in the new variable
GivePlayerMoney(playerid,givenmoney);//we give the randomized amount of money to the player
I hope this would bring you a little further


Re: Rob cmd - DizzY2306 - 07.08.2012

Darren i said i know how to make that command but i dont know how to randomize taken money.

Jari thanks ill try it right now


Re: Rob cmd - DizzY2306 - 07.08.2012

Ahh i understand randomizing now but could you tell me how to take that randomzied money? as there isnt take money all i can do is reset but thats not it...if i have 300k and someones takes from me 100k i cant have 0$ lol i need to have 200k
Thanks


Re: Rob cmd - Jstylezzz - 07.08.2012

well, what i gave you is jut a basic code, and you can use that code to do almost everything to the money of you and the target..
if you want to take the amount of money, selected by the random maker, you just do, GivePlayerMoney(target,-givenmoney);
you basically to giveplayermoney, but you put a minus(-) before it, so the script takes it away
this only if you use my code, i don't know how you coded the command you have now..
if it is different, post it here, then i can have a look at it.


Re: Rob cmd - DizzY2306 - 07.08.2012

Ive tryed that but it didnt work...im re writing that command maybe i failed somewhere.Anyway thanks for help, rep +


Re: Rob cmd - Jstylezzz - 07.08.2012

thanks for the rep
anyways, if it still doesn't work, just post it, and i will have a look at it..
it could be the smallest thing that causes it to not work.