17.12.2018, 16:39
Ah, now i get it:
This would generate 3 random numbers, and it is save, that not one number is like the other
PHP код:
stock const wepsid[][] =
{
{28,100}, //
{22,200}, //
{31,300}, //
{42,400}, //
{26,500} //
};
new last[] = {-1,-1,-1},r;
last[0] = random(sizeof(wepsid));
r = random(sizeof(wepsid));
while(r == last[0]) r = random(sizeof(wepsid));
last[1] = r;
r = random(sizeof(wepsid));
while(r == last[0] || r == last[1]) r = random(sizeof(wepsid));
last[2] = r;
for(new i,idx; i<sizeof(last); i++)
{
idx = last[i];
GivePlayerWeapon(playerid,wepsid[idx][0],wepsid[idx][1]);
}