SA-MP Forums Archive
Pawno crashes for this code ? +REP Given! - 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)
+--- Thread: Pawno crashes for this code ? +REP Given! (/showthread.php?tid=380371)



Pawno crashes for this code ? +REP Given! - ShawnMiller1337 - 25.09.2012

When removing this code it compiles fine

When adding this code it crashes my pawno

pawn Код:
#define DTUTSTEP3 511
#define ShowTutStepThreeDialog(%1,%2) ShowPlayerDialog(%1, %2, DIALOG_STYLE_MSGBOX, "{00FF00}Factions - Tutorial (Step 3 of 13)", "{0040FF}United States Factions\n {FFFF00}-San Fierro Police Department\n -San Fierro Fire Department\n -United States Marine Corps\n -Central Intelligence Agency\n -Federal Bureau of Investigation\n -Government\n -Court System\n -SF News Agency\n\n\n {31B404}Germany Factions\n {FFFF00}-Schutzstaffel\n -Government\n -Emergency Services\n -Gestapo\n\n\n {DF0101}Soviet Union Factions\n {FFFF00}-NKPD\n -Soviet Union Armed Forces\n -Government\n -KGB\n -Emergency Services", "Back", "Next")



Re: Pawno crashes for this code ? +REP Given! - ShawnMiller1337 - 25.09.2012

Anyone ?


Re: Pawno crashes for this code ? +REP Given! - clarencecuzz - 25.09.2012

I have a feeling it is because the input line is too long. Try this:
pawn Код:
#define ShowTutStepThreeDialog((%1),(%2)) \
        ShowPlayerDialog((%1), (%2), DIALOG_STYLE_MSGBOX, "{00FF00}Factions - Tutorial (Step 3 of 13)", "{0040FF}United States Factions\n {FFFF00}-San Fierro Police Department\n -San Fierro Fire Department\n -United States Marine Corps\n -Central Intelligence Agency\n -Federal Bureau of Investigation\n -Government\n -Court System\n -SF News Agency\n\n\n {31B404}Germany Factions\n {FFFF00}-Schutzstaffel\n -Government\n -Emergency Services\n -Gestapo\n\n\n {DF0101}Soviet Union Factions\n {FFFF00}-NKPD\n -Soviet Union Armed Forces\n -Government\n -KGB\n -Emergency Services", "Back", "Next")
EDIT: This would work better:
pawn Код:
stock ShowTutStepThreeDialog(playerid, dialogid)
{
    new string[600];
    format(string,sizeof(string),"{00FF00}Factions - Tutorial (Step 3 of 13)", "{0040FF}United States Factions\n {FFFF00}-San Fierro Police Department\n -San Fierro Fire Department\n ");
    strcat(string, "-United States Marine Corps\n -Central Intelligence Agency\n -Federal Bureau of Investigation\n");
    strcat(string, " -Government\n -Court System\n -SF News Agency\n\n\n {31B404}Germany Factions\n {FFFF00}-Schutzstaffel\n -Government\n -Emergency Services\n");
    strcat(string, " -Gestapo\n\n\n {DF0101}Soviet Union Factions\n {FFFF00}-NKPD\n -Soviet Union Armed Forces\n -Government\n -KGB\n -Emergency Services");
    ShowPlayerDialog(playerid, dialogid, DIALOG_STYLE_MSGBOX, string, "Back", "Next");
    return 1;
}



Re: Pawno crashes for this code ? +REP Given! - ShawnMiller1337 - 25.09.2012

Quote:
Originally Posted by clarencecuzz
Посмотреть сообщение
I have a feeling it is because the input line is too long. Try this:
pawn Код:
#define ShowTutStepThreeDialog((%1),(%2)) \
        ShowPlayerDialog((%1), (%2), DIALOG_STYLE_MSGBOX, "{00FF00}Factions - Tutorial (Step 3 of 13)", "{0040FF}United States Factions\n {FFFF00}-San Fierro Police Department\n -San Fierro Fire Department\n -United States Marine Corps\n -Central Intelligence Agency\n -Federal Bureau of Investigation\n -Government\n -Court System\n -SF News Agency\n\n\n {31B404}Germany Factions\n {FFFF00}-Schutzstaffel\n -Government\n -Emergency Services\n -Gestapo\n\n\n {DF0101}Soviet Union Factions\n {FFFF00}-NKPD\n -Soviet Union Armed Forces\n -Government\n -KGB\n -Emergency Services", "Back", "Next")
EDIT: This would work better:
pawn Код:
stock ShowTutStepThreeDialog(playerid, dialogid)
{
    new string[600];
    format(string,sizeof(string),"{00FF00}Factions - Tutorial (Step 3 of 13)", "{0040FF}United States Factions\n {FFFF00}-San Fierro Police Department\n -San Fierro Fire Department\n ");
    strcat(string, "-United States Marine Corps\n -Central Intelligence Agency\n -Federal Bureau of Investigation\n");
    strcat(string, " -Government\n -Court System\n -SF News Agency\n\n\n {31B404}Germany Factions\n {FFFF00}-Schutzstaffel\n -Government\n -Emergency Services\n");
    strcat(string, " -Gestapo\n\n\n {DF0101}Soviet Union Factions\n {FFFF00}-NKPD\n -Soviet Union Armed Forces\n -Government\n -KGB\n -Emergency Services");
    ShowPlayerDialog(playerid, dialogid, DIALOG_STYLE_MSGBOX, string, "Back", "Next");
    return 1;
}
warning 202: number of arguments does not match definition

For
Код:
ShowPlayerDialog(playerid, dialogid, DIALOG_STYLE_MSGBOX, string, "Back", "Next");



Re: Pawno crashes for this code ? +REP Given! - ShawnMiller1337 - 25.09.2012

Nvm got it! Thanks much appreciated!