Huseyn
Компетентный
Всем привет! ребята у меня проблема с командой /salelic, при продажи лицензии всё наоборот подаётся..
Например я продаю игроку лицензии, игроку пишет вы продали лицензии, а должно писать вы купили лицензии, прошу помощь ребята с меня ++
вторая
Например я продаю игроку лицензии, игроку пишет вы продали лицензии, а должно писать вы купили лицензии, прошу помощь ребята с меня ++
PHP:
CMD:salelic(playerid, params[])
{
if(PI[playerid][pMember] != TEAM_AUTOSCHOOL) return SendClientMessage(playerid, COLOR_GREY, YouCanNot);
else if(sscanf(params, "ud", params[0], params[1])) return SendClientMessage(playerid, COLOR_WHITE, "Введите: /salelic [id игрока] [id лицензии (1-водительские,2-водные,3-воздушные,4-оружие,5-бизнес)]");
else if(!IsPlayerConnected(params[0])) return SendClientMessage(playerid, COLOR_GREY, PlayerIsNotOnline);
else if(PlayerLogged[params[0]] == false) return SendClientMessage(playerid, COLOR_GREY, PlayerIsNotAuthorized);
else if(!IsPlayerInRangeOfPlayer(10.0, playerid, params[0])) return SendClientMessage(playerid, COLOR_GREY, "Игрок слишком далеко!");
new bool:dostup;
switch(params[1])
{
case 1: if(PI[params[0]][pLic][0]) dostup = true;
case 2: if(PI[params[0]][pLic][1]) dostup = true;
case 3: if(PI[params[0]][pLic][2]) dostup = true;
case 4: if(PI[params[0]][pLic][3]) dostup = true;
case 5:
{
new i = GetPVarInt(params[0], "PlayerBizz");
if(BizzInfo[i][bLic]) dostup = true;
}
}
if(params[1] == 5 && !GetPlayerBizz(params[0])) return SendClientMessage(playerid, COLOR_GREY, "Игрок не имеет бизнеса!");
if(dostup == true) return SendClientMessage(playerid, COLOR_GREY, "У игрока есть данная лицензия");
new type[24], price;
switch(params[1])
{
case 1: type = "водительские права", price = 1000;
case 2: type = "лицензию на судоходство", price = 3000;
case 3: type = "лицензию на полеты", price = 10000;
case 4: type = "лицензию на оружие", price = 30000;
case 5: type = "лицензию на бизнес", price = 50000;
}
new string[144];
format(string, sizeof(string), "Вы предложили %s купить %s. Цена: %i$", GetName(params[0]), type, price);
SendClientMessage(playerid, COLOR_BLUE, string);
format(string, sizeof(string), "%s предложил Вам купить %s. Цена: %i$", GetName(playerid), type, price);
SendClientMessage(params[0], COLOR_BLUE, string);
SendClientMessage(params[0], COLOR_WHITE, PlayerAccess);
SetPVarInt(params[0], "sellexamlic", 1);
SetPVarInt(params[0], "changelic", params[1]);
SetPVarInt(params[0], "idselllic", playerid);
return 1;
}
вторая
PHP:
else if(GetPVarInt(playerid, "sellexamlic") == 1)
{
new targetid = GetPVarInt(playerid, "idselllic"), rcv = GetPVarInt(playerid, "changelic");
new type[28], price;
switch(rcv)
{
case 1: price = 1000;
case 2: price = 3000;
case 3: price = 10000;
case 4: price = 30000;
case 5: price = 50000;
}
if(GetMoney(playerid) < price)
{
SendMes(targetid, COLOR_GREY, "У игрока %s недостаточно средств!", GetName(playerid));
DeletePVar(playerid, "sellexamlic");
DeletePVar(playerid, "idselllic");
DeletePVar(playerid, "changelic");
return SendClientMessage(playerid, COLOR_GREY, "У вас не хватает денег!");
}
new Float:x, Float:y, Float:z;
GetPlayerPos(targetid, x, y, z);
if(!IsPlayerInRangeOfPoint(playerid, 10.0, x, y, z))
{
DeletePVar(playerid, "sellexamlic");
DeletePVar(playerid, "idselllic");
DeletePVar(playerid, "changelic");
return SendClientMessage(playerid, COLOR_GREY, "Вы далеко друг от друга");
}
if(rcv == 1)
{
PI[playerid][pLic][0] = 1;
type = "водительские права";
}
if(rcv == 2)
{
PI[playerid][pLic][1] = 1;
type = "лицензию на судоходство";
}
if(rcv == 3)
{
PI[playerid][pLic][2] = 1;
type = "лицензию на полеты";
}
if(rcv == 4)
{
PI[playerid][pLic][3] = 1;
type = "лицензию на оружие";
}
if(rcv == 5)
{
new i = GetPVarInt(playerid, "PlayerBizz");
BizzInfo[i][bLic] = 1;
MysqlUpdateBizzInt(i, "lic", BizzInfo[i][bLic]);
type = "лицензию на бизнес";
}
TransferMoney(-1, targetid, price);
TransferMoney(playerid, -1, price);
SendMes(targetid, COLOR_GREEN, "Вы купили %s у %s. Цена: %i$", type, GetName(playerid), price);
SendMes(playerid, COLOR_GREEN, "Вы продали %s игроку %s за %i$", GetName(targetid), type, price);
new string[128];
if(PI[playerid][pSex] == 1) format(string, sizeof(string), "[LIC] %s %s[%i] продал %s игроку %s[%i] за %i$", Fraction_Rang[PI[playerid][pMember]][PI[playerid][pRank]], GetName(playerid), playerid, GetName(targetid), targetid, price);
else format(string, sizeof(string), "[LIC] %s %s[%i] продала %s игроку %s[%i] за %i$", Fraction_Rang[PI[playerid][pMember]][PI[playerid][pRank]], GetName(playerid), playerid, GetName(targetid), targetid, price);
SendFMes(PI[playerid][pMember], COLOR_YELLOW, string);
DeletePVar(playerid, "sellexamlic");
DeletePVar(playerid, "idselllic");
DeletePVar(playerid, "changelic");
return 1;
}
}
