Need help with random clothes price
#1

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

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

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


Forum Jump:


Users browsing this thread: 1 Guest(s)