05.06.2016, 01:35
I need help again.
I can't set my HG rank
This is my code >
And this is my ladmin\config >
Please help me to fix it.
Thanks
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] >= 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");
}
Код 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
Thanks