Sign in to follow this  
Followers 0
RASTAMAN

Развозчик пиццы | Работа

2 posts in this topic

Работа заключается в том, что нужно по точкам развести достаточно больше пицца, чтобы заработать большую зарплату.Автор: Amfy.

Спойлер

#define PizzaMoney  1000 // Цена за один чекпоинт
#define PizzaTime 300 // Сколько игроку дается времени (в секундах) чтобы доставить пиццы
#define COLOR_LIGHTBLUE  0x33CCFFAA

 

Спойлер

new Float:PizzaCheckpoint[10][3] = {
{2199.6738,-1766.1499,21.4903},
{2431.0461,-1706.7495,21.4876},
{2378.8538,-1862.7435,21.4903},
{2374.2595,-1887.1068,21.4903},
{2409.5942,-2143.4617,21.4864},
{2552.6003,-2195.3875,21.5006},
{2752.5759,-2447.5283,21.2174},
{2326.6321,-1804.7623,21.9824},
{2308.0000,-1912.1495,21.3555},
{2256.9080,-2102.9331,21.4971}
};
new Pizza[2];

 

Спойлер

SetTimer("SecondTimes", 1000, true);
Pizza[0] = AddStaticVehicleEx(448,2143.9517,-1811.9202,18.4989,0.9532,3,6,6000);
AddStaticVehicleEx(448,2147.4592,-1811.8813,18.4981,1.9254,3,6,6000);
AddStaticVehicleEx(448,2150.9919,-1811.8866,18.4972,359.9016,3,6,6000);
AddStaticVehicleEx(448,2154.4307,-1811.8749,18.4980,1.2683,3,6,6000);
AddStaticVehicleEx(448,2157.9902,-1811.8684,18.4989,1.4477,3,6,6000);
AddStaticVehicleEx(448,2161.5176,-1811.8600,18.4980,1.0813,3,6,6000);
Pizza[1] = AddStaticVehicleEx(448,2165.0857,-1811.8517,18.4972,359.9437,3,6,6000);

 

Спойлер

if(strcmp("/job", cmdtext, true, 10) == 0)
{
new carid = GetPlayerVehicleID(playerid);
if(GetVehicleModel(carid) == 448 && GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
{
  SendClientMessage(playerid, COLOR_LIGHTBLUE, "Доставьте пиццу по указанным точкам!");
  SetPlayerCheckpoint(playerid, PizzaCheckpoint[1][0], PizzaCheckpoint[1][1], PizzaCheckpoint[1][2], 2.0);
  SetPVarInt(playerid, "GetPlayerSkin", GetPlayerSkin(playerid));
  SetPlayerSkin(playerid, 155);
  SetPVarInt(playerid, "PizzaTime", gettime() + PizzaTime);
  SetPVarInt(playerid, "PizzaCheck", 1);
  return 1;
}
return 1;
}

 

Спойлер

new carid = GetPlayerVehicleID(playerid);
if(GetPVarInt(playerid, "PizzaCheck") == 1 && GetPVarInt(playerid, "PizzaTime") >= 0 && carid >= Pizza[0] && carid <= Pizza[1])
{
  DisablePlayerCheckpoint(playerid);
  SetPlayerCheckpoint(playerid, PizzaCheckpoint[2][0], PizzaCheckpoint[2][1], PizzaCheckpoint[2][2], 2.0);
  SendClientMessage(playerid, COLOR_LIGHTBLUE, "Вы доставили пиццу!");
    PlayerPlaySound(playerid, 1057, 0.0, 0.0, 0.0);
  SetPVarInt(playerid, "PizzaCheck", 2);
  SetPVarInt(playerid, "PizzaMoney", GetPVarInt(playerid, "PizzaMoney") + PizzaMoney);
  return 1;
}
if(GetPVarInt(playerid, "PizzaCheck") == 2 && GetPVarInt(playerid, "PizzaTime") >= 0 && carid >= Pizza[0] && carid <= Pizza[1])
{
  DisablePlayerCheckpoint(playerid);
  SetPlayerCheckpoint(playerid, PizzaCheckpoint[3][0], PizzaCheckpoint[3][1], PizzaCheckpoint[3][2], 2.0);
  SendClientMessage(playerid, COLOR_LIGHTBLUE, "Вы доставили пиццу!");
    PlayerPlaySound(playerid, 1057, 0.0, 0.0, 0.0);
  SetPVarInt(playerid, "PizzaCheck", 3);
  SetPVarInt(playerid, "PizzaMoney", GetPVarInt(playerid, "PizzaMoney") + PizzaMoney);
  return 1;
}
if(GetPVarInt(playerid, "PizzaCheck") == 3 && GetPVarInt(playerid, "PizzaTime") >= 0 && carid >= Pizza[0] && carid <= Pizza[1])
{
  DisablePlayerCheckpoint(playerid);
  SetPlayerCheckpoint(playerid, PizzaCheckpoint[4][0], PizzaCheckpoint[4][1], PizzaCheckpoint[4][2], 2.0);
  SendClientMessage(playerid, COLOR_LIGHTBLUE, "Вы доставили пиццу!");
    PlayerPlaySound(playerid, 1057, 0.0, 0.0, 0.0);
  SetPVarInt(playerid, "PizzaCheck", 4);
  SetPVarInt(playerid, "PizzaMoney", GetPVarInt(playerid, "PizzaMoney") + PizzaMoney);
  return 1;
}
if(GetPVarInt(playerid, "PizzaCheck") == 4 && GetPVarInt(playerid, "PizzaTime") >= 0 && carid >= Pizza[0] && carid <= Pizza[1])
{
  DisablePlayerCheckpoint(playerid);
  SetPlayerCheckpoint(playerid, PizzaCheckpoint[5][0], PizzaCheckpoint[5][1], PizzaCheckpoint[5][2], 2.0);
  SendClientMessage(playerid, COLOR_LIGHTBLUE, "Вы доставили пиццу!");
    PlayerPlaySound(playerid, 1057, 0.0, 0.0, 0.0);
  SetPVarInt(playerid, "PizzaCheck", 5);
  SetPVarInt(playerid, "PizzaMoney", GetPVarInt(playerid, "PizzaMoney") + PizzaMoney);
  return 1;
}
if(GetPVarInt(playerid, "PizzaCheck") == 5 && GetPVarInt(playerid, "PizzaTime") >= 0 && carid >= Pizza[0] && carid <= Pizza[1])
{
  DisablePlayerCheckpoint(playerid);
  SetPlayerCheckpoint(playerid, PizzaCheckpoint[6][0], PizzaCheckpoint[6][1], PizzaCheckpoint[6][2], 2.0);
  SendClientMessage(playerid, COLOR_LIGHTBLUE, "Вы доставили пиццу!");
    PlayerPlaySound(playerid, 1057, 0.0, 0.0, 0.0);
  SetPVarInt(playerid, "PizzaCheck", 6);
  SetPVarInt(playerid, "PizzaMoney", GetPVarInt(playerid, "PizzaMoney") + PizzaMoney);
  return 1;
}
if(GetPVarInt(playerid, "PizzaCheck") == 6 && GetPVarInt(playerid, "PizzaTime") >= 0 && carid >= Pizza[0] && carid <= Pizza[1])
{
  DisablePlayerCheckpoint(playerid);
  SetPlayerCheckpoint(playerid, PizzaCheckpoint[7][0], PizzaCheckpoint[7][1], PizzaCheckpoint[7][2], 2.0);
  SendClientMessage(playerid, COLOR_LIGHTBLUE, "Вы доставили пиццу!");
    PlayerPlaySound(playerid, 1057, 0.0, 0.0, 0.0);
  SetPVarInt(playerid, "PizzaCheck", 7);
  SetPVarInt(playerid, "PizzaMoney", GetPVarInt(playerid, "PizzaMoney") + PizzaMoney);
  return 1;
}
if(GetPVarInt(playerid, "PizzaCheck") == 7 && GetPVarInt(playerid, "PizzaTime") >= 0 && carid >= Pizza[0] && carid <= Pizza[1])
{
  DisablePlayerCheckpoint(playerid);
  SetPlayerCheckpoint(playerid, PizzaCheckpoint[8][0], PizzaCheckpoint[8][1], PizzaCheckpoint[8][2], 2.0);
  SendClientMessage(playerid, COLOR_LIGHTBLUE, "Вы доставили пиццу!");
    PlayerPlaySound(playerid, 1057, 0.0, 0.0, 0.0);
  SetPVarInt(playerid, "PizzaCheck", 8);
  SetPVarInt(playerid, "PizzaMoney", GetPVarInt(playerid, "PizzaMoney") + PizzaMoney);
  return 1;
}
if(GetPVarInt(playerid, "PizzaCheck") == 8 && GetPVarInt(playerid, "PizzaTime") >= 0 && carid >= Pizza[0] && carid <= Pizza[1])
{
  DisablePlayerCheckpoint(playerid);
  SetPlayerCheckpoint(playerid, PizzaCheckpoint[9][0], PizzaCheckpoint[9][1], PizzaCheckpoint[9][2], 2.0);
  SendClientMessage(playerid, COLOR_LIGHTBLUE, "Вы доставили пиццу!");
    PlayerPlaySound(playerid, 1057, 0.0, 0.0, 0.0);
  SetPVarInt(playerid, "PizzaCheck", 9);
  SetPVarInt(playerid, "PizzaMoney", GetPVarInt(playerid, "PizzaMoney") + PizzaMoney);
  return 1;
}
if(GetPVarInt(playerid, "PizzaCheck") == 9 && GetPVarInt(playerid, "PizzaTime") >= 0 && carid >= Pizza[0] && carid <= Pizza[1])
{
  DisablePlayerCheckpoint(playerid);
  SetPlayerCheckpoint(playerid, PizzaCheckpoint[1][0], PizzaCheckpoint[1][1], PizzaCheckpoint[1][2], 2.0);
  SendClientMessage(playerid, COLOR_LIGHTBLUE, "Вы доставили пиццу!");
    PlayerPlaySound(playerid, 1057, 0.0, 0.0, 0.0);
  SetPVarInt(playerid, "PizzaCheck", 1);
  SetPVarInt(playerid, "PizzaMoney", GetPVarInt(playerid, "PizzaMoney") + PizzaMoney);
  return 1;
}

 

Спойлер

if(newstate == PLAYER_STATE_DRIVER)
{
new carid = GetPlayerVehicleID(playerid);
if(carid >= Pizza[0] && carid <= Pizza[1]) return SendClientMessage(playerid, COLOR_LIGHTBLUE, "Введите /job чтобы начать работу доставщика пиццы.");
}

 

Спойлер

forward SecondTimes(playerid);
public SecondTimes(playerid)
{
    if(GetPVarInt(playerid, "PizzaCheck") != 0 && GetPVarInt(playerid, "PizzaTime") <= gettime())
{
new s[30];
format(s, sizeof(s), "Вы заработали %d рублей.", GetPVarInt(playerid, "PizzaMoney"));
SendClientMessage(playerid, -1, s);
GivePlayerMoney(playerid, GetPVarInt(playerid, "PizzaMoney"));
SetPlayerSkin(playerid, GetPVarInt(playerid, "GetPlayerSkin"));
DisablePlayerCheckpoint(playerid);
DeletePVar(playerid, "PizzaTime");
DeletePVar(playerid, "PizzaCheck");
DeletePVar(playerid, "PizzaMoney");
DeletePVar(playerid, "GetPlayerSkin");
return 1;
}
return 1;
}

 

 

Share this post


Link to post
Share on other sites

Классная работа, но очень много её видел.

+ твой!))

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0