Errors in Compiler? Help!
#2

if im not sure you are not allowed to have call 911 with spaces.
and for other errors. it says that there is already a variable for pName and str

i suggest using strcmp if you really want a command with spaces on it

Example
pawn Код:
new
    call911[24]
;

if(!strcmp(call911, "911", true))
{
//code here
}
EDIT

Here you go. but i think Misiur is much better one you can use his or mine you're choice
pawn Код:
CMD:call 911(playerid, params[])
{
    new
        message[128],
        call911[24]
    ;

    if(sscanf(params, "s[24]", call911))
        return SendUsageError( playerid, "/call 911 [Message]" );
       
    if(!strcmp(call911, "911", true))
    {
        new
            str[128],
            pName[MAX_PLAYER_NAME]
        ;
        GetPlayerName(playerid, pName, sizeof(pName));
        format(str, sizeof(pName), "[911] %s has called 911! Message: %s", pName, message);
        SendClientMessage(playerid, COP_MESSAGE, str);
    }
    return 1;
}
Reply


Messages In This Thread
Errors in Compiler? Help! - by FunnyBear - 19.03.2013, 18:28
Re: Errors in Compiler? Help! - by Patrick - 19.03.2013, 18:30
Re: Errors in Compiler? Help! - by Misiur - 19.03.2013, 18:31
Re: Errors in Compiler? Help! - by FunnyBear - 19.03.2013, 18:32
Re: Errors in Compiler? Help! - by FunnyBear - 19.03.2013, 18:43
Re: Errors in Compiler? Help! - by Misiur - 19.03.2013, 18:46
Re: Errors in Compiler? Help! - by justinnater - 19.03.2013, 18:49
Re: Errors in Compiler? Help! - by Joshman543 - 19.03.2013, 20:27

Forum Jump:


Users browsing this thread: 2 Guest(s)