SA-MP Forums Archive
Error 10 - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Server (https://sampforum.blast.hk/forumdisplay.php?fid=6)
+--- Forum: Server Support (https://sampforum.blast.hk/forumdisplay.php?fid=19)
+--- Thread: Error 10 (/showthread.php?tid=352525)



Error 10 - Dare Devil..... - 20.06.2012

How can I fix these errors?

Код:
D:\Rafay\COS-RP V 1.0\gamemodes\COS-RP.pwn(91) : warning 217: loose indentation
D:\Rafay\COS-RP V 1.0\gamemodes\COS-RP.pwn(163) : warning 217: loose indentation
D:\Rafay\COS-RP V 1.0\gamemodes\COS-RP.pwn(178) : error 010: invalid function or declaration
D:\Rafay\COS-RP V 1.0\gamemodes\COS-RP.pwn(178 -- 183) : error 010: invalid function or declaration
D:\Rafay\COS-RP V 1.0\gamemodes\COS-RP.pwn(178 -- 186) : error 010: invalid function or declaration
D:\Rafay\COS-RP V 1.0\gamemodes\COS-RP.pwn(178 -- 186) : fatal error 107: too many error messages on one line

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


4 Errors.
pawn Код:
//==============================================================================
CMD:me(playerid, params[])
{
    if(gPlayerLogged{playerid} == 0)
    {
        SendClientMessage(playerid, COLOR_GREY, "You're not logged in.");
        return 1;
    }

    if(isnull(params)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /me [action]");
    new string[128];
    new name[MAX_PLAYER_NAME];
    GetPlayerName(playerid, name, sizeof(name));
    format(string, sizeof(string), "%s %s", name, params);
    ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
    return 1;
}
//==============================================================================
CMD:do(playerid, params[])
{
    if(gPlayerLogged{playerid} == 0)
    {
        SendClientMessage(playerid, COLOR_GREY, "You're not logged in.");
        return 1;
    }

    if(isnull(params)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /do [action]");
    new string[128];
    new name[MAX_PLAYER_NAME];
    GetPlayerName(playerid, name, sizeof(name));
    format(string, sizeof(string), "%s ((%s))", params, name);
    ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
    return 1;
}
//==============================================================================
CMD:shout(playerid, params[]) {
    return cmd_s(playerid, params);
}
//=============================================================================



Re: Error 10 - Mr.1337 - 20.06.2012

Quote:
Originally Posted by Dare Devil.....
Посмотреть сообщение
How can I fix these errors?

Код:
D:\Rafay\COS-RP V 1.0\gamemodes\COS-RP.pwn(91) : warning 217: loose indentation
D:\Rafay\COS-RP V 1.0\gamemodes\COS-RP.pwn(163) : warning 217: loose indentation
D:\Rafay\COS-RP V 1.0\gamemodes\COS-RP.pwn(178) : error 010: invalid function or declaration
D:\Rafay\COS-RP V 1.0\gamemodes\COS-RP.pwn(178 -- 183) : error 010: invalid function or declaration
D:\Rafay\COS-RP V 1.0\gamemodes\COS-RP.pwn(178 -- 186) : error 010: invalid function or declaration
D:\Rafay\COS-RP V 1.0\gamemodes\COS-RP.pwn(178 -- 186) : fatal error 107: too many error messages on one line

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


4 Errors.
pawn Код:
//==============================================================================
CMD:me(playerid, params[])
{
    if(gPlayerLogged{playerid} == 0)
    {
        SendClientMessage(playerid, COLOR_GREY, "You're not logged in.");
        return 1;
    }

    if(isnull(params)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /me [action]");
    new string[128];
    new name[MAX_PLAYER_NAME];
    GetPlayerName(playerid, name, sizeof(name));
    format(string, sizeof(string), "%s %s", name, params);
    ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
    return 1;
}
//==============================================================================
CMD:do(playerid, params[])
{
    if(gPlayerLogged{playerid} == 0)
    {
        SendClientMessage(playerid, COLOR_GREY, "You're not logged in.");
        return 1;
    }

    if(isnull(params)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /do [action]");
    new string[128];
    new name[MAX_PLAYER_NAME];
    GetPlayerName(playerid, name, sizeof(name));
    format(string, sizeof(string), "%s ((%s))", params, name);
    ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
    return 1;
}
//==============================================================================
CMD:shout(playerid, params[]) {
    return cmd_s(playerid, params);
}
//=============================================================================
Try this for the /me command:

pawn Код:
CMD:me(playerid, params[])
{
    if(isnull(params)) return SendClientMessageEx(playerid, COLOR_WHITE, "USAGE: /me [action]");
    new string[128];
    if(PlayerInfo[playerid][pMask] == 0) {
        format(string, sizeof(string), "* %s %s", GetPlayerNameEx(playerid), params);
        ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
    }
    else if (PlayerInfo[playerid][pMask] == 1) {
        format(string, sizeof(string), "* Stranger %s",  params);
        ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
    }
    return 1;
}



Re: Error 10 - Dare Devil..... - 20.06.2012

Quote:
Originally Posted by Mr.1337
Посмотреть сообщение
Try this for the /me command:

pawn Код:
CMD:me(playerid, params[])
{
    if(isnull(params)) return SendClientMessageEx(playerid, COLOR_WHITE, "USAGE: /me [action]");
    new string[128];
    if(PlayerInfo[playerid][pMask] == 0) {
        format(string, sizeof(string), "* %s %s", GetPlayerNameEx(playerid), params);
        ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
    }
    else if (PlayerInfo[playerid][pMask] == 1) {
        format(string, sizeof(string), "* Stranger %s",  params);
        ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
    }
    return 1;
}
It let me compile but when I use /me in game it says UNKNOWN COMMAND