SA-MP Forums Archive
client crash - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: client crash (/showthread.php?tid=194776)



client crash - armyoftwo - 30.11.2010

Код:
    format(string, sizeof(string), "~y~Bombs: ~g~%i", bombcount);
    format(ProductList, sizeof(ProductList), "%s ~n~To refresh timer, type /mybombs again!", ProductList);
    Info_ShowForPlayer(playerid, 1, string, ProductList);
It crashes if i use 250 characters. Info_ShowForPlayer is a textdraw box, and according to the limits you can show more than 250. So why does it crash?

full command

pawn Код:
COMMAND:mybombs(playerid)
{
    new bombcount;
    new Status[16];
   
    ProductList = "";
   
    foreach(Bomb, b)
    {
      if(BombInfo[b][BombOwner] == AccountData[playerid][characterID])
      {

        bombcount ++;
        if(BombInfo[b][BombStatus] == 1) { format(Status, 15, "~g~Ready"); }
        if(BombInfo[b][BombStatus] == 2) { format(Status, 15, "~r~Detonating.."); }
       
        format(ProductList, sizeof(ProductList), "%s~w~Bomb ~g~ID:%i~w~ Timer:~r~%i~w~ Status: %s~n~", ProductList, b, BombInfo[b][BombTime], Status );
      }
    }
   
    if(bombcount == 0)
    {
        Info_ShowForPlayer(playerid, 1, "No bombs", "You haven't planted any bombs");
        return 1;
    }
   
    format(string, sizeof(string), "~y~Bombs: ~g~%i", bombcount);
    format(ProductList, sizeof(ProductList), "%s ~n~To refresh timer, type /mybombs again!", ProductList);
    Info_ShowForPlayer(playerid, 1, string, ProductList);
   
    return 1;
}



Re: client crash - armyoftwo - 01.12.2010

bump......