You are not logged in.

_Gatsch_

Trainee

  • "_Gatsch_" started this thread

Posts: 65

Location: Österreich

Occupation: Mechatroniker

wcf.user.option.userOption53: Nein

  • Send private message

1

Friday, March 29th 2013, 7:52pm

SourcePawn Frage

Hallo ;)

Ich habe eine Frage,

wie schreibt man etwas um einen zufälligen Spieler zu bekommen oder um mehrere zufällige Spieler am Server zu bekommen an denen dann was ausgeführt werden soll.?

Vielen Dank schon mal :)


LeXx

Unregistered

2

Friday, March 29th 2013, 7:59pm


_Gatsch_

Trainee

  • "_Gatsch_" started this thread

Posts: 65

Location: Österreich

Occupation: Mechatroniker

wcf.user.option.userOption53: Nein

  • Send private message

3

Friday, March 29th 2013, 8:02pm

Was ist da zu wenig Information wenn ich nur eine Frage habe es besteht ja kein Problem oder sonst was, wo ich etwas dazuschreiben könnte.


Impact

Super Moderator

Posts: 1,276

wcf.user.option.userOption53: Nein

  • Send private message

4

Friday, March 29th 2013, 8:11pm

Offensichtlich hast du Google nicht bemüht, aber gut, das hier sollte dir einen Überblick verschaffen wie man so eine Funktion schreibt.

PHP Source code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
stock Functionsname(...)
{
    new tRandClient[MaxClients];
    new tRandCount;
    for(new i<= MaxClientsi++)
    {
        if(/* Deine Validatorfunktion */)
        {
            tRandClient[tRandCount] = i;
            tRandCount++;
        }
    }
    
    return tRandClient[GetRandomInt(0tRandCount-1)];
}

Vergiss die Index Checks nicht.

MfG
Impact

Similar threads

Used tags

Source Pawn