SA-MP Forums Archive
error 010: invalid function or declaration - 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: error 010: invalid function or declaration (/showthread.php?tid=290274)



error 010: invalid function or declaration - rati555 - 15.10.2011

pawn Код:
public OnPlayerRequestClass(playerid, classid)
{
        if (gPlayerAccount[playerid] != 0)
        {
            new loginstring[128];
            new loginname[64];
            GetPlayerName(playerid, loginname, sizeof(loginname));
            format(loginstring, sizeof(loginstring), "Gamarjoba %s!\nEs niki Daregistrirebulia.\nShegidzlia Shexvide:", loginname);
            PlayerPlaySound(playerid, 1187,-119.9460,23.1096,12.2238);
            DOO_SetPlayerPos(playerid,1679.3274,1447.8716,47.7780);
            SetPlayerFacingAngle(playerid,273.2993);
            SetPlayerCameraPos(playerid,1679.3274+5,1447.8716,47.7780+2);
            SetPlayerCameraLookAt(playerid,1679.3274,1447.8716,47.7780);
            ShowPlayerDialog(playerid, 12346, DIALOG_STYLE_INPUT, "Shesvla", loginstring, "Shesvla", "Gasvla");
        }
        else
        {
            gPlayerAccount[playerid] = 0;
            new regstring[128];
            new regname[64];
            GetPlayerName(playerid, regname, sizeof(regname));
                    PlayerPlaySound(playerid, 1187,-119.9460,23.1096,12.2238);
        DOO_SetPlayerPos(playerid,1679.3274,1447.8716,47.7780);
        SetPlayerFacingAngle(playerid,273.2993);
        SetPlayerCameraPos(playerid,1679.3274+5,1447.8716,47.7780+2);
        SetPlayerCameraLookAt(playerid,1679.3274,1447.8716,47.7780);
            format(regstring, sizeof(regstring), "Gamarjoba %s!\nShen Ar Gyavs Sheni Personaji.\nShegidzlia Daregistrirde:", regname);
            ShowPlayerDialog(playerid, 12345, DIALOG_STYLE_INPUT, "Registracia", regstring, "Registracia", "Gasvla");
        }
        SetTimerEx("FixCamera", 1000, false, "i", playerid);
    }
    return 1; // error on this line
}



Re: error 010: invalid function or declaration - SmiT - 15.10.2011

You had an extra bracket.
pawn Код:
public OnPlayerRequestClass(playerid, classid)
{
    if (gPlayerAccount[playerid] != 0)
    {
        new loginstring[128];
        new loginname[64];
        GetPlayerName(playerid, loginname, sizeof(loginname));
        format(loginstring, sizeof(loginstring), "Gamarjoba %s!\nEs niki Daregistrirebulia.\nShegidzlia Shexvide:", loginname);
        PlayerPlaySound(playerid, 1187,-119.9460,23.1096,12.2238);
        DOO_SetPlayerPos(playerid,1679.3274,1447.8716,47.7780);
        SetPlayerFacingAngle(playerid,273.2993);
        SetPlayerCameraPos(playerid,1679.3274+5,1447.8716,47.7780+2);
        SetPlayerCameraLookAt(playerid,1679.3274,1447.8716,47.7780);
        ShowPlayerDialog(playerid, 12346, DIALOG_STYLE_INPUT, "Shesvla", loginstring, "Shesvla", "Gasvla");
    }
    else
    {
        gPlayerAccount[playerid] = 0;
        new regstring[128];
        new regname[64];
        GetPlayerName(playerid, regname, sizeof(regname));
        PlayerPlaySound(playerid, 1187,-119.9460,23.1096,12.2238);
        DOO_SetPlayerPos(playerid,1679.3274,1447.8716,47.7780);
        SetPlayerFacingAngle(playerid,273.2993);
        SetPlayerCameraPos(playerid,1679.3274+5,1447.8716,47.7780+2);
        SetPlayerCameraLookAt(playerid,1679.3274,1447.8716,47.7780);
        format(regstring, sizeof(regstring), "Gamarjoba %s!\nShen Ar Gyavs Sheni Personaji.\nShegidzlia Daregistrirde:", regname);
        ShowPlayerDialog(playerid, 12345, DIALOG_STYLE_INPUT, "Registracia", regstring, "Registracia", "Gasvla");
    }
    SetTimerEx("FixCamera", 1000, false, "i", playerid);
    return 1;
}



Re: error 010: invalid function or declaration - =WoR=Varth - 15.10.2011

pawn Код:
}//Remove this bracket
    return 1; // error on this line
}