#1

This is my /hgmembers command code >

PHP код:
CMD:hgmembers(playeridparams[])
{
    
SendClientMessage(playeridlightblue" ");
    
SendClientMessage(playeridlightblue"___________ |- Online [HG] Clan Members -| ___________");
    
SendClientMessage(playeridlightblue" ");
    new 
count 0;
    for(new 
0MAX_PLAYERSi++)
    {
        if(!
IsPlayerConnected(i)) continue;
        if(!
PlayerInfo[i][Rank]) continue;
        new 
string[90], playersname[MAX_PLAYER_NAME];
        
GetPlayerName(iplayersnamesizeof(playersname));
        switch(
PlayerInfo[i][Rank])
        {
            case 
1format(stringsizeof(string), "{33AA33}Rank: %d - %s (ID:%i) | Newbie"PlayerInfo[i][Rank], playersnamei);
            case 
2format(stringsizeof(string), "{33AA33}Rank: %d - %s (ID:%i) | Old Member"PlayerInfo[i][Rank], playersnamei);
            case 
3format(stringsizeof(string), "{FFFF00}Rank: %d - %s (ID:%i) | Super Member"PlayerInfo[i][Rank], playersnamei);
            case 
4format(stringsizeof(string), "{000000}Rank: %d - %s (ID:%i) | Professional Member"PlayerInfo[i][Rank], playersnamei);
            case 
5format(stringsizeof(string), "{33CCFF}Rank: %d - %s (ID:%i) | Master Member"PlayerInfo[i][Rank], playersnamei);
            case 
6format(stringsizeof(string), "{C0C0C0}Rank: %d - %s (ID:%i) | Elite Member"PlayerInfo[i][Rank], playersnamei);
            case 
7format(stringsizeof(string), "{FF0000}Rank: %d - %s (ID:%i) | Co-Leader"PlayerInfo[i][Rank], playersnamei);
            case 
8format(stringsizeof(string), "{FF0000}Rank: %d - %s (ID:%i) | Leader"PlayerInfo[i][Rank], playersnamei);
            case 
9format(stringsizeof(string), "{FF9900}Rank: %d - %s (ID:%i) | Manager"PlayerInfo[i][Rank], playersnamei);
            case 
10format(stringsizeof(string), "{AA3333}Rank: %d - %s (ID:%i) | Founder"PlayerInfo[i][Rank], playersnamei);
            default: continue;
        }
        
SendClientMessage(playeridredstring);
        
count++;
    }
    if(!
countSendClientMessage(playeridlightblue"No [HG] Clan Members online in the list");
    
SendClientMessage(playeridlightblue"___________________________________________________");
    return 
1;

And this is my /sethg command code >

PHP код:
CMD:sethg(playerid,params[]) {
    if(
PlayerInfo[playerid][LoggedIn] == 1) {
        if(
PlayerInfo[playerid][Rank] >= || IsPlayerAdmin(playerid)) {
            new 
tmp[128], tmp2[128], Index;        tmp strtok(params,Index), tmp2 strtok(params,Index);
            if(
isnull(params)) return SendClientMessage(playeridred"USAGE: /sethg [playerid] [Rank]");
            new 
player1levelplayername[MAX_PLAYER_NAME], adminname[MAX_PLAYER_NAME], string[128];
            
player1 strval(tmp);
            if(
isnull(tmp2)) return SendClientMessage(playeridred"USAGE: /sethg [playerid] [Rank]");
            
level strval(tmp2);
            if(
IsPlayerConnected(player1) && player1 != INVALID_PLAYER_ID) {
                if(
PlayerInfo[player1][LoggedIn] == 1) {
                    if(
level ServerInfo[MaxHGRank] ) return SendClientMessage(playerid,red,"ERROR: Incorrect Rank");
                    if(
level == PlayerInfo[player1][Level]) return SendClientMessage(playerid,red,"ERROR: Player is already this Rank");
                       
CMDMessageToAdmins(playerid,"SETHG");
                    
GetPlayerName(player1playernamesizeof(playername));    GetPlayerName(playeridadminnamesizeof(adminname));
                       new 
year,month,day;   getdate(yearmonthday); new hour,minute,secondgettime(hour,minute,second);
                    if(
level 0format(string,sizeof(string),"Administrator %s has set you to [HG] Member Status [Rank %d]",adminnamelevel);
                    else 
format(string,sizeof(string),"Administrator %s has set you to Player Status [level %d]",adminnamelevel);
                    
SendClientMessage(player1,blue,string);
                    if(
level PlayerInfo[player1][Level]) GameTextForPlayer(player1,"HG Rank Promoted"20003);
                    else 
GameTextForPlayer(player1,"HG Rank Demoted"20003);
                    
format(string,sizeof(string),"You have made %s [HG] Rank %d on %d/%d/%d at %d:%d:%d"playernameleveldaymonthyearhourminutesecond); SendClientMessage(playerid,blue,string);
                    
dUserSetINT(PlayerName2(player1)).("level",(level));
                    
PlayerInfo[player1][Rank] = level;
                    return 
PlayerPlaySound(player1,1057,0.0,0.0,0.0);
                } else return 
SendClientMessage(playerid,red,"ERROR: Player must be registered and logged in to be [HG] Member");
            } else return 
SendClientMessage(playeridred"Player is not connected");
        } else return 
SendClientMessage(playerid,red,"ERROR: You are not a high enough level to use this command");
    } else return 
SendClientMessage(playerid,red,"ERROR: You must be logged in to use this commands");

And I found this error >
Код HTML:
F:\GAME\SA-MP Server\HGTDM\Gamemodes\BBTDM~RP.pwn(31264) : error 017: undefined symbol "Rank"
F:\GAME\SA-MP Server\HGTDM\Gamemodes\BBTDM~RP.pwn(31267) : error 017: undefined symbol "Rank"
F:\GAME\SA-MP Server\HGTDM\Gamemodes\BBTDM~RP.pwn(31269) : error 017: undefined symbol "Rank"
F:\GAME\SA-MP Server\HGTDM\Gamemodes\BBTDM~RP.pwn(31270) : error 017: undefined symbol "Rank"
F:\GAME\SA-MP Server\HGTDM\Gamemodes\BBTDM~RP.pwn(31271) : error 017: undefined symbol "Rank"
F:\GAME\SA-MP Server\HGTDM\Gamemodes\BBTDM~RP.pwn(31272) : error 017: undefined symbol "Rank"
F:\GAME\SA-MP Server\HGTDM\Gamemodes\BBTDM~RP.pwn(31273) : error 017: undefined symbol "Rank"
F:\GAME\SA-MP Server\HGTDM\Gamemodes\BBTDM~RP.pwn(31274) : error 017: undefined symbol "Rank"
F:\GAME\SA-MP Server\HGTDM\Gamemodes\BBTDM~RP.pwn(31275) : error 017: undefined symbol "Rank"
F:\GAME\SA-MP Server\HGTDM\Gamemodes\BBTDM~RP.pwn(31276) : error 017: undefined symbol "Rank"
F:\GAME\SA-MP Server\HGTDM\Gamemodes\BBTDM~RP.pwn(31277) : error 017: undefined symbol "Rank"
F:\GAME\SA-MP Server\HGTDM\Gamemodes\BBTDM~RP.pwn(31278) : error 017: undefined symbol "Rank"
F:\GAME\SA-MP Server\HGTDM\Gamemodes\BBTDM~RP.pwn(31386) : error 017: undefined symbol "Rank"
F:\GAME\SA-MP Server\HGTDM\Gamemodes\BBTDM~RP.pwn(31411) : error 017: undefined symbol "Rank"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


14 Errors.
Please someone help me
Reply
#2

What are error lines ? Show us the enum for player infos.
Reply
#3

Add Rank to your enum.

PHP код:
enum pInfo {
    
Rank
}
new 
PlayerInfo[MAX_PLAYERS][pInfo]; 
Reply
#4

Quote:
Originally Posted by iShawn
Посмотреть сообщение
Add Rank to your enum.

PHP код:
enum pInfo {
    
Rank
}
new 
PlayerInfo[MAX_PLAYERS][pInfo]; 
Dont,he doesnt have do the enum like this,uk? lets just wait until he post it.
Reply
#5

Quote:
Originally Posted by WhiteGhost
Посмотреть сообщение
Dont,he doesnt have do the enum like this,uk? lets just wait until he post it.
This is just an example.
Reply
#6

Thanks, I forgot it.
I don't have Rank enum
Thanks for all
Reply
#7

sscanf would tidy this code up.


What iShawn said has a bit to do with it. Your enum is missing Rank.
Reply
#8

I need help again.
I can't set my HG rank

This is my code >
PHP код:
new PlayerInfo[MAX_PLAYERS][pInfo];
enum vInfo
{
    
modding,
    
model,
    
Float:x_spawn,
    
Float:y_spawn,
    
Float:z_spawn,
    
Float:za_spawn,
    
Float:ox_spawn,
    
Float:oy_spawn,
    
Float:oz_spawn,
    
Float:oza_spawn,
    
color_1,
    
color_2,
    
owner[128],
    
vehiclecost,
    
bought,
    
secure,
    
asecure,
    
vused,
    
buybar,
    
name[128],
    
mod1,
    
mod2,
    
mod3,
    
mod4,
    
mod5,
    
mod6,
    
mod7,
    
mod8,
    
mod9,
    
mod10,
    
mod11,
    
mod12,
    
mod13,
    
mod14,
    
mod15,
    
mod16,
    
mod17,
    
paintjob,
    
Temp,

PHP код:
enum ServerData
{
    
MaxPing,
    
ReadPMs,
    
ReadCmds,
    
MaxAdminLevel,
    
MaxHGRank,
    
AdminOnlySkins,
    
AdminSkin,
    
AdminSkin2,
    
NameKick,
    
PartNameKick,
    
AntiBot,
    
AntiSpam,
     
AntiSwear,
     
NoCaps,
    
Locked,
    
Password[128],
    
GiveWeap,
    
GiveMoney,
    
ConnectMessages,
    
AdminCmdMsg,
    
AutoLogin,
    
MaxMuteWarnings,
    
DisableChat,
    
MustLogin,
    
MustRegister,
};
new 
ServerInfo[ServerData]; 
PHP код:
CMD:sethg(playerid,params[]) {
    if(
PlayerInfo[playerid][LoggedIn] == 1) {
        if(
PlayerInfo[playerid][HGRank] >= || IsPlayerAdmin(playerid)) {
            new 
tmp[128], tmp2[128], Index;        tmp strtok(params,Index), tmp2 strtok(params,Index);
            if(
isnull(params)) return SendClientMessage(playeridred"USAGE: /sethg [playerid] [Rank]");
            new 
player1levelplayername[MAX_PLAYER_NAME], adminname[MAX_PLAYER_NAME], string[128];
            
player1 strval(tmp);
            if(
isnull(tmp2)) return SendClientMessage(playeridred"USAGE: /sethg [playerid] [Rank]");
            
level strval(tmp2);
            if(
IsPlayerConnected(player1) && player1 != INVALID_PLAYER_ID) {
                if(
PlayerInfo[player1][LoggedIn] == 1) {
                    if(
level ServerInfo[MaxHGRank] ) return SendClientMessage(playerid,red,"ERROR: Incorrect Rank");
                    if(
level == PlayerInfo[player1][HGRank]) return SendClientMessage(playerid,red,"ERROR: Player is already this Rank");
                       
CMDMessageToAdmins(playerid,"SETHG");
                    
GetPlayerName(player1playernamesizeof(playername));    GetPlayerName(playeridadminnamesizeof(adminname));
                       new 
year,month,day;   getdate(yearmonthday); new hour,minute,secondgettime(hour,minute,second);
                    if(
level 0format(string,sizeof(string),"Administrator %s has set you to [HG] Member Status [Rank %d]",adminnamelevel);
                    else 
format(string,sizeof(string),"Administrator %s has set you to [HG] Member Status [Rank %d]",adminnamelevel);
                    
SendClientMessage(player1,blue,string);
                    if(
level PlayerInfo[player1][HGRank]) GameTextForPlayer(player1,"HG Rank Promoted"20003);
                    else 
GameTextForPlayer(player1,"HG Rank Demoted"20003);
                    
format(string,sizeof(string),"You have made %s [HG] Rank %d on %d/%d/%d at %d:%d:%d"playernameleveldaymonthyearhourminutesecond); SendClientMessage(playerid,blue,string);
                    
dUserSetINT(PlayerName2(player1)).("level",(level));
                    
PlayerInfo[player1][HGRank] = HGRank;
                    return 
PlayerPlaySound(player1,1057,0.0,0.0,0.0);
                } else return 
SendClientMessage(playerid,red,"ERROR: Player must be registered and logged in to be [HG] Member");
            } else return 
SendClientMessage(playeridred"Player is not connected");
        } else return 
SendClientMessage(playerid,red,"ERROR: You are not a high enough level to use this command");
    } else return 
SendClientMessage(playerid,red,"ERROR: You must be logged in to use this commands");

And this is my ladmin\config >
Код HTML:
MaxPing=999999999ms
ReadPMs=1
ReadCmds=1
MaxAdminLevel=8
MaxHGRank=10
AdminOnlySkins=0
AdminSkin=217
AdminSkin2=214
AntiBot=1
AntiSpam=1
AntiSwear=1
NameKick=1
PartNameKick=1
NoCaps=0
Locked=0
SaveWeap=1
SaveMoney=1
ConnectMessages=1
AdminCmdMessages=1
AutoLogin=0
MaxMuteWarnings=4
MustLogin=0
MustRegister=0
Please help me to fix it.
Thanks
Reply
#9

You gave vInfo instead of pInfo...


Before you were using Rank, now you are using HGRank. Are you sure you changed all references to that?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)