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]); PlayerInfo[playerid][pAdmin] = INI_Int(file, "Admin"); } 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; }
INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid); GivePlayerMoney(playerid, PlayerInfo[playerid][pCash]); PlayerInfo[playerid][pAdmin] = INI_Int(file, "Admin"); // This ONe
PlayerInfo[playerid][pAdmin] = INI_Int(file, "Admin"); // This ONe
CMD:kick(playerid,params[]) { new id,reason[128],name[MAX_PLAYER_NAME], string1[128]; if(PlayerInfo[playerid][pAdmin] > 2) { if(sscanf(params,"us[128]",id,reason)) return SendClientMessage(playerid, COLOR_RED,"USAGE: /kick <id> <reason>"); else { format(string1,sizeof(string1),"%s have been kicked from the server: reason: %s",GetPlayerName(id,name,sizeof(name)),reason); SendClientMessageToAll(COLOR_RED,string1); Kick(id); } } else { SendClientMessage(playerid, COLOR_RED, "ERROR: You Need To Be Level 2 To Use This Command"); } return 1; }
INI_ParseFile
PlayerInfo[playerid][pAdmin] = INI_Int(file, "Admin");
CMD:kick(playerid, params[])
{
new aname [MAX_PLAYER_NAME], reason[128], string[128], tname [MAX_PLAYER_NAME], targetid;
if(PlayerInfo[playerid][pAdmin] < 2) return SendClientMessage(playerid, Red, "You must be a level 2 Admin to use this command!");
if(sscanf(params, "us[128]", targetid, reason)) return SendClientMessage(playerid, Yellow, "Correct Usage: /kick [PlayerID] [Reason]");
if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid, Yellow, "Player is not connected to the server");
GetPlayerName(playerid, aname, MAX_PLAYER_NAME);
GetPlayerName(targetid, tname, MAX_PLAYER_NAME);
format(string, sizeof(string), "Admin %s has kicked %s. Reason: %s", aname, tname, reason);
SendClientMessageToAll(Yellow, string);
Kick(targetid);
return 1;
}
INI_Int("Admin", PlayerInfo[playerid][pAdmin]);
[pAdmin] > 2) |
[pAdmin] >= 2) |
CMD:setlevel(playerid,params[]) { new id,level,n[MAX_PLAYER_NAME], str[265]; new playername[MAX_PLAYER_NAME]; new adminname [MAX_PLAYER_NAME]; if(IsPlayerAdmin(playerid)) { if(sscanf(params,"ud",id,level)) return SendClientMessage(playerid, COLOR_RED, "USAGE: /setlevel <id> level[1-7]!"); else { if(level > 7) return SendClientMessage(playerid, COLOR_RED, "USAGE: /setlevel <id> level[1-7]!"); else { GetPlayerName(id,n,MAX_PLAYER_NAME); GetPlayerName(player1, playername, sizeof(playername)); GetPlayerName(playerid, adminname, sizeof(adminname)); new INI:File = INI_Open(UserPath(id)); INI_WriteInt(File,"Admin",level); INI_Close(File); format(str,sizeof(str),"You have set %s's level to %d",n,level); SendClientMessage(playerid,COLOR_LIGHTBLUE,str); format(str,sizeof(str),"Administrator %s Has Set Your Level To %d",adminname,level); SendClientMessage(player1,COLOR_LIGHTBLUE,str); } } } else { SendClientMessage(playerid, COLOR_RED, "ERROR: You Are Not Rcon Admin!"); } return 1; }