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 == 0)
{
SendClientMessage(playerid, COLOR_GREY, " Morate se prvo prijaviti !");
return 1;
}
if(PlayerInfo != 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 ");
return 1;
}
new mammount;
mammount = strval(tmp);
if(mammount > matssys)
{
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 -= mammount;
PlayerInfo += 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;
}