21.02.2019, 09:51
hi so i want to put a player in car but how can i check is a seat empty ? and no other player seats on that seatid ? and if all of them are in use send a mssg to client
CMD:putplayerincar(playerid, params[])
{
new id, seat, vehicle = GetPlayerVehicleID(playerid);
if(sscanf(params,"ud",id,seat)) return SCM(playerid, COLOR_GREY, "USAGE: /putplayerincar [player ID] [seats 1-3]");
if(seat > 3 || seat < 1) return SCM(playerid, COLOR_RED, "ERROR: Pick one 1 or 3.");
if(id == playerid) return SCM(playerid, COLOR_RED, "ERROR: You can't put yourself in a vehicle.");
if(!PlayerInCar(playerid)) return SCM(playerid, COLOR_RED, "ERROR: You have to be in a vehicle.");
if(!PlayerNearPlayer(10.0, playerid, id)) return NotNearPlayerMSG(playerid);
ClearAnimations(id, 1);
PutPlayerInVehicle(id, vehicle, seat);
SCMEx(playerid, COLOR_YELLOW, "-> %s you have put him in a vehicle.", GetNameEx(id));
SCMEx(id, COLOR_YELLOW, "-> %s put you in a vehicle.", GetNameEx(playerid));
return 1;
}
stock NotNearPlayerMSG(playerid)
{
return SCM(playerid, COLOR_RED, "ERROR: You aren't near that player.");
}