PHP код:
case 169:
{
if(response)
{
switch(listitem)
{
case 0://Заправить авто
{
if(PlayerInfo[playerid][pJerrycan] == 0)
{
new engine,lights,alarm,doors,bonnet,boot,objective;
GetVehicleParamsEx(GetPVarInt(playerid,"CREVEH"),engine,lights,alarm,doors,bonnet,boot,objective);
SetVehicleParamsEx(GetPVarInt(playerid,"CREVEH"),engine,lights,alarm,doors,bonnet,0,objective);
ApplyAnimation(playerid,"CARRY","crry_prtial",4.0,0,0,0,0,0);
SCM(playerid, COLOR_GREY, "У вас нет канистры!");
return true;
}
PlayerInfo[playerid][pJerrycan] = 0;
Vehicle[vehicle][Fuel] += 50;
SCM(playerid, COLOR_LIGHTBLUE, "[Т] Вы дозаправили транспорт (+50 литров)");
}
case 1://Положить оружие, по слотам
{
new weaponid = GetPlayerWeapon(playerid);
new slot = GetWeaponSlot(weaponid);
if(slot < 2 || slot > 6)
{
new engine,lights,alarm,doors,bonnet,boot,objective;
GetVehicleParamsEx(GetPVarInt(playerid,"CREVEH"),engine,lights,alarm,doors,bonnet,boot,objective);
SetVehicleParamsEx(GetPVarInt(playerid,"CREVEH"),engine,lights,alarm,doors,bonnet,0,objective);
ApplyAnimation(playerid,"CARRY","crry_prtial",4.0,0,0,0,0,0);
SCM(playerid, COLOR_GREY, "Данное оружие не подходить к ячейке!");
return true;
}
if(PlayerInfo[playerid][pGun][slot] == 0)
{
new engine,lights,alarm,doors,bonnet,boot,objective;
GetVehicleParamsEx(GetPVarInt(playerid,"CREVEH"),engine,lights,alarm,doors,bonnet,boot,objective);
SetVehicleParamsEx(GetPVarInt(playerid,"CREVEH"),engine,lights,alarm,doors,bonnet,0,objective);
ApplyAnimation(playerid,"CARRY","crry_prtial",4.0,0,0,0,0,0);
SCM(playerid, COLOR_GREY, "Ошибка!");
return true;
}
if(CarInfo[playerid][cGun][slot-2] != 0 && PlayerInfo[playerid][pGun][slot] != CarInfo[playerid][cGun][slot-2])
{
new engine,lights,alarm,doors,bonnet,boot,objective;
GetVehicleParamsEx(GetPVarInt(playerid,"CREVEH"),engine,lights,alarm,doors,bonnet,boot,objective);
SetVehicleParamsEx(GetPVarInt(playerid,"CREVEH"),engine,lights,alarm,doors,bonnet,0,objective);
ApplyAnimation(playerid,"CARRY","crry_prtial",4.0,0,0,0,0,0);
SCM(playerid, COLOR_GREY, "Данная ячейка уже занята!");
return true;
}
CarInfo[playerid][cGun][slot-2] = PlayerInfo[playerid][pGun][slot];
CarInfo[playerid][cGunAmmo][slot-2] += PlayerInfo[playerid][pGunAmmo][slot];
ResetPlayerWeaponID(playerid, PlayerInfo[playerid][pGun][slot]);
}
case 2:
{
new guns;
for(new i = 0; i < 5; i++)
{
if(CarInfo[playerid][cGun][i] == 0 || CarInfo[playerid][cGunAmmo][i] == 0) continue;
GivePlayerWeaponAC(playerid, CarInfo[playerid][cGun][i], CarInfo[playerid][cGunAmmo][i]);
CarInfo[playerid][cGunAmmo][i] = 0;
CarInfo[playerid][cGun][i] = 0;
guns++;
}
if(!guns) SCM(playerid, COLOR_GREY,"В багажнике нет оружия.");
else SCM(playerid, COLOR_GREY,"Вы забрали все оружие из багажника.");
}
case 3://Положить наркотики
{
CarInfo[playerid][cDrugs] += PlayerInfo[playerid][pDrugs];
PlayerInfo[playerid][pDrugs] = 0;
}
case 4://Взять наркотики
{
if(CarInfo[playerid][cDrugs] == 0)
{
new engine,lights,alarm,doors,bonnet,boot,objective;
GetVehicleParamsEx(GetPVarInt(playerid,"CREVEH"),engine,lights,alarm,doors,bonnet,boot,objective);
SetVehicleParamsEx(GetPVarInt(playerid,"CREVEH"),engine,lights,alarm,doors,bonnet,0,objective);
ApplyAnimation(playerid,"CARRY","crry_prtial",4.0,0,0,0,0,0);
SCM(playerid,COLOR_GREY,"В транспорте нет наркотиков!");
return true;
}
if(CarInfo[playerid][cDrugs] > 50)
{
CarInfo[playerid][cDrugs] -= 50;
PlayerInfo[playerid][pDrugs] += 50;
}
if(CarInfo[playerid][cDrugs] <= 50)
{
PlayerInfo[playerid][pDrugs] += CarInfo[playerid][cDrugs];
CarInfo[playerid][cDrugs] = 0;
}
}
}
new engine,lights,alarm,doors,bonnet,boot,objective;
GetVehicleParamsEx(GetPVarInt(playerid,"CREVEH"),engine,lights,alarm,doors,bonnet,boot,objective);
SetVehicleParamsEx(GetPVarInt(playerid,"CREVEH"),engine,lights,alarm,doors,bonnet,0,objective);
ApplyAnimation(playerid,"CARRY","crry_prtial",4.0,0,0,0,0,0);
if(CarInfo[playerid][cGunAmmo][listitem-5] == 0) return SCM(playerid, COLOR_GREY,"В данной ячейки нет оружия!");
if(CarInfo[playerid][cGunAmmo][listitem-5] > 50)
{
new gunname[32];
GetWeaponName(CarInfo[playerid][cGun][listitem-5],gunname,32);
new mes[128];
format(mes,sizeof(mes),"Вы взяли 50 патрон %s", gunname);
SCM(playerid, COLOR_GREY,mes);
GivePlayerWeaponAC(playerid, CarInfo[playerid][cGun][listitem-5], 50);
CarInfo[playerid][cGunAmmo][listitem-5] -= 50;
return true;
}
if(CarInfo[playerid][cGunAmmo][listitem-5] <= 50)
{
new gunname[32];
GetWeaponName(CarInfo[playerid][cGun][listitem-5],gunname,32);
new mes[128];
format(mes,sizeof(mes),"Вы взяли %i патрон %s", CarInfo[playerid][cGunAmmo][listitem-5], gunname);
SCM(playerid, COLOR_GREY,mes);
GivePlayerWeaponAC(playerid, CarInfo[playerid][cGun][listitem-5], CarInfo[playerid][cGunAmmo][listitem-5]);
CarInfo[playerid][cGunAmmo][listitem-5] = 0;
CarInfo[playerid][cGun][listitem-5] = 0;
return true;
}
return true;
}
else
{
new engine,lights,alarm,doors,bonnet,boot,objective;
GetVehicleParamsEx(GetPVarInt(playerid,"CREVEH"),engine,lights,alarm,doors,bonnet,boot,objective);
SetVehicleParamsEx(GetPVarInt(playerid,"CREVEH"),engine,lights,alarm,doors,bonnet,0,objective);
ApplyAnimation(playerid,"CARRY","crry_prtial",4.0,0,0,0,0,0);
return true;
}
}
Отладка