06.08.2011, 13:55
Hey,
Is there a function like that? (Title)
Thanks!
Is there a function like that? (Title)
Thanks!
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;
}
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;
}
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; }
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; }