SA-MP Forums Archive
Bot selected as bonus - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Bot selected as bonus (/showthread.php?tid=508372)



Bot selected as bonus - Ananisiki - 21.04.2014

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))
    {



Re: Bot selected as bonus - SkittlesAreFalling - 21.04.2014

Selected for what?


Re: Bot selected as bonus - Ananisiki - 21.04.2014

Bonus game (player)


Re: Bot selected as bonus - BlackWolf120 - 21.04.2014

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...



Re: Bot selected as bonus - SkittlesAreFalling - 21.04.2014

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


Re: Bot selected as bonus - BlackWolf120 - 21.04.2014

should work.

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


regards, wolf.


Re: Bot selected as bonus - Ananisiki - 21.04.2014

Still the same....


Re: Bot selected as bonus - SkittlesAreFalling - 21.04.2014

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


Re: Bot selected as bonus - Ananisiki - 21.04.2014

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


Re: Bot selected as bonus - SkittlesAreFalling - 21.04.2014

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