SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help > Help Archive

 
 
Thread Tools Display Modes
Old 20/07/2011, 12:06 AM   #1
[SWE]Alexzz
Gangsta
 
[SWE]Alexzz's Avatar
 
Join Date: Jan 2011
Location: Home
Posts: 906
Reputation: 55
Default Script[gamemodes/CR-RP.amx]: Run time error 20: "Invalid index parameter (bad entry point)"

Hello, i am currently scripting a RP gm from scratch, and when i attempt to start the server, i get this error:
Code:
[02:57:49] Script[gamemodes/CR-RP.amx]: Run time error 20: "Invalid index parameter (bad entry point)"
The server runs, but my GM gets bugged, Anyone know how to fix that error?

This is my full GM, Not so big yet!
pawn Code:
//||__Includes__||//
#include <a_samp>
#include <zcmd>
#include <streamer>
#include <dini>
#include <dudb>
#include <color>
#include <utils>
#include <sscanf2>

//||__Defines__||//
#define SCRIPT_VERSION "CR-RP - BETA"

//||__Register System Stuff||__
new gPlayerLogged[MAX_PLAYERS];
#define SERVER_USER_FILE "CR-RP/users/%s.ini"
#define LOGIN 1
#define REGISTER 2
#define TUT1 3
#define TUT2 4
#define TUT3 5
#define TUT4 6
#define TUT5 7
#define TUT6 8
#define TUT7 9
#define TUT8 10
#define TUT9 11
#define TUT10 12
#define TUT11 13
new NewPlayer[MAX_PLAYERS];
forward spawn(playerid);
//||__Admin Stuff||__//
forward aMessage(color,const string[],level);
new Reported[MAX_PLAYERS];
enum pInfo
{
    pAdmin,
    pCash,
    pLevel,
    pSkin,
    pAge,
    pSex,
    pCity,
    Float:pPos_x,
    Float:pPos_y,
    Float:pPos_z,
}
new PlayerInfo[MAX_PLAYERS][pInfo];
public OnPlayerRequestClass(playerid, classid)
{
    SetPlayerPos(playerid,2.7508,29.7707,1199.6012);
    SetPlayerCameraPos(playerid,1.7459,28.1340,1199.5938);
    SetPlayerCameraLookAt(playerid,2.9172,29.7163,1199.5938);
    SetPlayerInterior(playerid,1);
    return 1;
}
public OnGameModeInit()
{
    SetGameModeText(SCRIPT_VERSION);
    DisableInteriorEnterExits();
    ShowPlayerMarkers(0);
    //LSPD
    AddStaticVehicleEx(596,1602.70617676,-1683.96069336,5.71062469,270.00000000,-1,-1,15); //Police Car (LSPD)
    AddStaticVehicleEx(596,1602.89453125,-1687.71997070,5.71062469,270.00000000,-1,-1,15); //Police Car (LSPD)
    AddStaticVehicleEx(596,1602.69580078,-1691.79833984,5.71062469,270.00000000,-1,-1,15); //Police Car (LSPD)
    AddStaticVehicleEx(596,1602.75354004,-1695.97399902,5.71062469,270.00000000,-1,-1,15); //Police Car (LSPD)
    AddStaticVehicleEx(596,1602.80847168,-1699.99914551,5.71062469,270.00000000,-1,-1,15); //Police Car (LSPD)
    AddStaticVehicleEx(596,1602.68859863,-1704.05236816,5.71062469,270.00000000,-1,-1,15); //Police Car (LSPD)
    AddStaticVehicleEx(596,1595.35302734,-1710.43164062,5.71062469,180.00000000,-1,-1,15); //Police Car (LSPD)
    AddStaticVehicleEx(596,1591.32934570,-1710.39721680,5.71062469,180.00000000,-1,-1,15); //Police Car (LSPD)
    AddStaticVehicleEx(596,1587.29821777,-1710.36389160,5.71062469,180.00000000,-1,-1,15); //Police Car (LSPD)
    AddStaticVehicleEx(596,1583.52136230,-1710.31994629,5.71062469,180.00000000,-1,-1,15); //Police Car (LSPD)
    AddStaticVehicleEx(596,1578.69177246,-1710.40905762,5.71062469,180.00000000,-1,-1,15); //Police Car (LSPD)
    AddStaticVehicleEx(596,1574.39343262,-1710.23315430,5.71062469,180.00000000,-1,-1,15); //Police Car (LSPD)
    AddStaticVehicleEx(596,1570.47912598,-1710.19104004,5.71062469,180.00000000,-1,-1,15); //Police Car (LSPD)
    AddStaticVehicleEx(596,1565.57910156,-1710.30725098,5.71062469,180.00000000,-1,-1,15); //Police Car (LSPD)
    AddStaticVehicleEx(596,1559.18164062,-1710.50000000,5.71062469,180.00000000,-1,-1,15); //Police Car (LSPD)
    AddStaticVehicleEx(599,1584.73791504,-1671.73132324,6.27702951,90.00000000,-1,-1,15); //Police Ranger
    AddStaticVehicleEx(599,1584.67211914,-1667.61816406,6.27702951,90.00000000,-1,-1,15); //Police Ranger
    AddStaticVehicleEx(596,1545.38427734,-1684.50244141,5.71062469,270.00000000,-1,-1,15); //Police Car (LSPD)
    AddStaticVehicleEx(596,1545.45483398,-1680.64697266,5.71062469,270.00000000,-1,-1,15); //Police Car (LSPD)
    AddStaticVehicleEx(596,1545.44018555,-1676.52734375,5.71062469,270.00000000,-1,-1,15); //Police Car (LSPD)
    AddStaticVehicleEx(596,1545.40380859,-1672.29321289,5.71062469,270.00000000,-1,-1,15); //Police Car (LSPD)
    AddStaticVehicleEx(596,1545.45019531,-1667.62487793,5.71062469,270.00000000,-1,-1,15); //Police Car (LSPD)
    AddStaticVehicleEx(596,1545.49658203,-1663.88330078,5.71062469,270.00000000,-1,-1,15); //Police Car (LSPD)
    //Rent Cars
    AddStaticVehicleEx(579,1526.45507812,-2212.01049805,13.71062469,0.00000000,-1,-1,15); //Police Car (LSPD)
    AddStaticVehicleEx(579,1529.77307129,-2211.80224609,13.71062469,0.00000000,-1,-1,15); //Police Car (LSPD)
    AddStaticVehicleEx(579,1533.13171387,-2211.76757812,13.71062469,0.00000000,-1,-1,15); //Police Car (LSPD)
    AddStaticVehicleEx(561,1536.62927246,-2211.91381836,13.71062469,0.00000000,-1,-1,15); //Police Car (LSPD)
    AddStaticVehicleEx(561,1539.54687500,-2212.10205078,13.71062469,0.00000000,-1,-1,15); //Police Car (LSPD)
    AddStaticVehicleEx(551,1542.92077637,-2211.84033203,13.71062469,0.00000000,-1,-1,15); //Police Car (LSPD)
    AddStaticVehicleEx(550,1546.10266113,-2211.81811523,13.71062469,0.00000000,-1,-1,15); //Police Car (LSPD)
    AddStaticVehicleEx(542,1549.11743164,-2211.68481445,13.71062469,0.00000000,-1,-1,15); //Police Car (LSPD)
    AddStaticVehicleEx(529,1552.36718750,-2211.79125977,13.71062469,0.00000000,-1,-1,15); //Police Car (LSPD)
    AddStaticVehicleEx(529,1521.84277344,-2211.69213867,13.71062469,0.00000000,-1,-1,15); //Police Car (LSPD)
    AddStaticVehicleEx(496,1518.77343750,-2211.49707031,13.71062469,0.00000000,-1,-1,15); //Police Car (LSPD)
    AddStaticVehicleEx(496,1515.43066406,-2211.28271484,13.71062469,0.00000000,-1,-1,15); //Police Car (LSPD)
    AddStaticVehicleEx(491,1512.18652344,-2211.07714844,13.71062469,0.00000000,-1,-1,15); //Police Car (LSPD)
    AddStaticVehicleEx(529,1508.79443359,-2210.85864258,13.71062469,0.00000000,-1,-1,15); //Police Car (LSPD)
    AddStaticVehicleEx(491,1505.55029297,-2210.65209961,13.71062469,0.00000000,-1,-1,15); //Police Car (LSPD)
    AddStaticVehicleEx(475,1502.30615234,-2210.44506836,13.71062469,0.00000000,-1,-1,15); //Police Car (LSPD)
    AddStaticVehicleEx(579,1498.96240234,-2210.23120117,13.71062469,0.00000000,-1,-1,15); //Police Car (LSPD)
    AddStaticVehicleEx(475,1496.01757812,-2210.04345703,13.71062469,0.00000000,-1,-1,15); //Police Car (LSPD)
    AddStaticVehicleEx(475,1492.77392578,-2209.83666992,13.71062469,0.00000000,-1,-1,15); //Police Car (LSPD)
    //LSPD Objects
    CreateDynamicObject(3749,1547.62915039,-1627.57763672,18.24122620,0.00000000,0.00000000,270.00000000); //object(clubgate01_lax) (1)
    CreateDynamicObject(980,1547.59936523,-1627.60925293,15.15620422,0.00000000,0.00000000,90.00000000); //object(airportgate) (1)
    CreateDynamicObject(980,1547.57812500,-1627.61950684,20.15620422,0.00000000,0.00000000,90.00000000); //object(airportgate) (2)
    CreateDynamicObject(991,1542.96362305,-1617.73486328,17.13970757,0.00000000,0.00000000,180.00000000); //object(bar_barriergate1) (1)
    CreateDynamicObject(991,1539.74316406,-1614.45458984,17.13970757,0.00000000,0.00000000,89.99450684); //object(bar_barriergate1) (2)
    CreateDynamicObject(991,1539.72143555,-1607.86340332,17.13970757,0.00000000,0.00000000,89.99450684); //object(bar_barriergate1) (3)
    CreateDynamicObject(991,1539.72241211,-1605.68566895,17.13970757,0.00000000,0.00000000,89.99450684); //object(bar_barriergate1) (4)
    CreateDynamicObject(991,1543.06652832,-1602.39196777,17.13970757,0.00000000,0.00000000,359.99450684); //object(bar_barriergate1) (5)
    CreateDynamicObject(991,1549.69348145,-1602.40673828,17.13970757,0.00000000,0.00000000,359.98901367); //object(bar_barriergate1) (6)
    CreateDynamicObject(991,1556.25317383,-1602.40893555,17.13970757,0.00000000,0.00000000,359.98901367); //object(bar_barriergate1) (7)
    CreateDynamicObject(991,1562.83032227,-1602.43176270,17.13970757,0.00000000,0.00000000,359.98901367); //object(bar_barriergate1) (8)
    CreateDynamicObject(991,1569.49755859,-1602.43041992,17.13970757,0.00000000,0.00000000,359.98901367); //object(bar_barriergate1) (9)
    CreateDynamicObject(991,1576.05187988,-1602.41577148,17.13970757,0.00000000,0.00000000,359.98901367); //object(bar_barriergate1) (10)
    CreateDynamicObject(991,1582.60571289,-1602.40307617,17.13970757,0.00000000,0.00000000,359.98901367); //object(bar_barriergate1) (11)
    CreateDynamicObject(991,1589.17138672,-1602.41345215,17.13970757,0.00000000,0.00000000,359.98901367); //object(bar_barriergate1) (12)
    CreateDynamicObject(991,1595.76196289,-1602.41894531,17.13970757,0.00000000,0.00000000,359.98901367); //object(bar_barriergate1) (13)
    CreateDynamicObject(991,1602.31335449,-1602.44360352,17.13970757,0.00000000,0.00000000,359.98901367); //object(bar_barriergate1) (14)
    CreateDynamicObject(991,1604.72924805,-1602.51013184,17.13970757,0.00000000,0.00000000,359.98901367); //object(bar_barriergate1) (15)
    CreateDynamicObject(991,1607.99926758,-1605.86352539,17.13970757,0.00000000,0.00000000,269.98901367); //object(bar_barriergate1) (16)
    CreateDynamicObject(991,1607.99145508,-1612.46875000,17.13970757,0.00000000,0.00000000,269.98901367); //object(bar_barriergate1) (17)
    CreateDynamicObject(991,1607.98559570,-1619.02124023,17.13970757,0.00000000,0.00000000,269.98901367); //object(bar_barriergate1) (18)
    CreateDynamicObject(991,1607.97875977,-1625.59899902,17.13970757,0.00000000,0.00000000,269.98901367); //object(bar_barriergate1) (19)
    CreateDynamicObject(991,1607.99548340,-1632.15063477,17.13970757,0.00000000,0.00000000,269.98901367); //object(bar_barriergate1) (20)
    CreateDynamicObject(991,1607.98974609,-1634.82409668,17.13970757,0.00000000,0.00000000,269.98901367); //object(bar_barriergate1) (21)
    CreateDynamicObject(991,1604.74755859,-1638.10449219,17.13970757,0.00000000,0.00000000,179.98901367); //object(bar_barriergate1) (22)
    CreateDynamicObject(980,1588.30432129,-1637.90478516,15.20070648,0.00000000,0.00000000,0.00000000); //object(airportgate) (3)
    CreateDynamicObject(980,1598.15844727,-1637.99279785,15.17141151,0.00000000,0.00000000,0.00000000); //object(airportgate) (4)

    return 1;
}

public OnGameModeExit()
{
    return 1;
}
public aMessage(color,const string[],level)
{
    for(new i; i<MAX_PLAYERS; i++)
    {
        if(IsPlayerConnected(i))
        {
            if(PlayerInfo[i][pAdmin] >= level)
            {
                SendClientMessage(i, color, string);
            }
        }
    }
    return 1;
}
public OnPlayerConnect(playerid)
{
    gPlayerLogged[playerid] = 0;
    new name[MAX_PLAYER_NAME], file[256];
    GetPlayerName(playerid, name, sizeof(name));
    SetPlayerColor(playerid, COLOR_WHITE);
    format(file, sizeof(file), SERVER_USER_FILE, name);
    if (!dini_Exists(file))
    {
        ShowPlayerDialog(playerid, REGISTER, DIALOG_STYLE_INPUT, "{FFFFFF}New Account", "{FFFFFF}Welcome to {FF0000}Compton Reality Roleplay\n{FFFFFF}Please type in a password below to register!", "Register", "Leave");
    }
    if(fexist(file))
    {
        ShowPlayerDialog(playerid, LOGIN, DIALOG_STYLE_INPUT, "{FFFFFF}Welcome back", "{FFFFFF}Welcome back to {FF0000}Compton Reality Roleplay!\n\n{FFFFFF}Type in your password below to login.", "Login", "Leave");
    }
    return 1;
}

public OnPlayerDisconnect(playerid, reason)
{
    new name[MAX_PLAYER_NAME], file[256];
    GetPlayerName(playerid, name, sizeof(name));
    new Float:x, Float:y, Float:z;
    GetPlayerPos(playerid,x,y,z);
    format(file, sizeof(file), SERVER_USER_FILE, name);
    if(gPlayerLogged[playerid] == 1)
    {
        dini_IntSet(file, "Level", PlayerInfo[playerid][pLevel]);
        dini_IntSet(file, "Money", PlayerInfo[playerid][pCash]);
        dini_IntSet(file, "Admin",PlayerInfo[playerid][pAdmin]);
        dini_IntSet(file, "Skin",PlayerInfo[playerid][pSkin]);
        dini_IntSet(file, "Age",PlayerInfo[playerid][pAge]);
        dini_IntSet(file, "Sex",PlayerInfo[playerid][pSex]);
        dini_IntSet(file, "City",PlayerInfo[playerid][pCity]);
        PlayerInfo[playerid][pPos_x] = x;
        PlayerInfo[playerid][pPos_y] = y;
        PlayerInfo[playerid][pPos_z] = z;
        dini_FloatSet(file, "Pos_x",PlayerInfo[playerid][pPos_x]);
        dini_FloatSet(file, "Pos_y",PlayerInfo[playerid][pPos_y]);
        dini_FloatSet(file, "Pos_z",PlayerInfo[playerid][pPos_z]);
    }
    gPlayerLogged[playerid] = 0;
    return 1;
}

public OnPlayerSpawn(playerid)
{
    if(NewPlayer[playerid] == 1)
    {
        SetPlayerPos(playerid,-1827.8177,18.1607,1061.1436);
        SetPlayerInterior(playerid, 14);
        SetPlayerSkin(playerid, PlayerInfo[playerid][pSkin]);
        SetPlayerColor(playerid, COLOR_WHITE);
        NewPlayer[playerid] = 0;
        SetPlayerCameraPos(playerid,-1828.4548,11.4160,1061.1436);
        SetPlayerCameraLookAt(playerid,-1827.8177,18.1607,1061.1436);
        TogglePlayerControllable(playerid, 0);
        SetTimerEx("spawn", 7000, false, "i", playerid);
        return 1;
    }
    SetPlayerPos(playerid, PlayerInfo[playerid][pPos_x], PlayerInfo[playerid][pPos_y], PlayerInfo[playerid][pPos_z] + 1);
    SetPlayerColor(playerid, COLOR_WHITE);
    GivePlayerMoney(playerid, PlayerInfo[playerid][pCash]);
    SetPlayerSkin(playerid, PlayerInfo[playerid][pSkin]);
    SetPlayerInterior(playerid, 0);
    return 1;
}

public OnPlayerDeath(playerid, killerid, reason)
{
    return 1;
}

public OnVehicleSpawn(vehicleid)
{
    return 1;
}

public OnVehicleDeath(vehicleid, killerid)
{
    return 1;
}

public OnPlayerText(playerid, text[])
{
    return 1;
}

public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
    return 1;
}

public OnPlayerExitVehicle(playerid, vehicleid)
{
    return 1;
}

public OnPlayerStateChange(playerid, newstate, oldstate)
{
    return 1;
}

public OnPlayerEnterCheckpoint(playerid)
{
    return 1;
}

public OnPlayerLeaveCheckpoint(playerid)
{
    return 1;
}

public OnPlayerEnterRaceCheckpoint(playerid)
{
    return 1;
}

public OnPlayerLeaveRaceCheckpoint(playerid)
{
    return 1;
}

public OnRconCommand(cmd[])
{
    return 1;
}

public OnPlayerRequestSpawn(playerid)
{
    return 1;
}

public OnObjectMoved(objectid)
{
    return 1;
}

public OnPlayerObjectMoved(playerid, objectid)
{
    return 1;
}

public OnPlayerPickUpPickup(playerid, pickupid)
{
    return 1;
}

public OnVehicleMod(playerid, vehicleid, componentid)
{
    return 1;
}

public OnVehiclePaintjob(playerid, vehicleid, paintjobid)
{
    return 1;
}

public OnVehicleRespray(playerid, vehicleid, color1, color2)
{
    return 1;
}

public OnPlayerSelectedMenuRow(playerid, row)
{
    return 1;
}

public OnPlayerExitedMenu(playerid)
{
    return 1;
}

public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
{
    return 1;
}

public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
    return 1;
}

public OnRconLoginAttempt(ip[], password[], success)
{
    return 1;
}

public OnPlayerUpdate(playerid)
{
    SetPlayerScore(playerid, PlayerInfo[playerid][pLevel]);
    return 1;
}

public OnPlayerStreamIn(playerid, forplayerid)
{
    return 1;
}

public OnPlayerStreamOut(playerid, forplayerid)
{
    return 1;
}

public OnVehicleStreamIn(vehicleid, forplayerid)
{
    return 1;
}

public OnVehicleStreamOut(vehicleid, forplayerid)
{
    return 1;
}
public spawn(playerid)
{
    TogglePlayerControllable(playerid, 1);
    SetPlayerPos(playerid,1642.3380,-2239.6638,13.4961);
    SetPlayerInterior(playerid, 0);
    SendClientMessage(playerid, COLOR_GREEN, "Welcome to Compton Reality Roleplay, You are homeless, You only have 5000 to start with!");
    PlayerInfo[playerid][pPos_x] = 1642.3380;
    PlayerInfo[playerid][pPos_y] = -2239.6638;
    PlayerInfo[playerid][pPos_z] = 13.4961;
    SpawnPlayer(playerid);
    NewPlayer[playerid] = 0;
    return 1;
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(dialogid == TUT4)
    {
        if(response)
        {
            if(listitem == 0)
            {
                PlayerInfo[playerid][pCity] = 1;
                ShowPlayerDialog(playerid, TUT5, DIALOG_STYLE_LIST, "What does OOC stand for?","Out Of Character\nNothing\nOut of Caring","Choose","");
            }
            if(listitem == 1)
            {
                PlayerInfo[playerid][pCity] = 2;
                ShowPlayerDialog(playerid, TUT5, DIALOG_STYLE_LIST, "What does OOC stand for?","Out Of Character\nNothing\nOut of Caring","Choose","");
            }
            if(listitem == 2)
            {
                PlayerInfo[playerid][pCity] = 3;
                ShowPlayerDialog(playerid, TUT5, DIALOG_STYLE_LIST, "What does OOC stand for?","Out Of Character\nNothing\nOut of Caring","Choose","");
            }
        }
    }
    if(dialogid == TUT9)
    {
        if(response)
        {
            if(listitem == 0)
            {
                SendClientMessage(playerid, COLOR_RED, "Incorrect, Kicked");
                SendClientMessage(playerid, COLOR_WHITE, " ");
                SendClientMessage(playerid, COLOR_WHITE, " ");
                SendClientMessage(playerid, COLOR_WHITE, " ");
                SendClientMessage(playerid, COLOR_WHITE, " ");
                SendClientMessage(playerid, COLOR_WHITE, " ");
                SendClientMessage(playerid, COLOR_WHITE, " ");
                SendClientMessage(playerid, COLOR_WHITE, " ");
                SendClientMessage(playerid, COLOR_WHITE, " ");
                SendClientMessage(playerid, COLOR_WHITE, "_______________________________");
                SendClientMessage(playerid, COLOR_GREEN, "You lost connection to CR-RP");
                SendClientMessage(playerid, COLOR_WHITE, "_______________________________");
                Kick(playerid);
            }
            if(listitem == 1)
            {
                SendClientMessage(playerid, COLOR_RED, "Incorrect, Kicked");
                SendClientMessage(playerid, COLOR_WHITE, " ");
                SendClientMessage(playerid, COLOR_WHITE, " ");
                SendClientMessage(playerid, COLOR_WHITE, " ");
                SendClientMessage(playerid, COLOR_WHITE, " ");
                SendClientMessage(playerid, COLOR_WHITE, " ");
                SendClientMessage(playerid, COLOR_WHITE, " ");
                SendClientMessage(playerid, COLOR_WHITE, " ");
                SendClientMessage(playerid, COLOR_WHITE, " ");
                SendClientMessage(playerid, COLOR_WHITE, "_______________________________");
                SendClientMessage(playerid, COLOR_GREEN, "You lost connection to CR-RP");
                SendClientMessage(playerid, COLOR_WHITE, "_______________________________");
                Kick(playerid);
            }
            if(listitem == 2)
            {
                SendClientMessage(playerid, COLOR_LIGHTBLUE, "Correct! Moving on!");
                ShowPlayerDialog(playerid, TUT10, DIALOG_STYLE_MSGBOX, "End Of Tutorial","Do you agree to play by the rules? And you understand how to roleplay, And you will treat admins with respect","Yes","No");
            }
        }
    }
    if(dialogid == TUT10)
    {
        if(response)
        {
            SendClientMessage(playerid, COLOR_LIGHTBLUE, "Welcome to Compton Reality Roleplay!");
            NewPlayer[playerid] = 1;
            SpawnPlayer(playerid);
        }
        if(!response)
        {
            SendClientMessage(playerid, COLOR_RED, "Incorrect, Kicked");
            SendClientMessage(playerid, COLOR_WHITE, " ");
            SendClientMessage(playerid, COLOR_WHITE, " ");
            SendClientMessage(playerid, COLOR_WHITE, " ");
            SendClientMessage(playerid, COLOR_WHITE, " ");
            SendClientMessage(playerid, COLOR_WHITE, " ");
            SendClientMessage(playerid, COLOR_WHITE, " ");
            SendClientMessage(playerid, COLOR_WHITE, " ");
            SendClientMessage(playerid, COLOR_WHITE, " ");
            SendClientMessage(playerid, COLOR_WHITE, "_______________________________");
            SendClientMessage(playerid, COLOR_GREEN, "You lost connection to CR-RP");
            SendClientMessage(playerid, COLOR_WHITE, "_______________________________");
            Kick(playerid);
        }
    }
    if(dialogid == TUT8)
    {
        if(response)
        {
            if(listitem == 0)
            {
                SendClientMessage(playerid, COLOR_RED, "Incorrect, Kicked");
                SendClientMessage(playerid, COLOR_WHITE, " ");
                SendClientMessage(playerid, COLOR_WHITE, " ");
                SendClientMessage(playerid, COLOR_WHITE, " ");
                SendClientMessage(playerid, COLOR_WHITE, " ");
                SendClientMessage(playerid, COLOR_WHITE, " ");
                SendClientMessage(playerid, COLOR_WHITE, " ");
                SendClientMessage(playerid, COLOR_WHITE, " ");
                SendClientMessage(playerid, COLOR_WHITE, " ");
                SendClientMessage(playerid, COLOR_WHITE, "_______________________________");
                SendClientMessage(playerid, COLOR_GREEN, "You lost connection to CR-RP");
                SendClientMessage(playerid, COLOR_WHITE, "_______________________________");
                Kick(playerid);
            }
            if(listitem == 1)
            {
                SendClientMessage(playerid, COLOR_LIGHTBLUE, "Correct! Moving on!");
                ShowPlayerDialog(playerid, TUT9, DIALOG_STYLE_LIST, "What does the term Deathmatch mean?","Killing someone with your car\nShooting while driving\nKilling someone for no reason","Okey","");
            }
            if(listitem == 2)
            {
                SendClientMessage(playerid, COLOR_RED, "Incorrect, Kicked");
                SendClientMessage(playerid, COLOR_WHITE, " ");
                SendClientMessage(playerid, COLOR_WHITE, " ");
                SendClientMessage(playerid, COLOR_WHITE, " ");
                SendClientMessage(playerid, COLOR_WHITE, " ");
                SendClientMessage(playerid, COLOR_WHITE, " ");
                SendClientMessage(playerid, COLOR_WHITE, " ");
                SendClientMessage(playerid, COLOR_WHITE, " ");
                SendClientMessage(playerid, COLOR_WHITE, " ");
                SendClientMessage(playerid, COLOR_WHITE, "_______________________________");
                SendClientMessage(playerid, COLOR_GREEN, "You lost connection to CR-RP");
                SendClientMessage(playerid, COLOR_WHITE, "_______________________________");
                Kick(playerid);
            }
        }
    }
    if(dialogid == TUT7)
    {
        if(response)
        {
            if(listitem == 0)
            {
                SendClientMessage(playerid, COLOR_RED, "Incorrect, Kicked");
                SendClientMessage(playerid, COLOR_WHITE, " ");
                SendClientMessage(playerid, COLOR_WHITE, " ");
                SendClientMessage(playerid, COLOR_WHITE, " ");
                SendClientMessage(playerid, COLOR_WHITE, " ");
                SendClientMessage(playerid, COLOR_WHITE, " ");
                SendClientMessage(playerid, COLOR_WHITE, " ");
                SendClientMessage(playerid, COLOR_WHITE, " ");
                SendClientMessage(playerid, COLOR_WHITE, " ");
                SendClientMessage(playerid, COLOR_WHITE, "_______________________________");
                SendClientMessage(playerid, COLOR_GREEN, "You lost connection to CR-RP");
                SendClientMessage(playerid, COLOR_WHITE, "_______________________________");
                Kick(playerid);
            }
            if(listitem == 1)
            {
                SendClientMessage(playerid, COLOR_LIGHTBLUE, "Correct! Moving on!");
                ShowPlayerDialog(playerid, TUT8, DIALOG_STYLE_LIST, "What does the term RevengeKill mean?","Killing someone for no reason\nGoing back to kill the one who killed you\nUsing helicopters to kill someone","Choose","");
            }
            if(listitem == 2)
            {
                SendClientMessage(playerid, COLOR_RED, "Incorrect, Kicked");
                SendClientMessage(playerid, COLOR_WHITE, " ");
                SendClientMessage(playerid, COLOR_WHITE, " ");
                SendClientMessage(playerid, COLOR_WHITE, " ");
                SendClientMessage(playerid, COLOR_WHITE, " ");
                SendClientMessage(playerid, COLOR_WHITE, " ");
                SendClientMessage(playerid, COLOR_WHITE, " ");
                SendClientMessage(playerid, COLOR_WHITE, " ");
                SendClientMessage(playerid, COLOR_WHITE, " ");
                SendClientMessage(playerid, COLOR_WHITE, "_______________________________");
                SendClientMessage(playerid, COLOR_GREEN, "You lost connection to CR-RP");
                SendClientMessage(playerid, COLOR_WHITE, "_______________________________");
                Kick(playerid);
            }
        }
    }
    if(dialogid == TUT6)
    {
        if(response)
        {
            if(listitem == 0)
            {
                SendClientMessage(playerid, COLOR_LIGHTBLUE, "Correct! Moving on!");
                ShowPlayerDialog(playerid, TUT7, DIALOG_STYLE_LIST, "What does the term Metagame mean?","Having Un-Natural Powers\nUsing OOC information ICLY\nStealing someones car without /me's","Choose","");
            }
            if(listitem == 1)
            {
                SendClientMessage(playerid, COLOR_RED, "Incorrect, Kicked");
                SendClientMessage(playerid, COLOR_WHITE, " ");
                SendClientMessage(playerid, COLOR_WHITE, " ");
                SendClientMessage(playerid, COLOR_WHITE, " ");
                SendClientMessage(playerid, COLOR_WHITE, " ");
                SendClientMessage(playerid, COLOR_WHITE, " ");
                SendClientMessage(playerid, COLOR_WHITE, " ");
                SendClientMessage(playerid, COLOR_WHITE, " ");
                SendClientMessage(playerid, COLOR_WHITE, " ");
                SendClientMessage(playerid, COLOR_WHITE, "_______________________________");
                SendClientMessage(playerid, COLOR_GREEN, "You lost connection to CR-RP");
                SendClientMessage(playerid, COLOR_WHITE, "_______________________________");
                Kick(playerid);
            }
            if(listitem == 2)
            {
                SendClientMessage(playerid, COLOR_RED, "Incorrect, Kicked");
                SendClientMessage(playerid, COLOR_WHITE, " ");
                SendClientMessage(playerid, COLOR_WHITE, " ");
                SendClientMessage(playerid, COLOR_WHITE, " ");
                SendClientMessage(playerid, COLOR_WHITE, " ");
                SendClientMessage(playerid, COLOR_WHITE, " ");
                SendClientMessage(playerid, COLOR_WHITE, " ");
                SendClientMessage(playerid, COLOR_WHITE, " ");
                SendClientMessage(playerid, COLOR_WHITE, " ");
                SendClientMessage(playerid, COLOR_WHITE, "_______________________________");
                SendClientMessage(playerid, COLOR_GREEN, "You lost connection to CR-RP");
                SendClientMessage(playerid, COLOR_WHITE, "_______________________________");
                Kick(playerid);
            }
        }
    }
    if(dialogid == TUT5)
    {
        if(response)
        {
            if(listitem == 0)
            {
                SendClientMessage(playerid, COLOR_LIGHTBLUE, "Correct! Moving on!");
                ShowPlayerDialog(playerid, TUT6, DIALOG_STYLE_LIST, "What does the term PowerGame mean?","Forcing someone to roleplay\nKilling someone for no reason\nUsing OOC Information ICLY","Choose","");
            }
            if(listitem == 1)
            {
                SendClientMessage(playerid, COLOR_RED, "Incorrect, Kicked");
                SendClientMessage(playerid, COLOR_WHITE, " ");
                SendClientMessage(playerid, COLOR_WHITE, " ");
                SendClientMessage(playerid, COLOR_WHITE, " ");
                SendClientMessage(playerid, COLOR_WHITE, " ");
                SendClientMessage(playerid, COLOR_WHITE, " ");
                SendClientMessage(playerid, COLOR_WHITE, " ");
                SendClientMessage(playerid, COLOR_WHITE, " ");
                SendClientMessage(playerid, COLOR_WHITE, " ");
                SendClientMessage(playerid, COLOR_WHITE, "_______________________________");
                SendClientMessage(playerid, COLOR_GREEN, "You lost connection to CR-RP");
                SendClientMessage(playerid, COLOR_WHITE, "_______________________________");
                Kick(playerid);
            }
            if(listitem == 2)
            {
                SendClientMessage(playerid, COLOR_RED, "Incorrect, Kicked");
                SendClientMessage(playerid, COLOR_WHITE, " ");
                SendClientMessage(playerid, COLOR_WHITE, " ");
                SendClientMessage(playerid, COLOR_WHITE, " ");
                SendClientMessage(playerid, COLOR_WHITE, " ");
                SendClientMessage(playerid, COLOR_WHITE, " ");
                SendClientMessage(playerid, COLOR_WHITE, " ");
                SendClientMessage(playerid, COLOR_WHITE, " ");
                SendClientMessage(playerid, COLOR_WHITE, " ");
                SendClientMessage(playerid, COLOR_WHITE, "_______________________________");
                SendClientMessage(playerid, COLOR_GREEN, "You lost connection to CR-RP");
                SendClientMessage(playerid, COLOR_WHITE, "_______________________________");
                Kick(playerid);
            }
        }
    }
    if(dialogid == TUT2)
    {
        if(response)
        {
            PlayerInfo[playerid][pAge] = strval(inputtext);
            ShowPlayerDialog(playerid, TUT3, DIALOG_STYLE_MSGBOX, "Tutorial Part 3","Are you a Male or Female?","Male","Female");
        }
    }
    if(dialogid == TUT3)
    {
        if(response)
        {
            PlayerInfo[playerid][pSex] = 1;
            ShowPlayerDialog(playerid, TUT4, DIALOG_STYLE_LIST, "Where are you from? - Part 4","Los Santos\nSan Fierro\nLas Venturas","Choose","");
        }
        if(!response)
        {
            PlayerInfo[playerid][pSex] = 2;
            ShowPlayerDialog(playerid, TUT4, DIALOG_STYLE_LIST, "Where are you from? - Part 4","Los Santos\nSan Fierro\nLas Venturas","Choose","");
        }
    }
    if(dialogid == TUT1)
    {
        if(response)
        {
            SetPlayerSkin(playerid, strval(inputtext));
            PlayerInfo[playerid][pSkin] = strval(inputtext);
            ShowPlayerDialog(playerid, TUT2, DIALOG_STYLE_INPUT, "Tutorial Part 2","Enter your age 20-80","Choose","");
        }
    }
    if(dialogid == TUT11)
    {
        if(response)
        {
            SpawnPlayer(playerid);
            SpawnPlayer(playerid);
            SendClientMessage(playerid, COLOR_GREEN, "Welcome back!");
        }
        if(!response)
        {
            Kick(playerid);
        }
    }
    if (dialogid == LOGIN)
    {
        new name[MAX_PLAYER_NAME], file[256];
        GetPlayerName(playerid, name, sizeof(name));
        format(file, sizeof(file), SERVER_USER_FILE, name);
        if(!response) return Kick(playerid);
        if (!strlen(inputtext)) return ShowPlayerDialog(playerid, LOGIN, DIALOG_STYLE_INPUT, "{FFFFFF}Welcome back", "{FFFFFF}Welcome back to {FF0000}Compton Reality Roleplay!\n\n{FFFFFF}Type in your password below to login.", "Login", "Leave");
        new tmp;
        tmp = dini_Int(file, "Password");
        if(udb_hash(inputtext) != tmp) {
            SendClientMessage(playerid, COLOR_RED, "You have enterd the wrong password.");
            ShowPlayerDialog(playerid, LOGIN, DIALOG_STYLE_INPUT, "{FFFFFF}Welcome back", "{FFFFFF}Welcome back to {FF0000}Compton Reality Roleplay!\n\n{FFFFFF}Type in your password below to login.", "Login", "Leave");
        }
        else
        {
            gPlayerLogged[playerid] = 1;
            new skin = PlayerInfo[playerid][pSkin];
            PlayerInfo[playerid][pAdmin] = dini_Int(file, "AdminLevel");
            SetPlayerSkin(playerid,skin);
            GivePlayerMoney(playerid, dini_Int(file, "Money")-GetPlayerMoney(playerid));
            SendClientMessage(playerid,COLOR_RED, "[SYSTEM]: Successfully logged in!");
            ShowPlayerDialog(playerid, TUT11, DIALOG_STYLE_MSGBOX, "Logged in","You have succesfully logged in, Do you agree to play by the rules?","Yes","No");
        }
    }
    if (dialogid == REGISTER)
    {
        new name[MAX_PLAYER_NAME], file[256], string[128];
        GetPlayerName(playerid, name, sizeof(name));
        format(file, sizeof(file), SERVER_USER_FILE, name);
        if(!response) return Kick(playerid);
        if (!strlen(inputtext)) return
        ShowPlayerDialog(playerid, REGISTER, DIALOG_STYLE_INPUT, "{FFFFFF}New Account", "{FFFFFF}Welcome to {FF0000}Compton Reality Roleplay\n{FFFFFF}Please type in a password below to register!", "Register", "Leave");
        dini_Create(file);
        dini_IntSet(file, "Password", udb_hash(inputtext));
        dini_IntSet(file, "AdminLevel",PlayerInfo[playerid][pAdmin] = 0);
        dini_IntSet(file, "Money",PlayerInfo[playerid][pCash] = 5000);
        dini_IntSet(file, "Level",PlayerInfo[playerid][pLevel] = 1);
        format(string, 128, "You succesfully registered the nickname %s with password %s, you have been auto logged in.", name, inputtext);
        SendClientMessage(playerid, COLOR_YELLOW, string);
        gPlayerLogged[playerid] = 1;
        SetPlayerPos(playerid,2.7508,29.7707,1199.6012);
        SetPlayerCameraPos(playerid,1.7459,28.1340,1199.5938);
        SetPlayerCameraLookAt(playerid,2.9172,29.7163,1199.5938);
        SetPlayerInterior(playerid,1);
        ShowPlayerDialog(playerid, TUT1, DIALOG_STYLE_INPUT, "Tutorial Part 1","Enter your skin ID","Okey","");
    }
    return 1;
}

public OnPlayerClickPlayer(playerid, clickedplayerid, source)
{
    return 1;
}

This is my server.cfg, if its for any help:

Code:
echo Executing Server Config...
lanmode 0
rcon_password changemeeee
maxplayers 32
port 7777
hostname Unknown Roleplay
gamemode0 CR-RP 1
filterscripts ls_elevator
plugins streamer sscanf
announce 0
query 1
weburl www.sa-mp.com
onfoot_rate 40
incar_rate 40
weapon_rate 40
stream_distance 300.0
stream_rate 1000
maxnpc 0
logtimeformat [%H:%M:%S]
It runs SSCANF2 & Streamer plugin as you see.
__________________
We never fail, we only shine with brilliance. One king one faith one religion. And if you hear me come and join the revolution
[SWE]Alexzz is offline  
Old 20/07/2011, 12:14 AM   #2
Kitten
High-roller
 
Kitten's Avatar
 
Join Date: Jul 2010
Location: Canada
Posts: 2,313
Reputation: 236
Default Re: Script[gamemodes/CR-RP.amx]: Run time error 20: "Invalid index parameter (bad entry point)"

Seems like its not your gamemode problem i removed the colors include i only got two warnings from the variables you havent used it might be the colors include or utils
__________________
Kitten is offline  
Old 20/07/2011, 12:15 AM   #3
[SWE]Alexzz
Gangsta
 
[SWE]Alexzz's Avatar
 
Join Date: Jan 2011
Location: Home
Posts: 906
Reputation: 55
Default Re: Script[gamemodes/CR-RP.amx]: Run time error 20: "Invalid index parameter (bad entry point)"

Its when i start the server i get the problem.
__________________
We never fail, we only shine with brilliance. One king one faith one religion. And if you hear me come and join the revolution
[SWE]Alexzz is offline  
Old 20/07/2011, 12:25 AM   #4
bob_dillan
Big Clucker
 
Join Date: Apr 2009
Posts: 53
Reputation: 0
Default Re: Script[gamemodes/CR-RP.amx]: Run time error 20: "Invalid index parameter (bad entry point)"

Add this above your OnGameModeInit.

main(){}
bob_dillan is offline  
Old 20/07/2011, 12:26 AM   #5
[SWE]Alexzz
Gangsta
 
[SWE]Alexzz's Avatar
 
Join Date: Jan 2011
Location: Home
Posts: 906
Reputation: 55
Default Re: Script[gamemodes/CR-RP.amx]: Run time error 20: "Invalid index parameter (bad entry point)"

Works fine :P Thanks
__________________
We never fail, we only shine with brilliance. One king one faith one religion. And if you hear me come and join the revolution
[SWE]Alexzz is offline  
 

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Run time error 20: "Invalid index parameter (bad entry Point" privacy94 Scripting Help 9 21/02/2012 04:56 PM
"Invalid index parameter (bad entry point)" Gertin Help Archive 1 23/05/2011 07:11 PM
Runtime Error 20: "Invalid index parameter (bad entry point)" Gupike Help Archive 12 24/01/2011 10:27 AM
Script[gamemodes/SSv1.amx]: Run time error 20: "Invalid index parameter (bad entry point)" HydraX Server Support 0 16/08/2010 10:47 PM
Script[gamemodes/gd.amx]: Run time error 20: "Invalid index parameter DarkPower Help Archive 1 16/05/2010 05:48 PM


All times are GMT. The time now is 07:21 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.