SA-MP Forums Archive
Crashing compiler :s - 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: Crashing compiler :s (/showthread.php?tid=273313)



Crashing compiler :s - FireCat - 01.08.2011

This crashes the compiler, it doesn't give any response

pawn Код:
dcmd_rules(playerid,params[])
{
    #pragma unused params
    new string[800];
    format(string,sizeof(string),""lred"SERVER RULES",""lwhite"1."lorange"Any 3rd party programs that give you any advantages on others, are not allowed. \n"lwhite"2."lorange"No discussions about sexism and porn. \n"lwhite"3."lorange"Do not advertise any other servers, or sites \n"lwhite"4."lorange"No spamming. \n"lwhite"5."lorange"No spawn-killing. \n"lwhite"6."lorange"Do not annoy players. \n"lwhite"7."lorange"Do not abuse any bugs. \n"lwhite"8."lorange"No offensive/racist acts against other players "lwhite"9."lorange"No car park on another player");
    ShowPlayerDialog(playerid,9889,0,string,"ACCEPT","");
    return 1;
}



Re: Crashing compiler :s - Basicz - 01.08.2011

It crashed my compiler, because that string is too long, yeah.....


Re: Crashing compiler :s - Libra_PL - 01.08.2011

Код:
dcmd_rules(playerid,params[])
{
    #pragma unused params
    new RulesText[800];

    strcat(RulesText,""lred"SERVER RULES",""lwhite"\n");
    strcat(RulesText,"1."lorange"Any 3rd party programs that give you any advantages on others, are not allowed. \n");
    strcat(RulesText,""lwhite"2."lorange"No discussions about sexism and porn. \n");
    strcat(RulesText,""lwhite"3."lorange"Do not advertise any other servers, or sites \n");
    strcat(RulesText,""lwhite"4."lorange"No spamming. \n");
    strcat(RulesText,""lwhite"5."lorange"No spawn-killing. \n");
    strcat(RulesText,""lwhite"6."lorange"Do not annoy players. \n");
    strcat(RulesText,""lwhite"7."lorange"Do not abuse any bugs. \n");
    strcat(RulesText,""lwhite"8."lorange"No offensive/racist acts against other players \n");
    strcat(RulesText,""lwhite"9."lorange"No car park on another player");
    ShowPlayerDialog(playerid,9889,0,"***",RulesText,"ACCEPT","");
    return 1;
}
You forgot add also header to ShowPlayerDialog (replace "***")
I'm not sure it will show correctly, you will need to check that. Btw, it's 200% hard to add "lred" than {FF0000} to me o.0 When I edited this to do correctly, sometimes I didn't know what I do =)
For long dialogs, try using strcat
If the problem with crashing still happens, the problem is with "lred" and other...