SA-MP Forums Archive
Errors with strcat - 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: Errors with strcat (/showthread.php?tid=417208)



Errors with strcat - Goldino - 20.02.2013

I have some errors here,

Код:
strcat( hugeStr, ""ORANGE"Administrator Commands: \n" );
Код:
C:\DOCUME~1\DANNY~1.YOU\MYDOCU~1\LOSSAN~1\GAMEMO~1\Testing.pwn(1870) : error 001: expected token: "-string end-", but found "-identifier-"
C:\DOCUME~1\DANNY~1.YOU\MYDOCU~1\LOSSAN~1\GAMEMO~1\Testing.pwn(1870) : warning 215: expression has no effect
C:\DOCUME~1\DANNY~1.YOU\MYDOCU~1\LOSSAN~1\GAMEMO~1\Testing.pwn(1870) : error 001: expected token: ";", but found "-string-"
C:\DOCUME~1\DANNY~1.YOU\MYDOCU~1\LOSSAN~1\GAMEMO~1\Testing.pwn(1870) : warning 215: expression has no effect
C:\DOCUME~1\DANNY~1.YOU\MYDOCU~1\LOSSAN~1\GAMEMO~1\Testing.pwn(1870) : error 001: expected token: ";", but found ")"
C:\DOCUME~1\DANNY~1.YOU\MYDOCU~1\LOSSAN~1\GAMEMO~1\Testing.pwn(1870) : fatal error 107: too many error messages on one line

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


4 Errors.
Please help


Re: Errors with strcat - GWX - 20.02.2013

It's because of ""'s. Replace:
Код:
strcat( hugeStr, ""ORANGE"Administrator Commands: \n" );
With:
Код:
strcat(hugeStr, """ORANGE""Administrator Commands: \n");



Re: Errors with strcat - Goldino - 20.02.2013

Quote:
Originally Posted by ******
Посмотреть сообщение
How is "ORANGE" defined? If it is a string, then a) I don't know what the problem is and b) I don't know why you need "" at the start. If it isn't a string, it needs to be (or needs #).
I dont get u


Re: Errors with strcat - Jewell - 20.02.2013

you can not use quotes like that in a string. if you want to use quotes in a string you should use quotes like this \"ORANGE\"
pawn Код:
strcat( hugeStr, " \"ORANGE\"Administrator Commands: \n" );
if you are using "ORANGE" to show a colour, then you can NOT use "ORANGE" in a sting to show a colour. you should use {E6941A} to show a colour (hexadecimal colour codes) //orange


Re: Errors with strcat - Goldino - 20.02.2013

what about these?

Код:
 if ( pInfo[ playerid ][ Adminlevel ] >= 1 )
        strcat( hugeStr, ""ORANGE"Level 1 : "WHITE"/acmds \n" );

    if ( pInfo[ playerid ][ Adminlevel ] >= 2 )
        strcat( hugeStr, ""ORANGE"Level 2 : "WHITE"/kick \n" );

    if ( pInfo[ playerid ][ Adminlevel ] >= 3 )
        strcat( hugeStr, ""ORANGE"Level 3 : "WHITE"/setscore \n" );

    if ( pInfo[ playerid ][ Adminlevel ] >= 4 )
        strcat( hugeStr, ""ORANGE"Level 4 : "WHITE"[ coming soon ] \n" );

    if ( pInfo[ playerid ][ Adminlevel ] >= 5 )
        strcat( hugeStr, ""ORANGE"Level 5 : "WHITE"/setlevel \n" );