String invalid character constant
#3

PHP код:
stock GetFactionTypeName(type)
{
    new 
typestr[20];
    switch(
type)
    {
        case 
FACTION_TYPE_NONEtypestr "None";
        case 
FACTION_TYPE_POLICEtypestr "Police";
        case 
FACTION_TYPE_MEDICtypestr "Fire & Medic";
        case 
FACTION_TYPE_GOVtypestr "Government";
        case 
FACTION_TYPE_NEWStypestr "News";
        case 
FACTION_TYPE_WEAPONStypestr "Weapon dist.";
        case 
FACTION_TYPE_DRUGStypestr "Drug dist.";
        default: 
typestr "undefined";
    }
    return 
typestr;

Use " to enclose strings as opposed to '. A good usage for ' is for characters, for example:

PHP код:
public OnPlayerText(playeridtext[])
{
    if(
text[0] == '#'// The first character of the text is #
    
else if(text[6] == 'A'// The 7th character of the text is a capital A 
etc.
Reply


Messages In This Thread
String invalid character constant - by JaydenJason - 15.08.2016, 10:21
Re: String invalid character constant - by Misiur - 15.08.2016, 10:44
Re: String invalid character constant - by Threshold - 15.08.2016, 10:44
Re: String invalid character constant - by JaydenJason - 15.08.2016, 10:45

Forum Jump:


Users browsing this thread: 1 Guest(s)