Errors in script
#1

Heres the errors:

pawn Код:
C:\Users\Elias\Desktop\New folder\gamemodes\Ventura.pwn(98) : error 017: undefined symbol "PlayerInfo"
C:\Users\Elias\Desktop\New folder\gamemodes\Ventura.pwn(99) : error 017: undefined symbol "PlayerInfo"
C:\Users\Elias\Desktop\New folder\gamemodes\Ventura.pwn(100) : error 017: undefined symbol "PlayerInfo"
C:\Users\Elias\Desktop\New folder\gamemodes\Ventura.pwn(276) : error 021: symbol already defined: "udb_hash"
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


4 Errors.
Im new to scripting thats why i ask so much for help, tho i understand if you dont wanna help me ^.^


Heres Script:

pawn Код:
// This script was made by [BoSs]Frost
#include <YSI\y_ini>
#include <ladmin>
#include <a_samp>
#define COLOR_GREEN 0x33AA33AA
#define COLOR_RED 0xAA3333AA
#define COLOR_YELLOW 0xFFFF00AA
#define COLOR_WHITE 0xFFFFFFAA
#define COLOR_BLUE 0x0000BBAA
#define COLOR_LIGHTBLUE 0x33CCFFAA
#define COLOR_ORANGE 0xFF9900AA
#define COLOR_RED 0xAA3333AA
#define COLOR_LIME 0x10F441AA
#pragma unused ret_memcpy
#define DIALOG_REGISTER 1
#define DIALOG_LOGIN 2
#define DIALOG_SUCCESS_1 3
#define DIALOG_SUCCESS_2 4
#define PATH "/Users/%s.ini"
#define COL_WHITE "{FFFFFF}"
#define COL_RED "{F81414}"
#define COL_GREEN "{00FF22}"
#define COL_LIGHTBLUE "{00CED1}"

///////////////NEW objects shit///////////////
new infopickup;
new exitpickup;
//////////////////////////////////////////////
main()
{
    print("\n----------------------------------");
    print(" BoSs Clan Server 0.0.1");
    print("----------------------------------\n");
}


public OnGameModeInit()
{
    SetGameModeText("Ventura RPG");
    AddPlayerClass(188, 1958.3783, 1343.1572, 15.3746, 269.1425, 26, 1500, 0, 0, 0, 0);
    AddPlayerClass(185, 1958.3783, 1343.1572, 15.3746, 269.1425, 26, 1500, 0, 0, 0, 0);
    AddPlayerClass(120, 1958.3783, 1343.1572, 15.3746, 269.1425, 26, 1500, 0, 0, 0, 0);
    AddPlayerClass(217, 1958.3783, 1343.1572, 15.3746, 269.1425, 26, 1500, 0, 0, 0, 0);
    AddPlayerClass(240, 1958.3783, 1343.1572, 15.3746, 269.1425, 26, 1500, 0, 0, 0, 0);
    AddPlayerClass(93, 1958.3783, 1343.1572, 15.3746, 269.1425, 26, 1500, 0, 0, 0, 0);
    exitpickup = CreatePickup(1239,1,388.8720,173.8050,1008.3828);
    infopickup = CreatePickup(1239,1,2488.0466,2397.3337,10.8203);
// spawn car
    AddStaticVehicle(451,2040.0525,1319.2756,10.3833,183.2440,16,16);
// spawn car
    AddStaticVehicle(429,2040.5231,1359.2783,10.3712,177.1306,13,13);
// spawn bike
    AddStaticVehicle(522,2031.3623,1359.5353,10.3907,256.2907,6,25);
// spawn bike
    AddStaticVehicle(522,2031.9823,1361.4525,10.3772,268.9690,6,25);
// spawn bike
    AddStaticVehicle(522,2031.8800,1363.1105,10.3942,268.6747,6,25);

    return 1;
}


public OnGameModeExit()
{
    return 1;
}


public OnPlayerRequestClass(playerid, classid)
{
    SetPlayerPos(playerid,1966.9149,1342.9484,16.6161);
    SetPlayerCameraPos(playerid,1958.3783,1343.1572,15.3746);
    SetPlayerCameraLookAt(playerid,1958.3783,1343.1572,15.3746);
    return 1;
}


public OnPlayerConnect(playerid)
{
    if(fexist(UserPath(playerid)))
    {
        INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
        ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT,""COL_WHITE"Login",""COL_WHITE"Type your password below to login.","Login","Quit");
    }
    else
    {
        ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT,""COL_WHITE"Registering...",""COL_WHITE"Type your password below to register a new account.","Register","Quit");
    }
    return 1;
}


public OnPlayerDisconnect(playerid, reason)
{
    new INI:File = INI_Open(UserPath(playerid));
    INI_SetTag(File,"data");
    INI_WriteInt(File,"Cash",GetPlayerMoney(playerid));
    INI_WriteInt(File,"Admin",PlayerInfo[playerid][pAdmin]);
    INI_WriteInt(File,"Kills",PlayerInfo[playerid][pKills]);
    INI_WriteInt(File,"Deaths",PlayerInfo[playerid][pDeaths]);
    INI_Close(File);
    return 1;
}


public OnPlayerSpawn(playerid)
{
    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 OnPlayerCommandText(playerid, cmdtext[])
{
    if(strcmp(cmdtext, "/fbitp", true) == 0)
    {
        SetPlayerPos(playerid, 2496.3687,2394.4463,10.8203);
        return 1;
    }
    if (strcmp(cmdtext, "/enter", true) == 0)
    {
        if(IsPlayerInRangeOfPoint(playerid,10,2488.0466,2397.3337,10.8203))
        {
            SetPlayerPos(playerid,388.8720,173.8050,1008.3828);
            return 1;
        }
    }
    if (strcmp(cmdtext, "/exit", true) == 0)
    {
        if(IsPlayerInRangeOfPoint(playerid,10,388.8720,173.8050,1008.3828))
        {
            SetPlayerPos(playerid,2488.0466,2397.3337,10.8203);
            return 1;
        }
    }
    if (strcmp(cmdtext, "/kill", true) == 0)
    {
        SetPlayerHealth(playerid, 0.0);
        return 1;
    }
    if (strcmp(cmdtext, "/para", true) == 0)
    {
        GivePlayerWeapon(playerid, 46, 1);
        return 1;
    }
    return 0;
}


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)
{
    if(pickupid == infopickup) {
        GameTextForPlayer(playerid,"~r~ /enter ~y~ to enter this building",3000,1);
    }
    if(pickupid == exitpickup) {
        GameTextForPlayer(playerid,"~r~ /enter ~y~ to enter this building",3000,1);
    }
    return 1;
}
enum pInfo
{
    pPass,
    pCash,
    pAdmin,
    pKills,
    pDeaths
}
new PlayerInfo[MAX_PLAYERS][pInfo];
forward LoadUser_data(playerid,name[],value[]);
public LoadUser_data(playerid,name[],value[])
{
    INI_Int("Password",PlayerInfo[playerid][pPass]);
    INI_Int("Cash",PlayerInfo[playerid][pCash]);
    INI_Int("Admin",PlayerInfo[playerid][pAdmin]);
    INI_Int("Kills",PlayerInfo[playerid][pKills]);
    INI_Int("Deaths",PlayerInfo[playerid][pDeaths]);
    return 1;
}
stock UserPath(playerid)
{
    new string[128],playername[MAX_PLAYER_NAME];
    GetPlayerName(playerid,playername,sizeof(playername));
    format(string,sizeof(string),PATH,playername);
    return string;
}
/*Credits to Dracoblue*/
stock udb_hash(buf[]) {
    new length=strlen(buf);
    new s1 = 1;
    new s2 = 0;
    new n;
    for (n=0; n<length; n++)
    {
       s1 = (s1 + buf[n]) % 65521;
       s2 = (s2 + s1)     % 65521;
    }
    return (s2 << 16) + s1;
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    switch( dialogid )
    {
        case DIALOG_REGISTER:
        {
            if (!response) return Kick(playerid);
            if(response)
            {
                if(!strlen(inputtext)) return ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT, ""COL_WHITE"Registering...",""COL_RED"You have entered an invalid password.\n"COL_WHITE"Type your password below to register a new account.","Register","Quit");
                new INI:File = INI_Open(UserPath(playerid));
                INI_SetTag(File,"data");
                INI_WriteInt(File,"Password",udb_hash(inputtext));
                INI_WriteInt(File,"Cash",0);
                INI_WriteInt(File,"Admin",0);
                INI_WriteInt(File,"Kills",0);
                INI_WriteInt(File,"Deaths",0);
                INI_Close(File);

                SetSpawnInfo(playerid, 0, 0, 1958.33, 1343.12, 15.36, 269.15, 0, 0, 0, 0, 0, 0);
                SpawnPlayer(playerid);
                ShowPlayerDialog(playerid, DIALOG_SUCCESS_1, DIALOG_STYLE_MSGBOX,""COL_WHITE"Success!",""COL_GREEN"Great! Your Y_INI system works perfectly. Relog to save your stats!","Ok","");
            }
        }

        case DIALOG_LOGIN:
        {
            if ( !response ) return Kick ( playerid );
            if( response )
            {
                if(udb_hash(inputtext) == PlayerInfo[playerid][pPass])
                {
                    INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
                    GivePlayerMoney(playerid, PlayerInfo[playerid][pCash]);
                    ShowPlayerDialog(playerid, DIALOG_SUCCESS_2, DIALOG_STYLE_MSGBOX,""COL_WHITE"Success!",""COL_GREEN"You have successfully logged in!","Ok","");
                }
                else
                {
                    ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT,""COL_WHITE"Login",""COL_RED"You have entered an incorrect password.\n"COL_WHITE"Type your password below to login.","Login","Quit");
                }
                return 1;
            }
        }
    }
    return 1;
}
Reply
#2

Define 'PlayerInfo'?
and see if ''udb_hash'' has been defined twice, remove other one
Reply
#3

now i got these
pawn Код:
C:\Users\Elias\Desktop\New folder\gamemodes\Ventura.pwn(99) : error 029: invalid expression, assumed zero
C:\Users\Elias\Desktop\New folder\gamemodes\Ventura.pwn(99) : warning 215: expression has no effect
C:\Users\Elias\Desktop\New folder\gamemodes\Ventura.pwn(99) : error 001: expected token: ";", but found "]"
C:\Users\Elias\Desktop\New folder\gamemodes\Ventura.pwn(99) : error 029: invalid expression, assumed zero
C:\Users\Elias\Desktop\New folder\gamemodes\Ventura.pwn(99) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase

4 Errors.
[Pawn]


and its to this line:

pawn Код:
INI_WriteInt(File,"Admin",PlayerInfo[playerid][pAdmin]);
Reply
#4

pawn Код:
enum pInfo
{
    pAdmin
}

new
    PlayerInfo[ MAX_PLAYERS ][ pInfo ];
Reply
#5

working now?
Reply
#6

still same error at line 99 :S
Reply
#7

Quote:
Originally Posted by GNGification
Посмотреть сообщение
working now?
yea but now i got the errors on line 99 :S
Reply
#8

I have no idea this time... all of them are in same way

INI_WriteInt(File,"Admin",PlayerInfo[playerid][pAdmin]);
INI_WriteInt(File,"Deaths",PlayerInfo[playerid][pDeaths]);

Make sure that 'Admin' is everywhere where Deaths are (exept like OnPlayerDeath etc)
Reply
#9

From where you download that script? @Defence1771
Reply
#10

I made it my self why?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)