#MAKAR
Компетентный
Ко всем new добавим
PHP:
new LoaderObject[MAX_PLAYERS];
В public OnPlayerStateChange(playerid, newstate, oldstate) добавим
PHP:
if(newstate == PLAYER_STATE_DRIVER)
{
new newcar = GetPlayerVehicleID(playerid);
if(GetVehicleModel(newcar) == 530)
{
SetPlayerCheckpoint(playerid,2786.6150,-2388.9102,13.6340,1.5); SetPVarInt(playerid,"loadercar_point",1);
SendClientMessage(playerid,COLOR_WHITE,"Отвезите ящики в ангар.");
}
В public OnPlayerExitVehicle(playerid,vehicleid) добавим
PHP:
if(GetPVarInt(playerid,"loadercar_point") == 1) DisablePlayerCheckpoint(playerid);
if(GetPVarInt(playerid,"loadercar_point") == 2)
{
DestroyObject(LoaderObject[playerid]); DisablePlayerCheckpoint(playerid);
}
В public OnPlayerEnterCheckpoint(playerid) добавим
PHP:
if(GetPVarInt(playerid,"loadercar_point") == 1 && IsPlayerInRangeOfPoint(playerid,2,2786.6150,-2388.9102,13.6340))
{
SendClientMessage(playerid,COLOR_WHITE,"Отвезите ящик в ангар."); DisablePlayerCheckpoint(playerid); LoaderObject[playerid] = CreateObject(1271,0,0,0,0,0,0);
SetPlayerCheckpoint(playerid,2795.5991,-2417.5195,13.6318,1.5); SetPVarInt(playerid,"loadercar_point",2);
AttachObjectToVehicle(LoaderObject[playerid],GetPlayerVehicleID(playerid),0.0,0.6,0.3,0.0,0.0,0.0);
}
if(GetPVarInt(playerid,"loadercar_point") == 2 && IsPlayerInRangeOfPoint(playerid,2,2795.5991,-2417.5195,13.6318))
{
SendClientMessage(playerid,COLOR_WHITE, "Вы доставили ящик. Везите следующий.");
DisablePlayerCheckpoint(playerid); DestroyObject(LoaderObject[playerid]);
SetPlayerCheckpoint(playerid,2786.6150,-2388.9102,13.6340,1.5); SetPVarInt(playerid,"loadercar_point",1);
}
Автор данного урока - #MAKAR
