boss122
Новичок
Баг с командой /makegun. Когда пишешь /makegun 2 99999999999 дается дохренище оружия без материалов, которым можно фулить склад.
Вот собственно сама команда.
Вот собственно сама команда.
PHP:
else if(strcmp(cmd, "/makegun", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(PlayerInfo[playerid][pJailTime] > 0) return SendClientMessage(playerid, COLOR_GREY, "Â äàííûé ìîìåíò Âû íå ìîæåòå ïîëüçîâàòüñÿ ýòîé ôóíêöèåé");
new plst = PlayerInfo[playerid][pMRInections];
if(plst == 3 || plst == 5 || plst == 6 || plst == 12 || plst == 13 || plst == 15 || plst == 14 || plst == 17 || plst == 18 || plst == 19)
{
new gunquote;
tmp = strcharsplit(cmdtext, idx);
if(!strlen(tmp))
{
new strcatZ[512], str[82];
format(str,sizeof(str),"Silinced Pistol\tÍîìåð: 1\tÌàòåðèàëîâ çà 1 ïàòðîí: 1 øò.\n"); strcat(strcatZ,str);
format(str,sizeof(str),"Desert Eagle\tÍîìåð: 2\tÌàòåðèàëîâ çà 1 ïàòðîí: 3 øò.\n"); strcat(strcatZ,str);
format(str,sizeof(str),"Shotgun\tÍîìåð: 3\tÌàòåðèàëîâ çà 1 ïàòðîí: 2 øò.\n"); strcat(strcatZ,str);
format(str,sizeof(str),"MP5\t\tÍîìåð: 4\tÌàòåðèàëîâ çà 1 ïàòðîí: 1 øò.\n"); strcat(strcatZ,str);
format(str,sizeof(str),"AK-47\t\tÍîìåð: 5\tÌàòåðèàëîâ çà 1 ïàòðîí: 2 øò.\n"); strcat(strcatZ,str);
format(str,sizeof(str),"M4\t\tÍîìåð: 6\tÌàòåðèàëîâ çà 1 ïàòðîí: 2 øò.\n"); strcat(strcatZ,str);
format(str,sizeof(str),"Sniper Rifle\tÍîìåð: 7\tÌàòåðèàëîâ çà 1 ïàòðîí: 4 øò.\n"); strcat(strcatZ,str);
SPD(playerid, 00000, DIALOG_STYLE_MSGBOX, "Òàáëèöà îðóæèÿ", strcatZ, "Âûõîä", "");
SendClientMessage(playerid, COLOR_WHITE, "Èñïîëüçóéòå: /makegun [Íîìåð îðóæèÿ] [Êîëè÷åñòâî ïàòðîíîâ]");
return true;
}
new gunidxx = strval(tmp);
if(gunidxx == 1 || gunidxx == 2 || gunidxx == 3 || gunidxx == 4 || gunidxx == 5 || gunidxx == 6 || gunidxx == 7)
{
tmp = strcharsplit(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_WHITE, "Èñïîëüçóéòå: /makegun [Íîìåð îðóæèÿ] [Êîëè÷åñòâî ïàòðîíîâ]");
return true;
}
new gunid, gunname[28];
new ammogunxx = strval(tmp);
if(gunidxx == 1) gunquote = 1, gunid = 23, format(gunname, 28, "Silinced Pistol");
else if(gunidxx == 2) gunquote = 3, gunid = 24, format(gunname, 28, "Desert Eagle");
else if(gunidxx == 3) gunquote = 2, gunid = 25, format(gunname, 28, "Shotgun");
else if(gunidxx == 4) gunquote = 1, gunid = 29, format(gunname, 28, "MP5");
else if(gunidxx == 5) gunquote = 2, gunid = 30, format(gunname, 28, "AK-47");
else if(gunidxx == 6) gunquote = 2, gunid = 31, format(gunname, 28, "M4");
else if(gunidxx == 7) gunquote = 4, gunid = 34, format(gunname, 28, "Sniper Rifle");
if(PlayerInfo[playerid][pMats] < (gunquote*ammogunxx)) return SendClientMessage(playerid, COLOR_GREY, "Ó Âàñ íåäîñòàòî÷íî ìàòåðèàëîâ");
GiveWeapon(playerid,gunid,ammogunxx);
PlayerInfo[playerid][pMats] -= gunquote*ammogunxx;
format(stringer, sizeof(stringer), "%s ñäåëàë èç ìàòåðèàëîâ %s c %d ïàòð.",PlayerInfo[playerid][pNames], gunname, ammogunxx);
ProxDetector(20.0, playerid, stringer, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
}
}
else return SendClientMessage(playerid, COLOR_GREY, "Âàì íåäîñòóïíà ýòà ôóíêöèÿ");
}
return true;
}
