Need Help
#1

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

This is my code >
PHP Code:
new PlayerInfo[MAX_PLAYERS][pInfo];

enum vInfo
{
modding,
model,
Float_spawn,
Float:y_spawn,
Float:z_spawn,
Float:za_spawn,
Floatx_spawn,
Floaty_spawn,
Floatz_spawn,
Floatza_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 Code:
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 Code:
CMDethg(playerid,params[]) {
if(PlayerInfo[playerid][LoggedIn] == 1) {
if(PlayerInfo[playerid][HGRank] >= 7 || IsPlayerAdmin(playerid)) {
new tmp[128], tmp2[128], Index; tmp = strtok(params,Index), tmp2 = strtok(params,Index);
if(isnull(params)) return SendClientMessage(playerid, red, "USAGE: /sethg [playerid] [Rank]");
new player1, level, playername[MAX_PLAYER_NAME], adminname[MAX_PLAYER_NAME], string[128];
player1 = strval(tmp);
if(isnull(tmp2)) return SendClientMessage(playerid, red, "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(player1, playername, sizeof(playername)); GetPlayerName(playerid, adminname, sizeof(adminname));
new year,month,day; getdate(year, month, day); new hour,minute,second; gettime(hour,minute,second);

if(level > 0) format(string,sizeof(string),"Administrator %s has set you to [HG] Member Status [Rank %d]",adminname, level);
else format(string,sizeof(string),"Administrator %s has set you to [HG] Member Status [Rank %d]",adminname, level);
SendClientMessage(player1,blue,string);

if(level > PlayerInfo[player1][HGRank]) GameTextForPlayer(player1,"HG Rank Promoted", 2000, 3);
else GameTextForPlayer(player1,"HG Rank Demoted", 2000, 3);

format(string,sizeof(string),"You have made %s [HG] Rank %d on %d/%d/%d at %d:%d:%d", playername, level, day, month, year, hour, minute, second); 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(playerid, red, "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 Code:
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
#2

first of all noone gonna fix you this. It is unreadable. Use [code] or [php] tags
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)