Need help URGENTLY!
#1

Okay, le me was making a simple user system and I'm getting some errors I don't know how to solve.

C:\Users\ADMIN\Desktop\Gangwars\gamemodes\US.pwn(3 0) : error 021: symbol already defined: "PlayerInfo"
C:\Users\ADMIN\Desktop\Gangwars\gamemodes\US.pwn(1 64) : error 028: invalid subscript (not an array or too many subscripts): "PlayerInfo"
C:\Users\ADMIN\Desktop\Gangwars\gamemodes\US.pwn(1 64) : warning 215: expression has no effect
C:\Users\ADMIN\Desktop\Gangwars\gamemodes\US.pwn(1 64) : error 001: expected token: ";", but found "]"
C:\Users\ADMIN\Desktop\Gangwars\gamemodes\US.pwn(1 64) : error 029: invalid expression, assumed zero
C:\Users\ADMIN\Desktop\Gangwars\gamemodes\US.pwn(1 64) : fatal error 107: too many error messages on one line


Line 20-30:

pawn Код:
enum PlayerInfo
{
    PlayerPass,
    PlayerCash,
    PlayerAdminLevel,
    PlayerKills,
    PlayerDeaths,
    PlayerDonorLevel,
    PlayerScore
}
new PlayerInfo[MAX_PLAYERS][PlayerInfo];

Stock (LINE 164):

pawn Код:
forward LoadUser_data(playerid,name[],value[]);
public LoadUser_data(playerid,name[],value[])
{
    INI_Int("Password",PlayerInfo[playerid][PlayerPass]); /// Line 164
    INI_Int("Cash",PlayerInfo[playerid][PlayerCash]);
    INI_Int("AdminLevel",PlayerInfo[playerid][PlayerAdminLevel]);
    INI_Int("Kills",PlayerInfo[playerid][PlayerKills]);
    INI_Int("Deaths",PlayerInfo[playerid][PlayerDeaths]);
    INI_Int("DLevel", PlayerInfo[playerid][PlayerDonorLevel]);
    INI_Int("Score", PlayerInfo[playerid][PlayerScore]);
    return 1;
}


Also, I want to know some stuff:

How do I make a command to set a players admin level (ONLY LEVEL 5+ CAN SET THE LEVEL)
How do I make a command to set a players Donor level (Only LEVEL 5+ can set the level)
Reply
#2

Ok :

pawn Код:
enum pInfo
{
    PlayerPass,
    PlayerCash,
    PlayerAdminLevel,
    PlayerKills,
    PlayerDeaths,
    PlayerDonorLevel,
    PlayerScore
}
new PlayerInfo[MAX_PLAYERS][pInfo];
pawn Код:
forward LoadUser_data(playerid,name[],value[]);
public LoadUser_data(playerid,name[],value[])
{
    INI_Int("Password",PlayerInfo[playerid][PlayerPass]); /// Line 164
    INI_Int("Cash",PlayerInfo[playerid][PlayerCash]);
    INI_Int("AdminLevel",PlayerInfo[playerid][PlayerAdminLevel]);
    INI_Int("Kills",PlayerInfo[playerid][PlayerKills]);
    INI_Int("Deaths",PlayerInfo[playerid][PlayerDeaths]);
    INI_Int("DLevel", PlayerInfo[playerid][PlayerDonorLevel]);
    INI_Int("Score", PlayerInfo[playerid][PlayerScore]);
    return 1;
}
And commands :

pawn Код:
CMD:adminlevel(playerid, params[])
{
    new id, lvl, Name[24];
    if(PlayerInfo[playerid][PlayerAdminLevel] == 5);
    {
        if (sscanf(params, "ui", id, lvl)) SendClientMessage(playerid, COLOR_GREY, "CMD: /adminlevel [Player/ID] [Level]");
        else
        {
            GetPlayerName(id, Name, sizeof(Name));
            PlayerInfo[id][PlayerAdminLevel] = lvl;
        }
    }
    else
        return 0;

    return 1;
}
pawn Код:
CMD:donorlevel(playerid, params[])
{
    new id, lvl, Name[24];
    if(PlayerInfo[playerid][PlayerAdminLevel] == 5);
    {
        if (sscanf(params, "ui", id, lvl)) SendClientMessage(playerid, COLOR_GREY, "CMD: /donorlevel [Player/ID] [Level]");
        else
        {
            GetPlayerName(id, Name, sizeof(Name));
            PlayerInfo[id][PlayerDonorLevel] = lvl;
        }
    }
    else
        return 0;

    return 1;
}
Tell me if I made mistakes or not.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)