Bot selected as bonus
#1

Hi, i have bot in my server, sometimes the bot get selected but i dont want this, how i do?


pawn Код:
if(randomid == INVALID_PLAYER_ID || !IsPlayerConnected(randomid))
    {
Reply
#2

Selected for what?
Reply
#3

Bonus game (player)
Reply
#4

We do not know how you do "select" the players but i assume you are using a loop...
pawn Код:
if(IsPlayerNPC(playerid))continue; //will skip the ID when the the ID is used by a bot
else //do stuff, e.g. add real player IDs to an array to make them selectable later on...
Reply
#5

if(randomid == INVALID_PLAYER_ID || ! IsPlayerConnected(randomid) || IsPlayerNPC(randomid)) {
// Do not select this npc or non-player.
}
Reply
#6

should work.

Please use [ pawn ] [ /pawn ] tags in future as its easier to read the code then


regards, wolf.
Reply
#7

Still the same....
Reply
#8

Mine should've worked, would you please post the code?
Reply
#9

pawn Код:
if(randomid == INVALID_PLAYER_ID || !IsPlayerConnected(randomid) || IsPlayerNPC(randomid))
    {
        new onlineids[MAX_PLAYERS];
        new playersonline;
        new pname1[16];
        for(new i=0; i<MAX_PLAYERS; i++)
    {
        if(IsPlayerConnected(i))
        {
            onlineids[playersonline] = i;
            playersonline++;
        }
And so on
Reply
#10

I do not see how that code tells the script to select the player for the bonus game.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)