SA-MP Forums Archive
all the names of players in a vehicle - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: all the names of players in a vehicle (/showthread.php?tid=191982)



all the names of players in a vehicle - The_Gangstas - 21.11.2010

pawn Код:
new pcount, v;
        foreach(Player,i)
        {
            if(IsPlayerInVehicle(i)
            {
                for(v=1;v<MAX_VEHICLES;v++)
                {
                    if(GetPlayerVehicleID(i) == VehicleBombed[v])
                    {
                        pcount++;
                    }
                }
            }
        }
how i get each of there ids and say there names in 1 textdraw?


Re: all the names of players in a vehicle - Retardedwolf - 21.11.2010

pawn Код:
stock
    whatEver ( vehicleid )
{
    new
        string [ 128 ],
        pName [ MAX_PLAYER_NAME + 2]
    ;

    foreach (Player, i)
    {
        if ( IsPlayerInVehicle ( i, vehicleid ) )
        {
            GetPlayerName ( playerid, pName, MAX_PLAYER_NAME );
            strins ( pName, ",", strlen ( pName ) - 1 );
            strins ( string, pName, strlen ( string ) );

        }
    }
    TextDrawSetString ( whatEver, string );
    return 1;
}



Re: all the names of players in a vehicle - The_Gangstas - 21.11.2010

that would return 1 name... and the last name that is found in the vehicle i believe..


Re: all the names of players in a vehicle - Retardedwolf - 21.11.2010

Quote:
Originally Posted by The_Gangstas
Посмотреть сообщение
that would return 1 name... and the last name that is found in the vehicle i believe..
It wasn't supposed to return the name, You said for it to be in a textdraw thats why I set it into a textdraw and It wouldn't get the last name it should actually work even tho I have never tried.


Re: all the names of players in a vehicle - The_Gangstas - 21.11.2010

just realized what u did, ty! any help here? https://sampforum.blast.hk/showthread.php?tid=191942