Koji gamemod koristite?: GTARP
Koje vam se greške javljaju u skripti?: LJudiiiii Imam Bug sa Komandom /Buymats i naprimer ode neko da uzme mats kuca /buymats -3232323 i dobije 32323232 $ Kako da resim toooo molimmm vasssss
Dio skripte na kojim se javljaju greške?:
if(strcmp(cmd,"/buymats",true)==0) // By Ellis
{
if(IsPlayerConnected(playerid))
{
if(gPlayerLogged[playerid] == 0)
{
SendClientMessage(playerid, COLOR_GREY, " Morate se prvo prijaviti !");
return 1;
}
if(PlayerInfo[playerid][pJob] != 9)
{
SendClientMessage(playerid, COLOR_GREY, " Niste diler oruzija. ");
return 1;
}
if(!PlayerToPoint(2.0, playerid, 2230.3579,-2286.2107,14.3751))
{
SendClientMessage(playerid, COLOR_GREY, " Niste kod Banke Materijala !");
return 1;
}
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_WHITE, "Koriscenje: /buymats [ammount]");
return 1;
}
new mammount;
mammount = strval(tmp);
if(mammount > matssys[MatsAmmount])
{
SendClientMessage(playerid, COLOR_GREY, " Nemaju dovoljno materijala ! ");
return 1;
}
if(GetPlayerMoney(playerid) < mammount * 5 - 1)
{
SendClientMessage(playerid, COLOR_GREY, " Nemate dovoljno novca ! ");
return 1;
}
matssys[MatsAmmount] -= mammount;
PlayerInfo[playerid][pMats] += mammount;
SafeGivePlayerMoney(playerid, - mammount * 5);
format(string, sizeof(string), " Kupili ste %d materijala za %d$ !", mammount, mammount * 5);
SendClientMessage(playerid, COLOR_GREY, string);
SaveMatsSystem();
return 1;
}
return 1;
}
Izvini ako radis gm od 0 zasto koristis GF komande? Nemoj lagati Ako koristis GF napisi GF...
A nije Od 0 To sam pogresio TO JE GTARP MOD
GTARP = GF
Samo provjeri ako je mammount manji od 0 i ako je return 1;
if(strcmp(cmd,"/buymats",true)==0) // By Ellis
{
if(IsPlayerConnected(playerid))
{
if(gPlayerLogged[playerid] == 0)
{
SendClientMessage(playerid, COLOR_GREY, " Morate se prvo prijaviti !");
return 1;
}
if(PlayerInfo[playerid][pJob] != 9)
{
SendClientMessage(playerid, COLOR_GREY, " Niste diler oruzija. ");
return 1;
}
if(!PlayerToPoint(2.0, playerid, 2230.3579,-2286.2107,14.3751))
{
SendClientMessage(playerid, COLOR_GREY, " Niste kod Banke Materijala !");
return 1;
}
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_WHITE, "Koriscenje: /buymats [ammount]");
return 1;
}
new mammount;
mammount = strval(tmp);
if(mammount > matssys[MatsAmmount])
{
SendClientMessage(playerid, COLOR_GREY, " Nemaju dovoljno materijala ! ");
return 1;
}
if(GetPlayerMoney(playerid) < mammount * 5 - 1)
{
SendClientMessage(playerid, COLOR_GREY, " Nemate dovoljno novca ! ");
return 1;
}
matssys[MatsAmmount] -= mammount;
PlayerInfo[playerid][pMats] += mammount;
SafeGivePlayerMoney(playerid, - mammount * 5);
format(string, sizeof(string), " Kupili ste %d materijala za %d$ !", mammount, mammount * 5);
SendClientMessage(playerid, COLOR_GREY, string);
SaveMatsSystem();
return 1;
}
return 1;
}
Evo je komanda Pa pogledaj Kako sta treba Plizzzz
Ovo je rekao LorgShigi da uradis
if(mammount <= 0) return 1;
A izvini Gde to da stavim Kak da odradim Mos MI ti stavim Eno Tamo imas Komanda Plizzz BICu ti zahvalan :D Kaj molim te odradi mi to
if(strcmp(cmd,"/buymats",true)==0) // By Ellis
{
if(IsPlayerConnected(playerid))
{
if(gPlayerLogged[playerid] == 0)
{
SendClientMessage(playerid, COLOR_GREY, " Morate se prvo prijaviti !");
return 1;
}
if(PlayerInfo[playerid][pJob] != 9)
{
SendClientMessage(playerid, COLOR_GREY, " Niste diler oruzija. ");
return 1;
}
if(!PlayerToPoint(2.0, playerid, 2230.3579,-2286.2107,14.3751))
{
SendClientMessage(playerid, COLOR_GREY, " Niste kod Banke Materijala !");
return 1;
}
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_WHITE, "Koriscenje: /buymats [ammount]");
return 1;
}
new mammount;
mammount = strval(tmp);
if(mammount <= 0) return SendClientMessage(playerid, COLOR_GREY, " Suma nesme biti manja od 0 ! ");
if(mammount > matssys[MatsAmmount])
{
SendClientMessage(playerid, COLOR_GREY, " Nemaju dovoljno materijala ! ");
return 1;
}
if(GetPlayerMoney(playerid) < mammount * 5 - 1)
{
SendClientMessage(playerid, COLOR_GREY, " Nemate dovoljno novca ! ");
return 1;
}
matssys[MatsAmmount] -= mammount;
PlayerInfo[playerid][pMats] += mammount;
SafeGivePlayerMoney(playerid, - mammount * 5);
format(string, sizeof(string), " Kupili ste %d materijala za %d$ !", mammount, mammount * 5);
SendClientMessage(playerid, COLOR_GREY, string);
SaveMatsSystem();
return 1;
}
return 1;
}
Evo dodao sam i ako ukuca ispod 0 ili 0 da vrati poruku: SendClientMessage(playerid, COLOR_GREY, " Suma nesme biti manja od 0 ! ");
Hvala ti mnogooooo MOze LOCK