error 037 for a CMD
#1

Why i get this... ?

Код:
C:\Documents and Settings\Mystogan\Desktop\TDM.pwn(2855) : error 037: invalid string (possibly non-terminated string)
C:\Documents and Settings\Mystogan\Desktop\TDM.pwn(2858) : error 037: invalid string (possibly non-terminated string)
C:\Documents and Settings\Mystogan\Desktop\TDM.pwn(2863) : error 037: invalid string (possibly non-terminated string)
C:\Documents and Settings\Mystogan\Desktop\TDM.pwn(2866) : error 037: invalid string (possibly non-terminated string)
C:\Documents and Settings\Mystogan\Desktop\TDM.pwn(2871) : error 037: invalid string (possibly non-terminated string)
C:\Documents and Settings\Mystogan\Desktop\TDM.pwn(2874) : error 037: invalid string (possibly non-terminated string)
C:\Documents and Settings\Mystogan\Desktop\TDM.pwn(2879) : error 037: invalid string (possibly non-terminated string)
C:\Documents and Settings\Mystogan\Desktop\TDM.pwn(2883) : error 037: invalid string (possibly non-terminated string)
C:\Documents and Settings\Mystogan\Desktop\TDM.pwn(2888) : error 037: invalid string (possibly non-terminated string)
C:\Documents and Settings\Mystogan\Desktop\TDM.pwn(2891) : error 037: invalid string (possibly non-terminated string)
C:\Documents and Settings\Mystogan\Desktop\TDM.pwn(2896) : error 037: invalid string (possibly non-terminated string)
C:\Documents and Settings\Mystogan\Desktop\TDM.pwn(2900) : error 037: invalid string (possibly non-terminated string)
C:\Documents and Settings\Mystogan\Desktop\TDM.pwn(2905) : error 037: invalid string (possibly non-terminated string)
C:\Documents and Settings\Mystogan\Desktop\TDM.pwn(2908) : error 037: invalid string (possibly non-terminated string)
C:\Documents and Settings\Mystogan\Desktop\TDM.pwn(2913) : error 037: invalid string (possibly non-terminated string)
C:\Documents and Settings\Mystogan\Desktop\TDM.pwn(2916) : error 037: invalid string (possibly non-terminated string)
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase
the cmd:
Код:
CMD:chelp(playerid, params[])
{

	if(gPlayerInfo[playerid][pClass] == CLASS_ASSAULT)
     {
	   SendClientMessage(playerid,-1,"/--------------------------------------------------\");
	   SendClientMessage(playerid,COLOR_ORANGE,"INFO: This class is basic infantry, its powerful in large groups.");
	   SendClientMessage(playerid,COLOR_ORANGE,"CMD: Currently this class doesn't have cmds.");
	   SendClientMessage(playerid,-1,"/--------------------------------------------------\");
     }

    if(gPlayerInfo[playerid][pClass] == CLASS_MEDIC)
     {
	   SendClientMessage(playerid,-1,"/--------------------------------------------------\");
	   SendClientMessage(playerid,COLOR_ORANGE,"INFO: This class is used to support team mates by providing health packs.");
	   SendClientMessage(playerid,COLOR_ORANGE,"CMD: Use /heal [ID] to restore player's health.");
	   SendClientMessage(playerid,-1,"/--------------------------------------------------\");
     }
	   
    if(gPlayerInfo[playerid][pClass] == CLASS_SNIPER)
	 {
	   SendClientMessage(playerid,-1,"/--------------------------------------------------\");
	   SendClientMessage(playerid,COLOR_ORANGE,"INFO: Used for stealth missions because you are invisible on radar.");
	   SendClientMessage(playerid,COLOR_ORANGE,"CMD: Currently this class doesn't have cmds.");
	   SendClientMessage(playerid,-1,"/--------------------------------------------------\");
	 }
	   
	if(gPlayerInfo[playerid][pClass] == CLASS_ENGINEER)
     {
	   SendClientMessage(playerid,-1,"/--------------------------------------------------\");
	   SendClientMessage(playerid,COLOR_ORANGE,"INFO: With this class you can fix your or team's vehicles.");
	   SendClientMessage(playerid,COLOR_ORANGE,"INFO: You can drive Tanks with it.");
	   SendClientMessage(playerid,COLOR_ORANGE,"CMD: Use /fix to fix your own vehicle | use /repair [ID] to repair a team mates vehicle.");
	   SendClientMessage(playerid,-1,"/--------------------------------------------------\");
     }
	   
    if(gPlayerInfo[playerid][pClass] == CLASS_PYRO)
	 {
	   SendClientMessage(playerid,-1,"/--------------------------------------------------\");
	   SendClientMessage(playerid,COLOR_ORANGE,"INFO: You can burn enemies to death with your flamethrower.");
	   SendClientMessage(playerid,COLOR_ORANGE,"CMD: Use /fire or shorcut /f to set enemy nearby vehicles on fire.");
	   SendClientMessage(playerid,-1,"/--------------------------------------------------\");
     }

    if(gPlayerInfo[playerid][pClass] == CLASS_PILOT)
	 {
	   SendClientMessage(playerid,-1,"/--------------------------------------------------\");
	   SendClientMessage(playerid,COLOR_ORANGE,"INFO: Used to provide air support for team.");
	   SendClientMessage(playerid,COLOR_ORANGE,"INFO: You can use Hydra, Hunter and Seasparrow with it.");
	   SendClientMessage(playerid,COLOR_ORANGE,"CMD: Currently this class doesn't have cmds.");
	   SendClientMessage(playerid,-1,"/--------------------------------------------------\");
	 }

    if(gPlayerInfo[playerid][pClass] == CLASS_SUPPORTER)
	 {
	   SendClientMessage(playerid,-1,"/--------------------------------------------------\");
	   SendClientMessage(playerid,COLOR_ORANGE,"INFO: This class is used to support team mates by providing armour packs.");
	   SendClientMessage(playerid,COLOR_ORANGE,"CMD: Use /armour [ID] to restore player's armour.");
	   SendClientMessage(playerid,-1,"/--------------------------------------------------\");
     }

	if(gPlayerInfo[playerid][pClass] == CLASS_JETTROOPER)
     {
	   SendClientMessage(playerid,-1,"/--------------------------------------------------\");
	   SendClientMessage(playerid,COLOR_ORANGE,"INFO: You can use jetpack for easy mobility.");
	   SendClientMessage(playerid,COLOR_ORANGE,"CMD: Use /jp to spawn a ktpack.");
	   SendClientMessage(playerid,-1,"/--------------------------------------------------\");
	 }
   return 1;
}
Reply
#2

Tried?
pawn Код:
CMD:chelp(playerid, params[])
{
    if(gPlayerInfo[playerid][pClass] = CLASS_ASSAULT)
    {
        SendClientMessage(playerid, -1,"/--------------------------------------------------\");
        SendClientMessage(playerid,COLOR_ORANGE,"
INFO: This class is basic infantry, its powerful in large groups.");
        SendClientMessage(playerid,COLOR_ORANGE,"
CMD: Currently this class doesn't have cmds.");
        SendClientMessage(playerid, -1,"/--------------------------------------------------\");
    }
    else if(gPlayerInfo[playerid][pClass] = CLASS_MEDIC)
    {
        SendClientMessage(playerid, -1,"/--------------------------------------------------\");
        SendClientMessage(playerid,COLOR_ORANGE,"INFO: This class is used to support team mates by providing health packs.");
        SendClientMessage(playerid,COLOR_ORANGE,"CMD: Use /heal [ID] to restore player'
s health.");
        SendClientMessage(playerid, -1,"
/--------------------------------------------------\");
    }
    else if(gPlayerInfo[playerid][pClass] = CLASS_SNIPER)
    {
        SendClientMessage(playerid, -1,"
/--------------------------------------------------\");
        SendClientMessage(playerid,COLOR_ORANGE,"
INFO: Used for stealth missions because you are invisible on radar.");
        SendClientMessage(playerid,COLOR_ORANGE,"
CMD: Currently this class doesn't have cmds.");
        SendClientMessage(playerid, -1,"/--------------------------------------------------\");
    }
    else if(gPlayerInfo[playerid][pClass] = CLASS_ENGINEER)
    {
        SendClientMessage(playerid, -1,"/--------------------------------------------------\");
        SendClientMessage(playerid,COLOR_ORANGE,"INFO: With this class you can fix your or team'
s vehicles.");
        SendClientMessage(playerid,COLOR_ORANGE,"
INFO: You can drive Tanks with it.");
        SendClientMessage(playerid,COLOR_ORANGE,"
CMD: Use /fix to fix your own vehicle | use /repair [ID] to repair a team mates vehicle.");
        SendClientMessage(playerid, -1,"
/--------------------------------------------------\");
    }
    else if(gPlayerInfo[playerid][pClass] = CLASS_PYRO)
    {
        SendClientMessage(playerid, -1,"
/--------------------------------------------------\");
        SendClientMessage(playerid,COLOR_ORANGE,"
INFO: You can burn enemies to death with your flamethrower.");
        SendClientMessage(playerid,COLOR_ORANGE,"
CMD: Use /fire or shorcut /f to set enemy nearby vehicles on fire.");
        SendClientMessage(playerid, -1,"
/--------------------------------------------------\");
    }
    else if(gPlayerInfo[playerid][pClass] = CLASS_PILOT)
    {
        SendClientMessage(playerid, -1,"
/--------------------------------------------------\");
        SendClientMessage(playerid,COLOR_ORANGE,"
INFO: Used to provide air support for team.");
        SendClientMessage(playerid,COLOR_ORANGE,"
INFO: You can use Hydra, Hunter and Seasparrow with it.");
        SendClientMessage(playerid,COLOR_ORANGE,"
CMD: Currently this class doesn't have cmds.");
        SendClientMessage(playerid, -1, "/--------------------------------------------------\");
    }
    else if(gPlayerInfo[playerid][pClass] = CLASS_SUPPORTER)
    {
        SendClientMessage(playerid,-1,"/--------------------------------------------------\");
        SendClientMessage(playerid,COLOR_ORANGE,"INFO: This class is used to support team mates by providing armour packs.");
        SendClientMessage(playerid,COLOR_ORANGE,"CMD: Use /armour [ID] to restore player'
s armour.");
        SendClientMessage(playerid,-1,"
/--------------------------------------------------\");
    }
    else if(gPlayerInfo[playerid][pClass] = CLASS_JETTROOPER)
    {
        SendClientMessage(playerid, -1,"
/--------------------------------------------------\");
        SendClientMessage(playerid,COLOR_ORANGE,"
INFO: You can use jetpack for easy mobility.");
        SendClientMessage(playerid,COLOR_ORANGE,"
CMD: Use /jp to spawn a ktpack.");
        SendClientMessage(playerid, -1,"
/--------------------------------------------------\");
    }
    return 1;
Reply
#3

This is because you are trying to use "\" backslash. It is used for escape characters like \n\t . If you donot put infront of it its non terninated string. So better use something else rather than \ im the end of your string
Reply
#4

Quote:
Originally Posted by NinjahZ
Посмотреть сообщение
Tried?
Did you even try that?
Use == to detect, = to assign.
You can't use a single = in an if.
Reply
#5

To use a \ in a string you actually have to escape it too, like this:

Код:
CMD:chelp(playerid, params[])
{

	if(gPlayerInfo[playerid][pClass] == CLASS_ASSAULT)
     {
	   SendClientMessage(playerid,-1,"/--------------------------------------------------\\");
	   SendClientMessage(playerid,COLOR_ORANGE,"INFO: This class is basic infantry, its powerful in large groups.");
	   SendClientMessage(playerid,COLOR_ORANGE,"CMD: Currently this class doesn't have cmds.");
	   SendClientMessage(playerid,-1,"/--------------------------------------------------\\");
     }

    if(gPlayerInfo[playerid][pClass] == CLASS_MEDIC)
     {
	   SendClientMessage(playerid,-1,"/--------------------------------------------------\\");
	   SendClientMessage(playerid,COLOR_ORANGE,"INFO: This class is used to support team mates by providing health packs.");
	   SendClientMessage(playerid,COLOR_ORANGE,"CMD: Use /heal [ID] to restore player's health.");
	   SendClientMessage(playerid,-1,"/--------------------------------------------------\\");
     }
	   
    if(gPlayerInfo[playerid][pClass] == CLASS_SNIPER)
	 {
	   SendClientMessage(playerid,-1,"/--------------------------------------------------\\");
	   SendClientMessage(playerid,COLOR_ORANGE,"INFO: Used for stealth missions because you are invisible on radar.");
	   SendClientMessage(playerid,COLOR_ORANGE,"CMD: Currently this class doesn't have cmds.");
	   SendClientMessage(playerid,-1,"/--------------------------------------------------\\");
	 }
	   
	if(gPlayerInfo[playerid][pClass] == CLASS_ENGINEER)
     {
	   SendClientMessage(playerid,-1,"/--------------------------------------------------\\");
	   SendClientMessage(playerid,COLOR_ORANGE,"INFO: With this class you can fix your or team's vehicles.");
	   SendClientMessage(playerid,COLOR_ORANGE,"INFO: You can drive Tanks with it.");
	   SendClientMessage(playerid,COLOR_ORANGE,"CMD: Use /fix to fix your own vehicle | use /repair [ID] to repair a team mates vehicle.");
	   SendClientMessage(playerid,-1,"/--------------------------------------------------\\");
     }
	   
    if(gPlayerInfo[playerid][pClass] == CLASS_PYRO)
	 {
	   SendClientMessage(playerid,-1,"/--------------------------------------------------\\");
	   SendClientMessage(playerid,COLOR_ORANGE,"INFO: You can burn enemies to death with your flamethrower.");
	   SendClientMessage(playerid,COLOR_ORANGE,"CMD: Use /fire or shorcut /f to set enemy nearby vehicles on fire.");
	   SendClientMessage(playerid,-1,"/--------------------------------------------------\\");
     }

    if(gPlayerInfo[playerid][pClass] == CLASS_PILOT)
	 {
	   SendClientMessage(playerid,-1,"/--------------------------------------------------\\");
	   SendClientMessage(playerid,COLOR_ORANGE,"INFO: Used to provide air support for team.");
	   SendClientMessage(playerid,COLOR_ORANGE,"INFO: You can use Hydra, Hunter and Seasparrow with it.");
	   SendClientMessage(playerid,COLOR_ORANGE,"CMD: Currently this class doesn't have cmds.");
	   SendClientMessage(playerid,-1,"/--------------------------------------------------\\");
	 }

    if(gPlayerInfo[playerid][pClass] == CLASS_SUPPORTER)
	 {
	   SendClientMessage(playerid,-1,"/--------------------------------------------------\\");
	   SendClientMessage(playerid,COLOR_ORANGE,"INFO: This class is used to support team mates by providing armour packs.");
	   SendClientMessage(playerid,COLOR_ORANGE,"CMD: Use /armour [ID] to restore player's armour.");
	   SendClientMessage(playerid,-1,"/--------------------------------------------------\\");
     }

	if(gPlayerInfo[playerid][pClass] == CLASS_JETTROOPER)
     {
	   SendClientMessage(playerid,-1,"/--------------------------------------------------\\");
	   SendClientMessage(playerid,COLOR_ORANGE,"INFO: You can use jetpack for easy mobility.");
	   SendClientMessage(playerid,COLOR_ORANGE,"CMD: Use /jp to spawn a ktpack.");
	   SendClientMessage(playerid,-1,"/--------------------------------------------------\\");
	 }
   return 1;
}
That should fix your problem.
Reply
#6

Yeah the problem was / Ty
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)