Автор - Y.Jeen
Ко всем #define Добавим
- Спойлер:
Ко всем #define Добавим
- Код:
#define zoloto 0xFFD700FF
#define SCM SendClientMessage
#define BYTES_PER_CELL (cellbits /
#define send(%0,%1) SendClientMessage(%0, -1, %1)
- Код:
new InLoaderJob1[MAX_PLAYERS];
new ExitCarTimer[MAX_PLAYERS];
new ExitCount[MAX_PLAYERS];
new plavcar[2];
new PLAV;
new GetJobVehicle[MAX_PLAYERS];
new zmet = 100;
new obj[4];
- Код:
if(strcmp(cmd,"/putavto",true)==0)
{
if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 578)
{
if(PlayerToPoint(15,playerid,2078.46909, -2046.21387, 13.55))
{
if(GetPVarInt(playerid,"job") == 1)
{
DestroyObject(GetPVarInt(playerid, "OBJ"));
SetPVarInt(playerid,"most",0);
SetPVarInt(playerid,"chili",0);
SetPVarInt(playerid,"benz",0),SetPVarInt(playerid,"beach",0);
SetPVarInt(playerid,"job",0);
SetPVarInt(playerid,"CAR",0);
SetPVarInt(playerid,"kg", 200+random(200));
zmet += GetPVarInt(playerid,"kg");
PlayerInfo[playerid][pCash] += GetPVarInt(playerid,"kg");
SendMes(playerid,-1,"{007fff}Машина вышла на {808080}%d кг. {007fff}За нее вы получаете{808080} %d$",GetPVarInt(playerid,"kg"),GetPVarInt(playerid,"kg")*2);
}
}
}
return true;
}
if(strcmp(cmd,"/pickavto",true)==0)
{
if(PlayerToPoint(5,playerid,274.46909, 1224.21387, 15.11920)
|| PlayerToPoint(5,playerid,1351.45691, 478.14441, 19.72580)
|| PlayerToPoint(5,playerid,230.30270, -1887.73645, 0.64160)
|| PlayerToPoint(5,playerid,-2379.47681, -2161.40405, 35.49030))
{
if(GetVehicleModel(GetPlayerVehicleID(playerid)) != 578) return send(playerid, "Вы должны находиться в рабочей машине");
if(InLoaderJob1[playerid] == 0) return SCM(playerid,-1,"Вам запрещено использовать это");
if(GetPVarInt(playerid,"CAR") >= 1) return SendClientMessage(playerid,-1,"Вы не можете взять больше");
if(PlayerToPoint(5,playerid,274.46909, 1224.21387, 15.11920))
{
if(GetPVarInt(playerid,"most") != 1) return true;
SetPVarInt(playerid, "OBJ", CreateObject(3594,0,0,0,0,0,0,100.0));
AttachObjectToVehicle(GetPVarInt(playerid, "OBJ"), GetPlayerVehicleID(playerid), 0,-2,0.1,0,0,0);
DestroyObject(obj[0]),obj[0] = 0;
SetPVarInt(playerid, "CAR", 1);
SetPlayerRaceCheckpoint(playerid,1,2078.46909, -2046.21387, 13.55,0,0,0,5.0);
send(playerid, "Отвезите эту груду металла на завод");
}
if(PlayerToPoint(5,playerid,1351.45691, 478.14441, 19.72580))
{
if(GetPVarInt(playerid,"benz") != 1) return true;
SetPVarInt(playerid, "OBJ", CreateObject(3594,0,0,0,0,0,0,100.0));
AttachObjectToVehicle(GetPVarInt(playerid, "OBJ"), GetPlayerVehicleID(playerid), 0,-2,0.1,0,0,0);
DestroyObject(obj[1]),obj[1] = 0;
SetPVarInt(playerid, "CAR", 1);
SetPlayerRaceCheckpoint(playerid,1,2078.46909, -2046.21387, 13.55,0,0,0,5.0);
send(playerid, "Отвезите эту груду металла на завод");
}
if(PlayerToPoint(5,playerid,230.30270, -1887.73645, 0.64160))
{
if(GetPVarInt(playerid,"beach") != 1) return true;
SetPVarInt(playerid, "OBJ", CreateObject(3594,0,0,0,0,0,0,100.0));
AttachObjectToVehicle(GetPVarInt(playerid, "OBJ"), GetPlayerVehicleID(playerid), 0,-2,0.1,0,0,0);
DestroyObject(obj[2]),obj[2] = 0;
SetPVarInt(playerid, "CAR", 1);
SetPlayerRaceCheckpoint(playerid,1,2078.46909, -2046.21387, 13.55,0,0,0,5.0);
send(playerid, "Отвезите эту груду металла на завод");
}
if(PlayerToPoint(5,playerid,-2379.47681, -2161.40405, 35.49030))
{
if(GetPVarInt(playerid,"chili") != 1) return true;
SetPVarInt(playerid, "OBJ", CreateObject(3594,0,0,0,0,0,0,100.0));
AttachObjectToVehicle(GetPVarInt(playerid, "OBJ"), GetPlayerVehicleID(playerid), 0,-2,0.1,0,0,0);
DestroyObject(obj[3]),obj[3] = 0;
SetPVarInt(playerid, "CAR", 1);
SetPlayerRaceCheckpoint(playerid,1,2078.46909, -2046.21387, 13.55,0,0,0,5.0);
send(playerid, "Отвезите эту груду металла на завод");
}
}
else
{
send(playerid, "Вы далеко от машины");
}
return true;
}
if(strcmp(cmd, "/contract", true) == 0)
{
if(InLoaderJob1[playerid] == 0) return SCM(playerid,-1,"Вам запрещено использовать это");
if(GetVehicleModel(GetPlayerVehicleID(playerid)) != 578) return send(playerid, "Вы должны находиться в рабочей машине");
if(GetPVarInt(playerid,"job") != 0) return send(playerid,"У вас уже есть заказ на доставку");
switch(random(3))
{
case 0:
{
send(playerid, "{1faee9}Нам сообщили что под мостом кто-то бросил свою машину");
send(playerid, "{1faee9}Салон и колеса конечно сняли, но корпус остался. Привези ее нам!");
SetPVarInt(playerid,"most",1),SetPVarInt(playerid,"job",1);
SetPlayerRaceCheckpoint(playerid,1,274.46909, 1224.21387, 15.11920,0,0,0,5.0);
}
case 1:
{
send(playerid, "{1faee9}Люди из деревни сообщили что у них на заправке");
send(playerid, "{1faee9}стоит брошеная машина. Привези ее нам!");
SetPVarInt(playerid,"benz",1),SetPVarInt(playerid,"job",1);
SetPlayerRaceCheckpoint(playerid,1,1351.45691, 478.14441, 19.72580,0,0,0,5.0);
}
case 2:
{
send(playerid, "{1faee9}На пляже Санта Мария вытащили машину из воды и оставили на берегу");
send(playerid, "{1faee9}эта машина, то что нам нужно. Привези ее нам!");
SetPVarInt(playerid,"beach",1),SetPVarInt(playerid,"job",1);
SetPlayerRaceCheckpoint(playerid,1,230.30270, -1887.73645, 0.64160,0,0,0,5.0);
}
case 3:
{
send(playerid, "{1faee9}По новостям передают, что какой-то лихач вылетел на машине с г. Чилиад");
send(playerid, "{1faee9}Губернатор хочет чтоб мы вытащили машину от туда. Привези ее нам!");
SetPVarInt(playerid,"chil",1),SetPVarInt(playerid,"job",1);
SetPlayerRaceCheckpoint(playerid,1,-2379.47681, -2161.40405, 35.49030,0,0,0,5.0);
}
}
}
- Код:
if(PlavCar(GetPlayerVehicleID(playerid)) && GetJobVehicle[playerid] == GetPlayerVehicleID(playerid) && InLoaderJob1[playerid])
{
KillTimer(ExitCarTimer[playerid]);
ExitCount[playerid] = 15;
SCM(playerid, COLOR_ORANGE, "У вас есть 15 секунд чтобы вернуться в машину");
ExitCarTimer[playerid] = SetTimerEx("OnPlayerExitCar", 1000, true, "i", playerid);
return true;
}
- Код:
new vehicleid = GetPlayerVehicleID(playerid);
if(vehicleid >= plavcar[0] && vehicleid <= plavcar[1])
{
if(GetJobVehicle[playerid] == GetPlayerVehicleID(playerid))
{
KillTimer(ExitCarTimer[playerid]);
}
if(InLoaderJob1[playerid] == 0)
{
send(playerid, "Вы не устроились на работу");
RemovePlayerFromVehicle(playerid);
}
else
{
GetJobVehicle[playerid] = GetPlayerVehicleID(playerid);
}
}
- Код:
if(pickupid == PLAV)
{
if(InLoaderJob1[playerid] == 1) SPD(playerid,61,0,"Работа \"Доставщик металла\"","Вы действительно хотите уволиться с работы?","Да","Нет");
else SPD(playerid,60,0,"Работа \"Доставщик металла\"","Вы собираетесь устроиться доставщиком металла на завод?\n","Да","Нет");
}
- Код:
plavcar[0] = AddStaticVehicleEx(578,2119.8237,-2076.3762,13.5469,139.7245,-1,-1,44); //Glendale
AddStaticVehicleEx(578,2127.6960,-2084.1382,13.5469,129.6978,-1,-1,44); //Clover
plavcar[1] = AddStaticVehicleEx(578,2134.4771,-2090.9631,13.5469,132.8311,-1,-1,44); //Greenwood
- Код:
stock PlavCar(vehicleid)
{
if(vehicleid >= plavcar[0]
&& vehicleid <= plavcar[1]) return true;
return 0;
}
stock SendMes(playerid, color, fstring[], {Float, _}:...)
{
static const
STATIC_ARGS = 3;
new
n = (numargs() - STATIC_ARGS) * BYTES_PER_CELL;
if (n)
{
new
message[154],
arg_start,
arg_end;
#emit CONST.alt fstring
#emit LCTRL 5
#emit ADD
#emit STOR.S.pri arg_start
#emit LOAD.S.alt n
#emit ADD
#emit STOR.S.pri arg_end
do
{
#emit LOAD.I
#emit PUSH.pri
arg_end -= BYTES_PER_CELL;
#emit LOAD.S.pri arg_end
}
while (arg_end > arg_start);
// Push the static format parameters.
#emit PUSH.S fstring
#emit PUSH.C 154
#emit PUSH.ADR message
n += BYTES_PER_CELL * 3;
#emit PUSH.S n
#emit SYSREQ.C format
n += BYTES_PER_CELL;
#emit LCTRL 4
#emit LOAD.S.alt n
#emit ADD
#emit SCTRL 4
return SendClientMessage(playerid, color, message);
}
else
{
return SendClientMessage(playerid, color, fstring);
}
}
- Код:
PLAV = CreatePickup(1275, 23,2093.0083,-2066.1826,13.5469,0);
Create3DTextLabel("Взять заказ: /contract\nЗагрузить: /pickavto\nВыгрузить: /putavto", zoloto, 2111.6228,-2077.6350,13.5544, 20.0, 0, 0);