Random skins from variables
#1

How would I get random skins for these variables:

Код:
tData[1][Skin1],
tData[1][Skin2],
tData[1][Skin3],
tData[1][Skin4]
Each of these variables are assigned a skin value, how would I randomize to use one of those variables?
Reply
#2

pawn Код:
new rand = random(4);
switch(rand)
{
    case 0: return tData[1][Skin1];
    case 1: return tData[1][Skin2];
    case 2: return tData[1][Skin3];
    case 3: return tData[1][Skin4];
}
Not what you mean? Then explain what context you are trying to use it, and what it would be used for.
Reply
#3

thats exactly what i was looking for, thanks
Reply
#4

I'd recommend putting the skins available into an array and accessing them randomly under OnPlayerSpawn or whatever. That's a much better method than listing up all the cases.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)