if(strcmp(cmd,"/materialsput",true)==0)
{
new tmpcar = GetPlayerVehicleID(playerid);
if(GetVehicleModel(GetPlayerVehicleID(playerid)) != 482) return SendClientMessage(playerid,COLOR_GREY,"Вы не в фургоне!");
switch(PlayerInfo[playerid][pMember])
{
case 12:
{
if(PlayerInfo[playerid][pMats] < 250)
{
SendClientMessage(playerid,COLOR_GRAD1,"У вас нет материалов");
format(string, sizeof(string), "Материалы в фургоне: %d/5000", Furi[tmpcar-matsfura[0]][gBallas]);
SendClientMessage(playerid, TEAM_GROVE_COLOR, string);
return true;
}
if(Furi[tmpcar-matsfura[0]][gBallas] >= 5000) return SendClientMessage(playerid,COLOR_GRAD1,"Фургон заполнен");
SendClientMessage(playerid, COLOR_WHITE, "Вы положили в фургон 250 матов");
Furi[tmpcar-matsfura[0]][gBallas] += 250;//
PlayerInfo[playerid][pMats] -=250;
usemats[playerid] = false;
usegruz[playerid] = false;
RemovePlayerAttachedObject(playerid, 1);
format(string, sizeof(string), "Материалы в фургоне: %d/5000", Furi[tmpcar-matsfura[0]][gBallas]);
SendClientMessage(playerid, TEAM_GROVE_COLOR, string);
}
case 13:
{
if(PlayerInfo[playerid][pMats] < 250)
{
SendClientMessage(playerid,COLOR_GRAD1,"У вас нет материалов");
format(string, sizeof(string), "Материалы: %d/5000", Furi[tmpcar-matsfuravagos[0]][gVagos]);
SendClientMessage(playerid, TEAM_GROVE_COLOR, string);
return true;
}
if(Furi[tmpcar-matsfuravagos[0]][gVagos] >= 5000) return SendClientMessage(playerid,COLOR_GRAD1,"Фургон заполнен");
if(GetVehicleModel(GetPlayerVehicleID(playerid)) != 482) return SendClientMessage(playerid,COLOR_GREY,"Вы не в фургоне!");
SendClientMessage(playerid, COLOR_WHITE, "Вы положили в фургон 250 матов");
Furi[tmpcar-matsfuravagos[0]][gVagos] += 250;//
PlayerInfo[playerid][pMats] -=250;
usemats[playerid] = false;
usegruz[playerid] = false;
RemovePlayerAttachedObject(playerid, 1);
format(string, sizeof(string), "Материалы: %d/5000", Furi[tmpcar-matsfuravagos[0]][gVagos]);
SendClientMessage(playerid, TEAM_GROVE_COLOR, string);
}
case 15:
{
if(PlayerInfo[playerid][pMats] < 250)
{
SendClientMessage(playerid,COLOR_GRAD1,"У вас нет материалов");
format(string, sizeof(string), "Материалы: %d/5000", Furi[tmpcar-matsfuragrove[0]][gGrove]);
SendClientMessage(playerid, TEAM_GROVE_COLOR, string);
return true;
}
if(Furi[tmpcar-matsfuragrove[0]][gGrove] >= 5000) return SendClientMessage(playerid,COLOR_GRAD1,"Фургон заполнен");
SendClientMessage(playerid, COLOR_WHITE, "Вы положили в фургон 250 матов");
Furi[tmpcar-matsfuragrove[0]][gGrove] += 250;//
PlayerInfo[playerid][pMats] -=250;
usemats[playerid] = false;
usegruz[playerid] = false;
RemovePlayerAttachedObject(playerid, 1);
format(string, sizeof(string), "Материалы: %d/5000", Furi[tmpcar-matsfuragrove[0]][gGrove]);
SendClientMessage(playerid, TEAM_GROVE_COLOR, string);
}
case 17:
{
if(PlayerInfo[playerid][pMats] < 250)
{
SendClientMessage(playerid,COLOR_GRAD1,"У вас нет материалов");
format(string, sizeof(string), "Материалы: %d/5000", Furi[tmpcar-matsfuraactek[0]][gAztek]);
SendClientMessage(playerid, TEAM_GROVE_COLOR, string);
return true;
}
if(Furi[tmpcar-matsfuraactek[0]][gAztek] >= 5000)return SendClientMessage(playerid,COLOR_GRAD1,"Фургон заполнен");
SendClientMessage(playerid, COLOR_WHITE, "Вы положили в фургон 250 матов");
Furi[tmpcar-matsfuraactek[0]][gAztek] += 250;//
PlayerInfo[playerid][pMats] -=250;
usemats[playerid] = false;
usegruz[playerid] = false;
RemovePlayerAttachedObject(playerid, 1);
format(string, sizeof(string), "Материалы: %d/5000", Furi[tmpcar-matsfuraactek[0]][gAztek]);
SendClientMessage(playerid, TEAM_GROVE_COLOR, string);
}
case 18:
{
if(PlayerInfo[playerid][pMats] < 250)
{
SendClientMessage(playerid,COLOR_GRAD1,"У вас нет материалов");
format(string, sizeof(string), "Материалы: %d/5000", Furi[tmpcar-matsfurarifa[0]][gRifa]);
SendClientMessage(playerid, TEAM_GROVE_COLOR, string);
return true;
}
if(Furi[tmpcar-matsfurarifa[0]][gRifa] >= 5000)return SendClientMessage(playerid,COLOR_GRAD1,"Фургон заполнен");
SendClientMessage(playerid, COLOR_WHITE, "Вы положили в фургон 250 матов");
Furi[tmpcar-matsfurarifa[0]][gRifa] += 250;//
PlayerInfo[playerid][pMats] -=250;
usemats[playerid] = false;
usegruz[playerid] = false;
RemovePlayerAttachedObject(playerid, 1);
format(string, sizeof(string), "Материалы: %d/5000", Furi[tmpcar-matsfurarifa[0]][gRifa]);
SendClientMessage(playerid, TEAM_GROVE_COLOR, string);
}
}
return true;
}
IsPlayerInRangeOfVehicle(playerid,Float:range,vehicleid)
{
new Float:x,Float:y,Float:z;
GetVehiclePos(vehicleid,x,y,z);
return IsPlayerInRangeOfPoint(playerid,range,x,y,z);
}
Вот функция:
pawn Код:
|