21.02.2019, 10:05
Код:
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."); }