PutPlayerInAmptyVehicleSeat(VehicleId, PlayerId)
#1

Hey,

Is there a function like that? (Title)

Thanks!
Reply
#2

hi, what do you want this command for??
Reply
#3

It isnt a command, a function, for detaining (put a cuffed player) in an empty vehicle seat where the police is in, i use now PutPlayerInVehicle but thats not very stabel when there are more players in the car.
Reply
#4

Yeah, I use PutPlayerInVehicle on my server. I think that they only is PutPlayerInVehicle. i may post back after talking to some other scripters
Reply
#5

I now there isnt a function like that, but how can i make it?
Reply
#6

GetVehicleSeat(vid,seat);


i dont test it but i think it works

pawn Код:
stock youfuncnamme(playerid,player)
{
new vid,seats,count;
GetVehicleID(playerid,vid);
GetVehicleSeats(vid,seats);
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(GetPlayerVehicleID(i) == vid)
{
count++;
}
if(count == 4) return 0;
PutPlayerInVehicle(player,vid,seats);
}
}
return 1;
}
youfuncname(cop,player);

i dont know it is work
Reply
#7

pawn Код:
stock youfuncnamme(vehicleid,playerid)
{
    new bool:Seat[4];
    for(new i;i<MAX_PLAYERS;i++)
    {
        if(IsPlayerConnected(i))
        {
            if(IsPlayerInVehicle(i,vehicleid))
            {
                if(GetPlayerVehicleSeat(i) == 0) Seat[0] = true;
                if(GetPlayerVehicleSeat(i) == 1) Seat[1] = true;
                if(GetPlayerVehicleSeat(i) == 2) Seat[2] = true;
                if(GetPlayerVehicleSeat(i) == 3) Seat[3] = true;
            }
        }
    }
    for(new a;a<sizeof(Seat);i++)
    {
        if(Seat[a] == false) PutPlayerInVehicle(playerid,vehicleid,a);
    }
    return 1;
}
Reply
#8

ahh ty in my code i forgot to get seats using loop ty ^^
Reply
#9

Thanks works now.
1 error, but it was a mistake.
Код:
public PutPlayerInEmptyVehicleSeat(vehicleid,playerid)
{
    new bool:Seat[4];
    for(new i;i<MAX_PLAYERS;i++)
    {
        if(IsPlayerConnected(i))
        {
            if(IsPlayerInVehicle(i,vehicleid))
            {
                if(GetPlayerVehicleSeat(i) == 0) Seat[0] = true;
                if(GetPlayerVehicleSeat(i) == 1) Seat[1] = true;
                if(GetPlayerVehicleSeat(i) == 2) Seat[2] = true;
                if(GetPlayerVehicleSeat(i) == 3) Seat[3] = true;
            }
        }
    }
    for(new a;a<sizeof(Seat);i++)
    {
        if(Seat[a] == false) PutPlayerInVehicle(playerid,vehicleid,a);
    }
    return 1;
}
Good:
Код:
public PutPlayerInEmptyVehicleSeat(vehicleid,playerid)
{
    new bool:Seat[4];
    for(new i;i<MAX_PLAYERS;i++)
    {
        if(IsPlayerConnected(i))
        {
            if(IsPlayerInVehicle(i,vehicleid))
            {
                if(GetPlayerVehicleSeat(i) == 0) Seat[0] = true;
                if(GetPlayerVehicleSeat(i) == 1) Seat[1] = true;
                if(GetPlayerVehicleSeat(i) == 2) Seat[2] = true;
                if(GetPlayerVehicleSeat(i) == 3) Seat[3] = true;
            }
        }
    }
    for(new a;a<sizeof(Seat);a++)
    {
        if(Seat[a] == false) PutPlayerInVehicle(playerid,vehicleid,a);
    }
    return 1;
}
Thanks!
Reply
#10

Works nicely.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)