Rob cmd
#1

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
Reply
#2

make it then
Reply
#3

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
Reply
#4

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
Reply
#5

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
Reply
#6

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.
Reply
#7

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

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.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)