random weaps
#5

Ah, now i get it:

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));
random(sizeof(wepsid));
while(
== last[0]) random(sizeof(wepsid));
last[1] = r;
random(sizeof(wepsid));
while(
== last[0] || == last[1]) random(sizeof(wepsid));
last[2] = r;
    
for(new 
i,idxi<sizeof(last); i++)
{
    
idx last[i];
    
GivePlayerWeapon(playerid,wepsid[idx][0],wepsid[idx][1]);

This would generate 3 random numbers, and it is save, that not one number is like the other
Reply


Messages In This Thread
random weaps - by nbx2000 - 16.12.2018, 02:20
Re: random weaps - by nbx2000 - 16.12.2018, 19:33
Re: random weaps - by Kaliber - 17.12.2018, 08:24
Re: random weaps - by nbx2000 - 17.12.2018, 16:30
Re: random weaps - by Kaliber - 17.12.2018, 16:39
Re: random weaps - by Threshold - 18.12.2018, 09:30

Forum Jump:


Users browsing this thread: 1 Guest(s)