Please help in dialog box
#1

pawn Код:
if(!strcmp(cmdtext, "/rules", true))
{
new Str1[ ] =  "1) No cheating, Hacking or using mods to gain unfair advantages.\n
                2) No racism, flaming, spamming , flooding or behaving like an arsehole.\n
                3) Do not jack other players who are in vechile mod shop. ( eg at the tune[1-5])\n
                4) No spawn killing or camping point where the players spawn.\n
                7) Respect other players and Admins... Do not annoy peoples....\n
                8) Death Evading is not allowed.\n
                9) Do not entice people to type /q or /quit.... Its not funny at all.\n"
,

Str2[ ] =  "Refusing to obey Will result in a mute, kick or a ban.\n
For any complaints or suggestion please go to our forum sampserver.0fees.net\n"
,
StrF[ 2600 ];
    format( StrF, sizeof StrF, "%s%s", Str1, Str2 );
    ShowPlayerDialog( playerid, 123, DIALOG_STYLE_MSGBOX , "{00FF19}EFS Rules", StrF, "Close", "" );
    PlayerPlaySound(playerid, 1133, 0.0, 0.0, 10.0);
    return 1;
}

Showing these errors
Код:
C:\DOCUME~1\Prabhat\Desktop\WORLDS~1.5\GAMEMO~1\free.pwn(1266) : error 037: invalid string (possibly non-terminated string)
C:\DOCUME~1\Prabhat\Desktop\WORLDS~1.5\GAMEMO~1\free.pwn(1266) : warning 215: expression has no effect
C:\DOCUME~1\Prabhat\Desktop\WORLDS~1.5\GAMEMO~1\free.pwn(1266) : error 001: expected token: ";", but found ")"
C:\DOCUME~1\Prabhat\Desktop\WORLDS~1.5\GAMEMO~1\free.pwn(1266) : error 029: invalid expression, assumed zero
C:\DOCUME~1\Prabhat\Desktop\WORLDS~1.5\GAMEMO~1\free.pwn(1266) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


4 Errors.
Reply
#2

Try this:
pawn Код:
if(!strcmp(cmdtext, "/rules", true))
{
    new
        iStr[512] = "1) No cheating, Hacking or using mods to gain unfair advantages.\n\
        2) No racism, flaming, spamming , flooding or behaving like an arsehole.\n"
;

    strcat(iStr, "3) Do not jack other players who are in vechile mod shop. ( eg at the tune[1-5])\n\
    4) No spawn killing or camping point where the players spawn.\n"
);

    strcat(iStr, "7) Respect other players and Admins... Do not annoy peoples....\n\
    8) Death Evading is not allowed.\n\
    9) Do not entice people to type /q or /quit.... Its not funny at all.\n"
);
   
    strcat(iStr, "Refusing to obey Will result in a mute, kick or a ban.\n\
    For any complaints or suggestion please go to our forum sampserver.0fees.net\n"
);
   
    ShowPlayerDialog(playerid, 123, DIALOG_STYLE_MSGBOX, "{00FF19}EFS Rules", iStr, "Close", "");
    PlayerPlaySound(playerid, 1133, 0.0, 0.0, 10.0);
    return 1;
}
Reply
#3

pawn Код:
if ( !strcmp( cmdtext, "/rules", true ) )
{
new Str1[ ] =  "1) No cheating, Hacking or using mods to gain unfair advantages.\n\
                2) No racism, flaming, spamming , flooding or behaving like an arsehole.\n\
                3) Do not jack other players who are in vechile mod shop. ( eg at the tune[1-5])\n\
                4) No spawn killing or camping point where the players spawn.\n\
                7) Respect other players and Admins... Do not annoy peoples....\n\
                8) Death Evading is not allowed.\n\
                9) Do not entice people to type /q or /quit.... Its not funny at all.\n"
,

Str2[ ] =  "Refusing to obey Will result in a mute, kick or a ban.\n\
For any complaints or suggestion please go to our forum sampserver.0fees.net\n"
,
StrF[ 2600 ];
    format( StrF, sizeof StrF, "%s%s", Str1, Str2 );
    ShowPlayerDialog( playerid, 123, DIALOG_STYLE_MSGBOX , "{00FF19}EFS Rules", StrF, "Close", "" );
    PlayerPlaySound(playerid, 1133, 0.0, 0.0, 10.0);
    return 1;
}
You did it like this

pawn Код:
"This is \n
A string
Which should be
pawn Код:
"This is \n\
A string"
Notice the backslash.

EDIT: I was late ;(
LethaL's way could be good
Reply
#4

Quote:
Originally Posted by MA_proking
Посмотреть сообщение
pawn Код:
if(!strcmp(cmdtext, "/rules", true))
{
new Str1[ ] =  "1) No cheating, Hacking or using mods to gain unfair advantages.\n
                2) No racism, flaming, spamming , flooding or behaving like an arsehole.\n
                3) Do not jack other players who are in vechile mod shop. ( eg at the tune[1-5])\n
                4) No spawn killing or camping point where the players spawn.\n
                7) Respect other players and Admins... Do not annoy peoples....\n
                8) Death Evading is not allowed.\n
                9) Do not entice people to type /q or /quit.... Its not funny at all.\n"
,

Str2[ ] =  "Refusing to obey Will result in a mute, kick or a ban.\n
For any complaints or suggestion please go to our forum sampserver.0fees.net\n"
,
StrF[ 2600 ];
    format( StrF, sizeof StrF, "%s%s", Str1, Str2 );
    ShowPlayerDialog( playerid, 123, DIALOG_STYLE_MSGBOX , "{00FF19}EFS Rules", StrF, "Close", "" );
    PlayerPlaySound(playerid, 1133, 0.0, 0.0, 10.0);
    return 1;
}

Showing these errors
Код:
C:\DOCUME~1\Prabhat\Desktop\WORLDS~1.5\GAMEMO~1\free.pwn(1266) : error 037: invalid string (possibly non-terminated string)
C:\DOCUME~1\Prabhat\Desktop\WORLDS~1.5\GAMEMO~1\free.pwn(1266) : warning 215: expression has no effect
C:\DOCUME~1\Prabhat\Desktop\WORLDS~1.5\GAMEMO~1\free.pwn(1266) : error 001: expected token: ";", but found ")"
C:\DOCUME~1\Prabhat\Desktop\WORLDS~1.5\GAMEMO~1\free.pwn(1266) : error 029: invalid expression, assumed zero
C:\DOCUME~1\Prabhat\Desktop\WORLDS~1.5\GAMEMO~1\free.pwn(1266) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


4 Errors.
Like basicz says, your code must looks like this:
PHP код:
if(!strcmp(cmdtext"/rules"true))
{
    new 
Str1[ ] =  "1) No cheating, Hacking or using mods to gain unfair advantages.\n\
                    2) No racism, flaming, spamming , flooding or behaving like an arsehole.\n\
                    3) Do not jack other players who are in vechile mod shop. ( eg at the tune[1-5])\n\
                    4) No spawn killing or camping point where the players spawn.\n\
                    7) Respect other players and Admins... Do not annoy peoples....\n\
                    8) Death Evading is not allowed.\n\
                    9) Do not entice people to type /q or /quit.... Its not funny at all.\n"
,
                    
    
Str2[ ] =  "Refusing to obey Will result in a mute, kick or a ban.\n\
    For any complaints or suggestion please go to our forum sampserver.0fees.net\n"
,
    
    
StrF2600 ];
    
    
formatStrFsizeof StrF"%s%s"Str1Str2 );
    
ShowPlayerDialogplayerid123DIALOG_STYLE_MSGBOX "{00FF19}EFS Rules"StrF"Close""" );
    
PlayerPlaySound(playerid11330.00.010.0);
    return 
1;

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)