all the names of players in a vehicle
#1

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?
Reply
#2

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;
}
Reply
#3

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

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.
Reply
#5

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


Forum Jump:


Users browsing this thread: 1 Guest(s)