how give random player weapon?
#7

pawn Код:
RandomPlayerID()
{
    new
        RandomID[MAX_PLAYERS],
        Players = 0;

    for(new i=0; i != MAX_PLAYERS; i++)
        if(IsPlayerConnected(i))
            RandomID[Players++] = i;

    if(!Players)
        return INVALID_PLAYER_ID;

    return RandomID[random(Players)];
}

new WinnerID = RandomPlayerID();
if(WinnerID != INVALID_PLAYER_ID)
{
    GivePlayerWeapon(WinnerID,WeaponID,Ammo);
}
Reply


Messages In This Thread
how give random player weapon? - by EitayEliyahu - 05.08.2013, 15:57
Re: how give random player weapon? - by Sliceofdeath - 05.08.2013, 16:01
Re: how give random player weapon? - by Konstantinos - 05.08.2013, 16:02
Re: how give random player weapon? - by EitayEliyahu - 05.08.2013, 16:03
Re: how give random player weapon? - by Sliceofdeath - 05.08.2013, 16:04
Re: how give random player weapon? - by EitayEliyahu - 05.08.2013, 16:06
Re: how give random player weapon? - by Jefff - 05.08.2013, 16:39
Re: how give random player weapon? - by RajatPawar - 05.08.2013, 16:43

Forum Jump:


Users browsing this thread: 6 Guest(s)