SA-MP Forums Archive
Need help with random clothes price - 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: Need help with random clothes price (/showthread.php?tid=115044)



Need help with random clothes price - KuHS - 22.12.2009

Hello, i want to make a clothes shop. I almost made it, but the problem is, i don't know how to give clothes static random price. I think the best way is to set the each clothe price then starting the GM.

I have made this list for a clothes id:
Код:
new victimskin[]={2,7,17,19,20,21,22,23,24,25,46,47,48,59,60,98,101,113,124,127,147,170,179,184,185,187,206,217,223,240,250,258,259,261}
And I tried:
Код:
victimskinp[]={sizeof(victimskin))}
<-- error 001: expected token: "}", but found ")"
Код:
victimskinp[]={random(300)}
<-- PAWNO crash

I think the last way is to use for.
Or just add prices self for all clothes.

Any ideas?

EDIT: I have made it self. Thanks for helping.


Re: Need help with random clothes price - LarzI - 22.12.2009

pawn Код:
new rand = random(sizeof(victimskinp));
new price = victimskinp[rand];



Re: Need help with random clothes price - KuHS - 22.12.2009

Quote:
Originally Posted by lrZ^ aka LarzI
pawn Код:
new rand = random(sizeof(victimskinp));
new price = victimskinp[rand];
It's not static, i need static prices. Example: I restart GM and the prices changes.
But thanks anyway.

EDIT: I have made it self. Thanks for helping.