Script doesn't load user data after the filterscript is restarted
#1

This bug wasn't a priority until now. I'm using Y_ini to save and load user data from a file, and it works just fine unless the filterscript itself is reloaded, then stats are lost. I've looked it over, but I'm not great in this area of scripting so I'm wondering how to fix this. Here's the script:

Код:
/* Urban Administration System v1.00********************
*********************************************************
************Coded by Luke from Urban-Gaming**************
*********************************************************
***Developed by Aerotactics for The Hunger Games Server**
*/
/*
SSCANF REMINDER

Specifier(s)			Name				Example values
	i, d			Integer				1, 42, -10
	c				Character			a, o, *
	l				Logical				true, false
	b				Binary				01001, 0b1100
	h, x			Hex					1A, 0x23
	o				Octal				045 12
	n				Number				42, 0b010, 0xAC, 045
	f				Float				0.7, -99.5
	g				IEEE Float			0.7, -99.5, INFINITY, -INFINITY, NAN, NAN_E
	u				User name/id 		******, 0
	q				Bot name/id			ShopBot, 27
	r				Player name/id		******, 42
*/
// Includes
#include <a_samp>
#include <zcmd>
#include <sscanf2>
#include <YSI\y_ini>
#include <foreach>
#include <bLibrary>

//Color Defines
#define COLOR_INVISIBLE 0xFFFFFF00
#define COLOR_LIGHTBLUE 0x33CCFFAA
#define COLOR_GREY 0xAFAFAFAA
#define COLOR_PINK 0xFF66FFAA
#define COLOR_WHITE 0xFFFFFFAA
#define COLOR_DARKRED 0x660000AA
#define COLOR_ORANGE 0xFF9900AA
#define COLOR_BRIGHTRED 0xFF0000AA
#define COLOR_INDIGO 0x4B00B0AA
#define COLOR_VIOLET 0x9955DEEE
#define COLOR_LIGHTRED 0xFF99AADD
#define COLOR_SEAGREEN 0x00EEADDF
#define COLOR_GRAYWHITE 0xEEEEFFC4
#define COLOR_LIGHTNEUTRALBLUE 0xabcdef66
#define COLOR_GREENISHGOLD 0xCCFFDD56
#define COLOR_LIGHTBLUEGREEN 0x0FFDD349
#define COLOR_NEUTRALBLUE 0xABCDEF01
#define COLOR_LIGHTCYAN 0xAAFFCC33
#define COLOR_LEMON 0xDDDD2357
#define COLOR_MEDIUMBLUE 0x63AFF00A
#define COLOR_NEUTRAL 0xABCDEF97
#define COLOR_BLACK 0x00000000
#define COLOR_NEUTRALGREEN 0x81CFAB00
#define COLOR_DARKGREEN 0x12900BBF
#define COLOR_LIGHTGREEN 0x24FF0AB9
#define COLOR_DARKBLUE 0x300FFAAB
#define COLOR_BLUEGREEN 0x46BBAA00
#define COLOR_PINK 0xFF66FFAA
#define COLOR_LIGHTBLUE 0x33CCFFAA
#define COLOR_DARKRED 0x660000AA
#define COLOR_ORANGE 0xFF9900AA
#define COLOR_PURPLE 0x800080AA
#define COLOR_GRAD1 0xB4B5B7FF
#define COLOR_GRAD2 0xBFC0C2FF
#define COLOR_RED1 0xFF0000AA
#define COLOR_GREY 0xAFAFAFAA
#define COLOR_WHITE 0xFFFFFFAA
#define COLOR_BROWN 0x993300AA
#define COLOR_CYAN 0x99FFFFAA
#define COLOR_TAN 0xFFFFCCAA
#define COLOR_PINK 0xFF66FFAA
#define COLOR_KHAKI 0x999900AA
#define COLOR_LIME 0x99FF00AA
#define COLOR_SYSTEM 0xEFEFF7AA
#define COLOR_GRAD2 0xBFC0C2FF
#define COLOR_GRAD4 0xD8D8D8FF
#define COLOR_GRAD6 0xF0F0F0FF
#define COLOR_GRAD2 0xBFC0C2FF
#define COLOR_GRAD3 0xCBCCCEFF
#define COLOR_GRAD5 0xE3E3E3FF
#define COLOR_GRAD1 0xB4B5B7FF
#define COL_BLUE "{345ACF}"
#define COL_RED "{E01B4C}"
#define COL_WHITE "{FFFFFF}"
#define COL_ORA "{E0A21B}"
#define COL_YELLOW "{F5E618}"
#define COL_GREEN "{2EAD15}"
#define ERROR   "You're not authorized to use this command."
//==================/ahelp Commands Defines======================//

//
#define HELP_DIALOG 100
#define HELP_DIALOG1 101
#define HELP_DIALOG2 102
#define HELP_DIALOG3 103
#define HELP_DIALOG4 104
#define HELP_DIALOG5 105
#define HELP_DIALOG_X 106
//
#define AHELP_DIALOG 150
#define AHELP_DIALOG1 107
#define AHELP_DIALOG2 108
#define AHELP_DIALOG3 109
#define AHELP_DIALOG4 110
#define AHELP_DIALOG5 111
//
#define BHELP_DIALOG 113
//
#define LOBBY_DIALOG1 200
#define LOBBY_DIALOG2 201
#define LOBBY_DIALOG3 202
#define LOBBY_DIALOG4 203
#define LOBBY_DIALOG5 204
//
#define SHOP_DIALOG 210
#define SHOP_SKIN 211
//
#define CREDITS_DIALOG 112
//
#define BAN_DIALOG 700
//
#define VIP_DIALOG 400
#define VSKIN_DIALOG 405
//========================Register System========================//
#define DIALOG_REGISTER 450
#define DIALOG_LOGIN 451
#define DIALOG_SUCCESS_1 452
#define DIALOG_SUCCESS_2 453
#define DIALOG_PASSWORDCHANGE 454
#define PATH "/Users/%s.ini"
// Enum/defines/variables//
#define COL_LIGHTBLUE "{00CED1}"
//Specating
new gSpectateID[MAX_PLAYERS];
new gSpectateType[MAX_PLAYERS];
new gPlayerSpectating[MAX_PLAYERS];
new Text:Spectation;
new Float:sx, Float:sy, Float:sz, Float:sa;
new spectimer;
//
new agod[MAX_PLAYERS];
//
new reporttimer[MAX_PLAYERS];
//
new SpamCount[MAX_PLAYERS];
new ChatSpamTime[MAX_PLAYERS][3];
new muted[MAX_PLAYERS];
//
#define AutoUnmuteTime 2
//
new viparmour[MAX_PLAYERS];
//
new quad;
//
#define EnableSpectate      true
#define ADMIN_SPEC_TYPE_NONE	0
#define ADMIN_SPEC_TYPE_PLAYER 	1
//
#define banPATH "Users/Logs/BanLog.txt"
//
enum pInfo
{
    pPass,
    pCash,
    pAdmin,
    pBeta,
    pKills,
    pDeaths,
    pVip,
    pBan,
    pScore,
    pSkin
}
new PlayerInfo[MAX_PLAYERS][pInfo];

forward LoadUser_data(playerid,name[],value[]);
public LoadUser_data(playerid,name[],value[])
{
    INI_Int("Password",PlayerInfo[playerid][pPass]);
    INI_Int("Cash",PlayerInfo[playerid][pCash]);
    INI_Int("Admin",PlayerInfo[playerid][pAdmin]);
    INI_Int("Beta",PlayerInfo[playerid][pBeta]);
    INI_Int("Kills",PlayerInfo[playerid][pKills]);
    INI_Int("Deaths",PlayerInfo[playerid][pDeaths]);
    INI_Int("Vip",PlayerInfo[playerid][pVip]);
    INI_Int("Score",PlayerInfo[playerid][pScore]);
    INI_Int("Ban",PlayerInfo[playerid][pBan]);
    INI_Int("Skin",PlayerInfo[playerid][pSkin]);
    return 1;
}

stock UserPath(playerid)
{
    new string[128],playername[MAX_PLAYER_NAME];
    GetPlayerName(playerid,playername,sizeof(playername));
    format(string,sizeof(string),PATH,playername);
    return string;
}

stock udb_hash(buf[]) {
    new length=strlen(buf);
    new s1 = 1;
    new s2 = 0;
    new n;
    for (n=0; n<length; n++)
    {
       s1 = (s1 + buf[n]) % 65521;
       s2 = (s2 + s1)     % 65521;
    }
    return (s2 << 16) + s1;
}




stock SendClientMessageToAdmins(color, const message[])
{
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        if(PlayerInfo[i][pAdmin] >= 1)
        {
            SendClientMessage(i, color, message);
        }
    }
    return true;
}

stock SendClientMessageToBetas(color, const message[])
{
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        if(PlayerInfo[i][pBeta] == 1)
        {
            SendClientMessage(i, color, message);
        }
    }
    return true;
}


forward AutoUnMute(pID);
public AutoUnMute(pID)
{
    muted[pID] = 0;
    SpamCount[pID]=0;
    SendClientMessage(pID, COLOR_GREEN, "You have been unmuted.");
    return 1;
}


stock AntiSpam(playerid)//stock function
{
    SpamCount[playerid]++;
    switch (SpamCount[playerid])
    {
        case 1:
        {
            ChatSpamTime[playerid][0]=gettime();
        }
        case 2:
        {
            if((gettime()-ChatSpamTime[playerid][0])<4)
            {
                SendClientMessage(playerid,COLOR_RED,"You have received a warning for spamming. (1/3)");
                ChatSpamTime[playerid][1]=gettime();
            }
            else SpamCount[playerid]=0;
        }
        case 3:
        {
            if((gettime()-ChatSpamTime[playerid][1])<4)
            {
                SendClientMessage(playerid,COLOR_RED,"You have received a warning for spamming. (2/3)");
                ChatSpamTime[playerid][2]=gettime();
            }
            else SpamCount[playerid]=0;
        }
        case 4..50:
        {
            new string[128],name[24];
            GetPlayerName(playerid,name,24);
            if((gettime()-ChatSpamTime[playerid][2])<4)
            {
                format(string,sizeof(string),"%s has been muted for 2 minutes for spamming.",name);
                SendClientMessageToAll(0xFF0000FF,string);
                SendClientMessage(playerid,COLOR_RED,"You have been warned for spamming. (3/3). You're now muted for 2 minutes.");
                muted[playerid]=1;
                SetTimerEx("AutoUnMute",AutoUnmuteTime*60000,false,"i",playerid);
			}
        }
    }
    return 1;
}

stock SendClientMessageToVips(color, const message [])
{
	for(new i = 0; i < MAX_PLAYERS; i++)
	{
	    if(PlayerInfo[i][pVip] >=1)
	    {
	        SendClientMessage(i, color, message);
	    }
	}
	return true;
}


stock GetName(playerid)
{
    new Name[MAX_PLAYER_NAME];
    if(IsPlayerConnected(playerid))
    {
		GetPlayerName(playerid, Name, sizeof(Name));
	}
	return Name;
}

stock GetAdminLvlName(playerid)
{
	new str[64];
	if (PlayerInfo[playerid][pAdmin] == 0) str = ("None");
	if (PlayerInfo[playerid][pAdmin] == 1) str = ("Moderator");
	if (PlayerInfo[playerid][pAdmin] == 2) str = ("General Admin");
	if (PlayerInfo[playerid][pAdmin] == 3) str = ("Senior Admin");
	if (PlayerInfo[playerid][pAdmin] == 4) str = ("Server Owner");
	return str;
}


stock GetVipLvlName(playerid)
{
	new str[64];
	if(PlayerInfo[playerid][pVip] == 1) str = ("Bronze Vip");
	if(PlayerInfo[playerid][pVip] == 2) str = ("Silver Vip");
	if(PlayerInfo[playerid][pVip] == 3) str = ("Gold Vip");
	return str;
}


//=====================================


#if defined FILTERSCRIPT

public OnFilterScriptInit()
{
	print("\n--------------------------------------");
	print(" HG Administration System v1.30 Loaded");
	print("--------------------------------------\n");
	return 1;
}

public OnFilterScriptExit()
{
	return 1;
}

#else

main()
{
	print("\n----------------------------------");
	print(" Blank Gamemode by your name here");
	print("----------------------------------\n");
}

#endif

public OnGameModeInit()
{
    return 1;
}

public OnPlayerConnect(playerid)
{
    if(fexist(UserPath(playerid)))
    {
        INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
        ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT,""COL_WHITE"Login",""COL_WHITE"Type your password below to login.","Login","Quit");
    }
    else
    {
        ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT,""COL_WHITE"Registering...",""COL_WHITE"Type your password below to register a new account.","Register","Quit");
    }
    SpamCount[playerid]=0;
    muted[playerid]=0;
    if (PlayerInfo[playerid][pBeta] >= 1)
    {
        SetPVarInt(playerid,"Beta",1);
    }
	else if (PlayerInfo[playerid][pBeta] == 0)
	{
        SetPVarInt(playerid,"Beta",0);
    }
	return 1;
}



public OnPlayerDisconnect(playerid, reason)
{
	
    new INI:File = INI_Open(UserPath(playerid));
    INI_SetTag(File,"data");
    INI_WriteInt(File,"Cash",GetPlayerMoney(playerid));
    INI_WriteInt(File,"Admin",PlayerInfo[playerid][pAdmin]);
    INI_WriteInt(File,"Beta",PlayerInfo[playerid][pBeta]);
    INI_WriteInt(File,"Kills",PlayerInfo[playerid][pKills]);
    INI_WriteInt(File,"Deaths",PlayerInfo[playerid][pDeaths]);
    INI_WriteInt(File,"Vip",PlayerInfo[playerid][pVip]);
    INI_WriteInt(File,"Score",GetPlayerScore(playerid));
	INI_WriteInt(File,"Ban",PlayerInfo[playerid][pBan]);
	INI_WriteInt(File,"Skin",GetPlayerSkin(playerid));
    INI_Close(File);
	return 1;
}


public OnPlayerSpawn(playerid)
{
	SetPlayerSkin(playerid, PlayerInfo[playerid][pSkin]);
	return 1;
}

public OnPlayerDeath(playerid, killerid, reason)
{
    PlayerInfo[killerid][pKills]++;
    PlayerInfo[playerid][pDeaths]++;
	return 1;
}


public OnVehicleSpawn(vehicleid)
{
	return 1;
}

public OnVehicleDeath(vehicleid, killerid)
{
	DestroyVehicle(quad);
	return 1;
}

public OnPlayerText(playerid, text[])
{
    if(muted[playerid] == 1)
    {
        SendClientMessage(playerid, COLOR_RED, "You're currently muted.");
        return 0;
    }
    else
    {
        if(PlayerInfo[playerid][pAdmin]==0)
        {
            AntiSpam(playerid);
        }
    }
	return 1;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
    if (PlayerInfo[playerid][pBeta]==1)
    {
        if (strcmp(cmdtext, "/goto", true) == 0 || strcmp(cmdtext, "/set", true) == 0 || strcmp(cmdtext, "/bsay", true) == 0 ||strcmp(cmdtext, "/setthirst", true) == 0 ||strcmp(cmdtext, "/startround", true) == 0 ||strcmp(cmdtext, "/endround", true) == 0 ||strcmp(cmdtext, "/setbeta", true) == 0 ||strcmp(cmdtext, "/quad", true) == 0)
     	{
            new pname[MAX_PLAYER_NAME];
            GetPlayerName(playerid,pname,sizeof(pname));
            for (new i=0;i<MAX_PLAYERS;i++)
            {
                if (PlayerInfo[i][pBeta]>1)
                {
                    new string[128];
                    format(string,sizeof(string),"[Trial Tester]%s sent a command: %s",pname,cmdtext);
                    SendClientMessage(i,COLOR_CYAN,string);
                }
            }
        }
    }
    return 0;
}
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
	return 1;
}

public OnPlayerExitVehicle(playerid, vehicleid)
{
    if (vehicleid==quad)
	{
	    DestroyVehicle(quad);
	}
	return 1;
}

public OnPlayerStateChange(playerid, newstate, oldstate)
{
	return 1;
}

public OnPlayerEnterCheckpoint(playerid)
{
	return 1;
}

public OnPlayerLeaveCheckpoint(playerid)
{
	return 1;
}

public OnPlayerEnterRaceCheckpoint(playerid)
{
	return 1;
}

public OnPlayerLeaveRaceCheckpoint(playerid)
{
	return 1;
}

public OnRconCommand(cmd[])
{
	return 1;
}

public OnPlayerRequestSpawn(playerid)
{
	return 1;
}

public OnObjectMoved(objectid)
{
	return 1;
}

public OnPlayerObjectMoved(playerid, objectid)
{
	return 1;
}

public OnPlayerPickUpPickup(playerid, pickupid)
{
	return 1;
}

public OnVehicleMod(playerid, vehicleid, componentid)
{
	return 1;
}

public OnVehiclePaintjob(playerid, vehicleid, paintjobid)
{
	return 1;
}

public OnVehicleRespray(playerid, vehicleid, color1, color2)
{
	return 1;
}

public OnPlayerSelectedMenuRow(playerid, row)
{
	return 1;
}

public OnPlayerExitedMenu(playerid)
{
	return 1;
}

public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
{
	return 1;
}

public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
	return 1;
}

public OnRconLoginAttempt(ip[], password[], success)
{
	return 1;
}

public OnPlayerUpdate(playerid)
{
	return 1;
}

public OnPlayerStreamIn(playerid, forplayerid)
{
	return 1;
}

public OnPlayerStreamOut(playerid, forplayerid)
{
	return 1;
}

public OnVehicleStreamIn(vehicleid, forplayerid)
{
	return 1;
}

public OnVehicleStreamOut(vehicleid, forplayerid)
{
	return 1;
}

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(dialogid == LOBBY_DIALOG1)
	{
	    if(response)
	    {
	    	if(listitem == 0)
	    	{
	    	    if(GetPlayerMoney(playerid) >= 5000 )
				{
					ShowPlayerDialog(playerid,SHOP_DIALOG,DIALOG_STYLE_LIST,"Hunger Games Shop", "Buy a different skin ($5,000)\nHalf-Armour($2,500)\nFull-Armour($5,000)", "Select", "Cancel");
					return 1;
				}
				else
				{
				    SendClientMessage(playerid,COLOR_GREY, "Error: You need at least 5,000 to open the shop.");
				    ShowPlayerDialog(playerid,LOBBY_DIALOG1, DIALOG_STYLE_LIST, "Lobby List","The Shop\nLobby Maps\nLobby Activities","OK","Cancel");
				    return 1;
				}
			}
			if(listitem == 1)
	    	{
	    	    ShowPlayerDialog(playerid,LOBBY_DIALOG2, DIALOG_STYLE_LIST,"Parkour Maps","Parkour\nReturn to Lobby","OK","Cancel");
                return 1;
			}
			if(listitem == 2)
	    	{
	    	    ShowPlayerDialog(playerid,LOBBY_DIALOG3,DIALOG_STYLE_MSGBOX,"Lobby Activities","The lobby activities are planned for the future,\nthey will be listed here as they are added!","OK","");
                return 1;
			}
		}
	}
	if(dialogid == LOBBY_DIALOG2)
	{
	    if(response)
	    {
	        if(listitem == 0)
	    	{
	    	    SetPlayerPos(playerid,2443.5,-3094.7,312);
	    	    SetPlayerFacingAngle(playerid, 90);
				SetCameraBehindPlayer(playerid);
				PlayAudioStreamForPlayer(playerid,"http://k007.kiwi6.com/hotlink/r9rnsy0dhc/The_Hunger_Games_Theme_Song_by_Memphiston.mp3");
               	return 1;
			}
			if(listitem == 1)
	    	{
				SetPlayerPos(playerid,-858.8223,506.0542,1511.6312);
				SetPlayerFacingAngle(playerid, -90);
				SetCameraBehindPlayer(playerid);
				StopAudioStreamForPlayer(playerid);
				return 1;
			}
		}
		else
		{
		    ShowPlayerDialog(playerid,LOBBY_DIALOG1, DIALOG_STYLE_LIST, "Lobby List","The Shop\nLobby Maps\nLobby Activities","OK","Cancel");
			return 1;
		}
	}
	if(dialogid == LOBBY_DIALOG3)
	{
	    if(response)
	    {
	        ShowPlayerDialog(playerid,LOBBY_DIALOG1, DIALOG_STYLE_LIST, "Lobby List","The Shop\nLobby Maps\nLobby Activities","OK","Cancel");
			return 1;
		}
	}
    if(dialogid == SHOP_DIALOG)
	{
	    if(response)
	    {
	    	if(listitem == 0)
	    	{
	    		ShowPlayerDialog(playerid, SHOP_SKIN, DIALOG_STYLE_INPUT, "Enter a valid Skin ID.", "Enter Skin ID",  "OK", "Cancel");
                return 1;
			}
	    	if(listitem == 1) //armour
	    	{
	    	    SendClientMessage(playerid,COLOR_GREEN, "You have purchased half-protection body armour from the shop.");
				SetPlayerArmour(playerid, 50);
				GivePlayerMoney(playerid, -2500);
				ShowPlayerDialog(playerid,SHOP_DIALOG,DIALOG_STYLE_LIST,"Hunger Games Shop", "Buy a different skin ($5,000)\nHalf-Armour($2,500)\nFull-Armour($5,000)", "Select", "Cancel");
				return 1;
	    	}
   			if(listitem == 2) //armour
	    	{
	    	    SendClientMessage(playerid,COLOR_GREEN, "You have purchased full-protection body armour from the shop.");
				SetPlayerArmour(playerid, 100);
				GivePlayerMoney(playerid, -5000);
				ShowPlayerDialog(playerid,SHOP_DIALOG,DIALOG_STYLE_LIST,"Hunger Games Shop", "Buy a different skin ($5,000)\nHalf-Armour($2,500)\nFull-Armour($5,000)", "Select", "Cancel");
                return 1;
			}
	    	/*if(listitem == ) //backpack
	    	{
				SCM(playerid, COLOR_GREEN, "You have purchased a Backpack from the shop.");
	    	    SetPlayerAttachedObject( playerid, 1, 371, 1, 0.062752, -0.089650, -0.003304, 4.555679, 89.955924, 359.699523, 1.000000, 1.000000, 1.000000 );
	    	    GivePlayerMoney(playerid, -2500);
	    	}*/
		}
	}
	if(dialogid == SHOP_SKIN)
	{
    	if (response)
    	{
    	    new skin = strval(inputtext);
   	     	if(skin < 1 || skin > 299)
			{
				SendClientMessage(playerid,COLOR_RED, "ERROR: Skin ID's Range from 1 - 299");
				ShowPlayerDialog(playerid, SHOP_SKIN, DIALOG_STYLE_INPUT, "Enter a valid Skin ID.", "Enter Skin ID",  "OK", "Cancel");
				return 1;
			}
			else
			{
            	SetPlayerSkin(playerid, skin);
				GivePlayerMoney(playerid, -5000);
				return 1;
			}
		}
		else
		{
		    ShowPlayerDialog(playerid,SHOP_DIALOG,DIALOG_STYLE_LIST,"Hunger Games Shop", "Buy a different skin ($5,000)\nHalf-Armour($2,500)\nFull-Armour($5,000)", "Select", "Cancel");
		    return 1;
		}
	}
	if(dialogid == VSKIN_DIALOG)
	{
	    if(response)
	    {
			new skin = strval(inputtext);
			if(!strlen(inputtext)) return ShowPlayerDialog(playerid,VSKIN_DIALOG, DIALOG_STYLE_INPUT, "{FF00FF}VIP Skin Selection","Enter the Skin ID","Select","Cancel");
			if(skin < 1 || skin > 299)
			{
				SendClientMessage(playerid,COLOR_RED, "ERROR: Skin ID's Range from 1 - 299");
			}
			else
			{
				SetPlayerSkin(playerid, skin);
				return 1;
			}
		}
		else
		{
		    SendClientMessage(playerid,COLOR_RED, "Skin Selection Cancelled.");
		}
	}
	//REGULAR HELP DIALOG
	if(dialogid == HELP_DIALOG && response)
	{
	    switch(listitem)
	    {
	        //Rules\nCommands\nVIP Commands\nAdmin Commands
	        //ShowPlayerDialog(playerid,HELP_DIALOG_X,DIALOG_STYLE_MSGBOX,"Dialogs In Progress","This dialog doesn't yet exist, and we're sorry for that. \nIt will be included in the next update.\n \n \nApologies,\nAerotactics","OK","");
	        case 0:
	        {
	            ShowPlayerDialog(playerid,HELP_DIALOG1,DIALOG_STYLE_MSGBOX,"~The Hunger Games Server Rules~","(Failure to comply with these rules will result in removal from the community.)\n \n* Server advertising of any sort is strictly forbidden.\n* Do not AFK publically. Please use /afk, and /back.\n* No offensive language.\n* Do not spam useless chat in the main chat.\n* Do not glitch or exploit in any way. (Such as getting out of a map.)\n* Hacking will not be tolerated and result in a ban","OK","");
			}
	        case 1:
	        {
                ShowPlayerDialog(playerid,HELP_DIALOG2,DIALOG_STYLE_MSGBOX,"Commands","Selecting Print will show this list in chat and close the dialog.\n \n/help\n/lobby\n/betas\n/admins\n/vips\n/credits\n/stats\n/report\n/pay","Print","OK");
			}
	        case 2:
	        {
	            if(PlayerInfo[playerid][pVip] >=1 )
	            {
                	ShowPlayerDialog(playerid,HELP_DIALOG3,DIALOG_STYLE_MSGBOX,"VIP Commands","For a list of VIP Commands, use:\n \n/vhelp","OK","");
				}
				else
				{
   					SendClientMessage(playerid, COLOR_BRIGHTRED, "You are not a VIP!");
					ShowPlayerDialog(playerid, HELP_DIALOG, DIALOG_STYLE_LIST, "The Hunger Games Server Help","Rules\nCommands\nVIP Commands\nAdmin Commands","OK","Cancel");
				}
			}
	        case 3:
	        {
	            if (PlayerInfo[playerid][pAdmin] >=1)
	            {
	            	ShowPlayerDialog(playerid,HELP_DIALOG4,DIALOG_STYLE_MSGBOX,"Admin Commands","For a list of Admin Commands, use:\n \n/ah","OK","");
				}
				else
				{
				    SendClientMessage(playerid, COLOR_BRIGHTRED, "You are not an Admin!");
					ShowPlayerDialog(playerid, HELP_DIALOG, DIALOG_STYLE_LIST, "The Hunger Games Server Help","Rules\nCommands\nVIP Commands\nAdmin Commands","OK","Cancel");
				}
			}
	    }
	}
	if(dialogid == HELP_DIALOG2)
	{
	    if(response)
	    {
			SendClientMessage(playerid,COLOR_GREEN,"Commands: /help, /lobby, /betas, /admins, /vips, /credits, /stats, /report, /pay");
			return 1;
	    }
	}
	if(dialogid == HELP_DIALOG1)
	{
	    if(response)
	    {
			ShowPlayerDialog(playerid, HELP_DIALOG, DIALOG_STYLE_LIST, "The Hunger Games Server Help","Rules\nCommands\nVIP Commands\nAdmin Commands","OK","Cancel");
			return 1;
	    }
	}
	if(dialogid == HELP_DIALOG3)
	{
	    if(response)
	    {
			ShowPlayerDialog(playerid, HELP_DIALOG, DIALOG_STYLE_LIST, "The Hunger Games Server Help","Rules\nCommands\nVIP Commands\nAdmin Commands","OK","Cancel");
			return 1;
	    }
	}
	if(dialogid == HELP_DIALOG4)
	{
	    if(response)
	    {
			ShowPlayerDialog(playerid, HELP_DIALOG, DIALOG_STYLE_LIST, "The Hunger Games Server Help","Rules\nCommands\nVIP Commands\nAdmin Commands","OK","Cancel");
			return 1;
	    }
	}
	if(dialogid == BHELP_DIALOG)
	{
	    if(response)
	    {
			SendClientMessage(playerid,COLOR_LIGHTBLUE,"Beta Commands: /b, /bsay, /bhelp, /xyz");
			SendClientMessage(playerid,COLOR_LIGHTBLUE,"Beta Commands: Do NOT abuse these commands, You have been warned!");
			SendClientMessage(playerid,COLOR_LIGHTBLUE,"Beta Commands: /goto, /set, /startround, /endround, /quad");
			return 1;
	    }
	}
	//ADMIN HELP DIALOG
	if(dialogid == AHELP_DIALOG && response)
	{
	    switch(listitem)
	    {
            case 0: // Moderator
            {
       	    	ShowPlayerDialog(playerid, AHELP_DIALOG1, DIALOG_STYLE_MSGBOX, "{00A390}Moderator Help.","/kick, /ip, /hh, /spec, /specoff, /setskin, /fakechat,/fix\n/ip, /slap, /ad, /asay, /ar ","Print","Back");
            }
            case 1: // General Admin
            {
                if(PlayerInfo[playerid][pAdmin] >=2)
                {
					ShowPlayerDialog(playerid, AHELP_DIALOG2, DIALOG_STYLE_MSGBOX, "{00A390}General Admin Help.","/ban, /ann, /giveweapon, /setscore, /sethp, /setarmour\n/repair, /gethere, /resetweapons, /clearchat\n/check, /fine ","Print","Back");
				}
				else return SendClientMessage(playerid,COLOR_GREY, "You're not authorized to select this option.");
            }
            case 2: // Senior Admin
            {
                if(PlayerInfo[playerid][pAdmin] >=3)
                {
                	ShowPlayerDialog(playerid, AHELP_DIALOG3, DIALOG_STYLE_MSGBOX, "{00A390}Senior Admin Help.", "/gmx, /setarmourall, /sethpall, /giveweaponall, /killall, /akill, /gethereall, /resetweaponsall, /heal ","Print","Back");
				}
				else return SendClientMessage(playerid,COLOR_GREY, "You're not authorized to select this option.");
            }
            case 3: // Server Owner
            {
                if(PlayerInfo[playerid][pAdmin] >=4)
                {
                	ShowPlayerDialog(playerid, AHELP_DIALOG4, DIALOG_STYLE_MSGBOX, "{00A390}Server Owner Help.","/givemoney, /savestats, /god","Print","Back");
			 	}
			 	else return SendClientMessage(playerid,COLOR_GREY, "You're not authorized to select this option.");
            }
            case 4: // Rcon
            {
				if(IsPlayerAdmin(playerid))
				{
                	ShowPlayerDialog(playerid, AHELP_DIALOG5, DIALOG_STYLE_MSGBOX, "{00A390}RCON Commands","/setadmin, /setvip","Print","Back");
				}
				else return SendClientMessage(playerid,COLOR_GREY, "You're not authorized to select this option.");
            }
	    }
	}
	//RESPONSES FOR ADMINISTRATION HELP DIALOG===============
	if(dialogid== AHELP_DIALOG1)
	{
	   if(!response) return ShowPlayerDialog(playerid, AHELP_DIALOG,DIALOG_STYLE_LIST,"Administrator Help","Moderator Commands\nGeneral Admin Commands\nSenior Admin Commands\nServer Owner Commands\nRCON","Select","Cancel");
	   if(response)
	   {
	        SendClientMessage(playerid,COLOR_GREEN, "MODERATOR: /kick, /hh, /spec, /specoff, /setskin, /fakechat, /pm, /fix, /ip, /slap, /ad, /asay, /ar");
	   }
	}
	if(dialogid == AHELP_DIALOG2)
	{
	    if(!response) return ShowPlayerDialog(playerid, AHELP_DIALOG,DIALOG_STYLE_LIST,"Administrator Help","Moderator Commands\nGeneral Admin Commands\nSenior Admin Commands\nServer Owner Commands\nRCON","Select","Cancel");
	    if(response)
	    {
	        SendClientMessage(playerid,COLOR_GREEN, "GENERAL ADMIN: /ban, /ann, /giveweapon, /setscore, /sethp, /setarmour /repair, /gethere, /resetweapons, /clearchat, /check");
	        SendClientMessage(playerid,COLOR_GREEN, "GENERAL ADMIN: /fine");
	    }
	}
	if(dialogid == AHELP_DIALOG3)
	{
	    if(!response) return ShowPlayerDialog(playerid, AHELP_DIALOG,DIALOG_STYLE_LIST,"Administrator Help","Moderator Commands\nGeneral Admin Commands\nSenior Admin Commands\nServer Owner Commands\nRCON","Select","Cancel");
	    if(response)
	    {
	        SendClientMessage(playerid,COLOR_GREEN, "SENIOR ADMIN: /gmx, /setarmourall, /sethpall, /giveweaponall, /resetweaponsall, /killall, /akill, /gethereall, /heal");
	    }
	}
	if(dialogid == AHELP_DIALOG4)
	{
	    if(!response) return ShowPlayerDialog(playerid, AHELP_DIALOG,DIALOG_STYLE_LIST,"Administrator Help","Moderator Commands\nGeneral Admin Commands\nSenior Admin Commands\nServer Owner Commands\nRCON","Select","Cancel");
	    if(response)
	    {
			SendClientMessage(playerid,COLOR_GREEN, "SERVER OWNER: /givemoney, /savestats, /god");
	    }
	}
	if(dialogid == AHELP_DIALOG5)
	{
	    if(!response) return ShowPlayerDialog(playerid, AHELP_DIALOG,DIALOG_STYLE_LIST,"Administrator Help","Moderator Commands\nGeneral Admin Commands\nSenior Admin Commands\nServer Owner Commands\nRCON","Select","Cancel");
	    if(response)
	    {
	        SendClientMessage(playerid,COLOR_GREEN, "RCON: /setadmin, /setvip, /asetbeta");
	    }
	}
	switch( dialogid )
    {
        case DIALOG_REGISTER:
        {
            if (!response) return Kick(playerid);
            if(response)
            {
                if(!strlen(inputtext)) return ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT, ""COL_WHITE"Registering...",""COL_RED"You have entered an invalid password.\n"COL_WHITE"Type your password below to register a new account.","Register","Quit");
                new INI:File = INI_Open(UserPath(playerid));
                INI_SetTag(File,"data");
                INI_WriteInt(File,"Password",udb_hash(inputtext));
                INI_WriteInt(File,"Cash",0);
                INI_WriteInt(File,"Admin",0);
                INI_WriteInt(File,"Beta",0);
                INI_WriteInt(File,"Kills",0);
                INI_WriteInt(File,"Deaths",0);
                INI_WriteInt(File,"Vip",0);
                INI_WriteInt(File,"Score",0);
				INI_WriteInt(File,"Ban",0);
				INI_WriteInt(File,"Skin",120);
                INI_Close(File);
                SetSpawnInfo(playerid, 0, 0, 1958.33, 1343.12, 15.36, 269.15, 0, 0, 0, 0, 0, 0);
                SpawnPlayer(playerid);
                ShowPlayerDialog(playerid, DIALOG_SUCCESS_1, DIALOG_STYLE_MSGBOX,""COL_WHITE"Success!",""COL_GREEN"May the odds be in your favour.","Ok","");
            }
        }
        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]);
                    ShowPlayerDialog(playerid, DIALOG_SUCCESS_2, DIALOG_STYLE_MSGBOX,""COL_WHITE"Success!",""COL_GREEN"You have successfully logged in!","Ok","");
                }
                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;
}
public OnPlayerClickPlayer(playerid, clickedplayerid, source)
{
	return 1;
}



//===============================COMMANDS=============//
forward ReportTimer(playerid);
public ReportTimer(playerid)
{
	reporttimer[playerid] = 0;
}

CMD:sit(playerid, params[])
{
	ApplyAnimation(playerid,"PED","SEAT_IDLE",4,0,0,0, 1,0,1);
	return 1;
}

CMD:stand(playerid, params[])
{
	ClearAnimations(playerid);
	return 1;
}


CMD:report(playerid, params[])
{
    new string[128], reason[128];
    if(sscanf(params, "s[128]",reason))return SendClientMessage(playerid, COLOR_WHITE, " USAGE: /report [reason]");
    reporttimer[playerid] = 1;
    SetTimerEx("ReportTimer",30000,false,"i",playerid);
    format(string, sizeof(string), "Report from: %s[ID:%d]:{DBED15} %s", GetName(playerid), playerid, reason);
    SendClientMessageToAdmins(COLOR_TAN, string);
    SendClientMessageToAdmins(COLOR_YELLOW, "Use /ar to accept this Report.");
    SendClientMessage(playerid, COLOR_TAN, "Your report has been sent.");
	return 1;
}



CMD:pay(playerid, params[])
{
	new target, amount;
	if(sscanf(params, "ui",target, amount)) return SendClientMessage(playerid,COLOR_WHITE, "USAGE: /pay [playerid] [amount]");
	if(!IsPlayerConnected(target)) return SendClientMessage(playerid,COLOR_RED, "ERROR: Player is not connected.");
	new money = GetPlayerMoney(playerid);
	if(money < amount ) return SendClientMessage(playerid,COLOR_RED, "ERROR: You don't have enough money to give to that person.");
	if(amount > 500000 || amount < 1) return SendClientMessage(playerid,COLOR_RED, "ERROR: The maximum amount of money you can pay at a time is 500,000. And the minimum is 1.");
	GivePlayerMoney(playerid, -amount);
	GivePlayerMoney(target, amount);
	new pstring[128];
	new tstring[128];
	format(pstring,sizeof(pstring), "You have given %d$ to %s.",amount,GetName(target));
	format(tstring,sizeof(tstring), "%s has gave you %d$.",GetName(playerid),amount);
	SendClientMessage(playerid,COLOR_GREEN, pstring);
	SendClientMessage(target,COLOR_GREEN, tstring);
	return 1;
}

CMD:stats(playerid, params[])
{
	new cash, vip, kills, deaths, score, beta[64];
	cash = PlayerInfo[playerid][pCash];
	vip = PlayerInfo[playerid][pVip];
	kills = PlayerInfo[playerid][pKills];
	deaths = PlayerInfo[playerid][pDeaths];
	score = PlayerInfo[playerid][pScore];
	if (PlayerInfo[playerid][pBeta] == 1)
	{
	    beta = "Trial Tester";
	}
    if (PlayerInfo[playerid][pBeta] == 2)
	{
	    beta = "Beta Tester";
	}
	if (PlayerInfo[playerid][pBeta] == 3)
 	{
 	    beta = "Head Beta Tester";
	}
	new string[200];
	format(string,sizeof(string), "Money: %d || Admin: %s || VIP: %d || Kills: %d || Deaths: %d || Score: %d || %s",cash,GetAdminLvlName(playerid),vip,kills,deaths,score,beta);
	SendClientMessage(playerid,COLOR_GREEN, "______________________The Hunger Games Statistics______________________");
    SendClientMessage(playerid,COLOR_CYAN, "");
	SendClientMessage(playerid,COLOR_CYAN, string);
	SendClientMessage(playerid,COLOR_GREEN, "_______________________________________________________________________");
	return 1;
}

CMD:help(playerid, params[])
{
	ShowPlayerDialog(playerid, HELP_DIALOG, DIALOG_STYLE_LIST, "The Hunger Games Server Help","Rules\nCommands\nVIP Commands\nAdmin Commands","OK","Cancel");
	return 1;
}

CMD:credits(playerid, params[])
{
	ShowPlayerDialog(playerid,CREDITS_DIALOG, DIALOG_STYLE_MSGBOX, "The Hunger Games Development Team","Server Owners\nRangerxxll (Seamore Hoffman) - Lead Scripter, Server Owner\nAerotactics (Jason Budley) - Admininstration Developer, Head Administrator\n \nAdmins: \n \nModerators: \n \nAlpha Testers: Duke, Eye, Aayush\n \nBeta Testers: Stealthy, Kenny, Aleck","OK","");
	return 1;
}

CMD:lobby(playerid, params[])
{
	if (IsPlayerInRangeOfPoint(playerid, 50, -859.9,510,1510.6) || IsPlayerInRangeOfPoint(playerid, 200, 2443.5,-3094.7,312))
	{
		ShowPlayerDialog(playerid,LOBBY_DIALOG1, DIALOG_STYLE_LIST, "Lobby List","The Shop\nLobby Maps\nLobby Activities","OK","Cancel");
		return 1;
	}
	else
	{
		SendClientMessage(playerid,COLOR_BRIGHTRED,"ERROR: You must be in the lobby to use this command!");
		return 1;
	}
}

//==========================VIP COMMANDS=============================
forward varmour(playerid);
public varmour(playerid)
{
	SendClientMessage(playerid,COLOR_VIOLET, "Your VIP Armour cooldown has depleted.");
	viparmour[playerid] = 0;
}

CMD:vskin(playerid, params[])
{
	if(PlayerInfo[playerid][pVip] >=1 )
	{
		ShowPlayerDialog(playerid,VSKIN_DIALOG, DIALOG_STYLE_INPUT, "{FF00FF}VIP Skin Selection","Enter the Skin ID","Select","Cancel");
	}
	else return SendClientMessage(playerid,COLOR_GREY, ERROR);
	return 1;
}

CMD:varmour(playerid, params[])
{
	if(PlayerInfo[playerid][pVip] >=2 )
	{
		if(viparmour[playerid] == 0)
		{
			viparmour[playerid] = 1;
			SendClientMessage(playerid,COLOR_VIOLET, "VIP NOTIFICATION: You can only spawn VIP Armour every 5 minutes.");
			SetPlayerArmour(playerid, 100);
			SetTimer("varmour",300000, false);
		}
		else return SendClientMessage(playerid,COLOR_RED, "ERROR: You can only use this command once every 5 minutes.");
	}
	else return SendClientMessage(playerid,COLOR_GREY, ERROR);
	return 1;
}

CMD:vhelp(playerid, params[])
{
	if(PlayerInfo[playerid][pVip] >=1)
	{
		ShowPlayerDialog(playerid, VIP_DIALOG, DIALOG_STYLE_MSGBOX, "{FF00FF}VIP Help Menu","{C87137}Bronze VIP: /v, /vskin\n{C3C3C3}Silver VIP: /varmour\n{E6E61A}Gold VIP: /vsay","OK","");
	}
	else return SendClientMessage(playerid, COLOR_GREY, ERROR);
	return 1;
}
COMMAND:vips(playerid,params[])
{
	new VipRank[128];
	new count = 0;
	new string[128];
	SendClientMessage(playerid,COLOR_RED,"");
	SendClientMessage(playerid,COLOR_ORANGE,"________________|The Hunger Games VIP's|________________");
	SendClientMessage(playerid,COLOR_RED,"");
	for(new i = 0; i < MAX_PLAYERS; i++)
	{
		if(IsPlayerConnected(i))
		{
			if(PlayerInfo[i][pVip] > 0)
			{
				if(PlayerInfo[i][pVip] == 1)
				{
					VipRank = "Bronze VIP";
				}
				else if(PlayerInfo[i][pVip] == 2)
				{
					VipRank = "Silver VIP";
				}
				else if(PlayerInfo[i][pVip] == 3)
				{
					VipRank = "Gold VIP";
				}
				new Name[MAX_PLAYER_NAME];
				GetPlayerName(i,Name,sizeof(Name));
				format(string, sizeof(string), "Level: %d | Name: %s (ID:%i) | Rank: %s ", PlayerInfo[i][pVip], Name,i,VipRank);
				SendClientMessage(playerid,COLOR_GREEN,string);
				count++;
			}
		}
	}
	if(count == 0)
	SendClientMessage(playerid,COLOR_RED,"No Hunger Games VIP's Online");
	SendClientMessage(playerid,COLOR_ORANGE,"________________________________________________________");
	return 1;
}

CMD:vsay(playerid, params[])
{
	if(PlayerInfo[playerid][pVip] >=3 )
	{
		new text[128];
		if(sscanf(params, "s[128]",text)) return SendClientMessage(playerid,COLOR_WHITE, "USAGE: /vsay [text]");
		format(text,sizeof(text), "{8000FF}[%s]%s: {FFFFFF}%s",GetVipLvlName(playerid),GetName(playerid), params);
		SendClientMessageToAll(-1, text);
	}
	else return SendClientMessage(playerid, COLOR_GREY, ERROR);
	return 1;
}


CMD:v(playerid, params[])
{
    new text[128];
	if(PlayerInfo[playerid][pVip]>=1)
	{
		if(sscanf(params, "s[128]",text)) return SendClientMessage(playerid, COLOR_WHITE, "Usage: /v(ip) [Text]");
		format(text,sizeof(text),"[%s]%s: %s",GetVipLvlName(playerid), GetName(playerid),params);
		foreach(Player, i)
		{
			if(PlayerInfo[i][pVip]>=1)
			{
				SendClientMessage(i,COLOR_VIOLET,text);
			}
		}

	}
	else SendClientMessage(playerid,COLOR_GREY, "You're not authorized to use this command.");
	return 1;
}

//=====================Beta Testers Commands===========================//
CMD:map(playerid, params[])
{
	if(PlayerInfo[playerid][pBeta]>=1)
	{
	    SetPlayerPos(playerid,-1530.4000000,-2162.6000000,10.1000000);
		SetCameraBehindPlayer(playerid);
	}
	else SendClientMessage(playerid,COLOR_GREY, "You're not authorized to use this command.");
	return 1;
}
CMD:backtolobby(playerid, params[])
{
	if(PlayerInfo[playerid][pBeta]>=1)
	{
		SetPlayerPos(playerid,-858.8223,506.0542,1511.6312);
		SetCameraBehindPlayer(playerid);
		StopAudioStreamForPlayer(playerid);
	}
	else SendClientMessage(playerid,COLOR_GREY, "You're not authorized to use this command.");
	return 1;
}

CMD:xyz(playerid,params[])
{
    if(PlayerInfo[playerid][pBeta]>=1)
	{
 		new string1[256];
        new Float:X,Float:Y,Float:Z;
        GetPlayerPos(playerid,X,Y,Z);
        format(string1,sizeof(string1),"Position = X: %.0f , Y: %.0f , Z: %.0f",X,Y,Z);
        SendClientMessage(playerid,COLOR_CYAN,string1);
	}
	else SendClientMessage(playerid,COLOR_GREY, "You're not authorized to use this command.");
	return 1;
}

CMD:quad(playerid,params[])
{
    if(PlayerInfo[playerid][pBeta]>=1)
	{
		new Float:x,Float:y,Float:z;
		new Float:a;
		GetPlayerPos(playerid, x, y, z);
		GetPlayerFacingAngle(playerid, a);
		quad=CreateVehicle(471,x, y, z, a,135,135, -1);
		PutPlayerInVehicle(playerid,quad,0);
	}
	else SendClientMessage(playerid,COLOR_GREY, "You're not authorized to use this command.");
	return 1;
}

COMMAND:goto(playerid,params[])
{
    if(PlayerInfo[playerid][pBeta] >= 1)
    {
    	new Target;
     	if(!sscanf(params, "u", Target))
		{
	        if(Target == INVALID_PLAYER_ID) return SendClientMessage(playerid,COLOR_GREY,"ERROR: That player is not connected.");
			new Float:X;
			new Float:Y;
			new Float:Z;
			GetPlayerPos(Target,X,Y,Z);
			SetPlayerPos(playerid,X+2,Y,Z);
			new pname[MAX_PLAYER_NAME];
			new tname[MAX_PLAYER_NAME];
			GetPlayerName(playerid,pname,sizeof(pname));
			GetPlayerName(Target,tname,sizeof(tname));
			new pstring[256];
			new tstring[256];
			format(pstring,sizeof(pstring),"You have teleported to %s",tname);
			format(tstring,sizeof(tstring),"%s %s has teleported to your position",GetAdminLvlName(playerid), pname);
			SendClientMessage(playerid,COLOR_GREEN,pstring);
			SendClientMessage(Target,COLOR_GREEN,tstring);
		}
		else SendClientMessage(playerid,COLOR_WHITE,"USAGE: /goto <playerid>");
	}
	else SendClientMessage(playerid,COLOR_GREY,"You're not authorized to use this command");
	return 1;
}
CMD:b(playerid, params[])
{
    new text[128];
	if(PlayerInfo[playerid][pBeta]>=1)
	{
		if(sscanf(params, "s[128]",text)) return SendClientMessage(playerid, COLOR_WHITE, "Usage: /b [Text]");
		format(text,sizeof(text),"[Beta Chat]%s: %s", GetName(playerid),params);
		foreach(Player, i)
		{
			if(PlayerInfo[i][pBeta]==1)
			{
				SendClientMessage(i,COLOR_LIGHTBLUE,text);
			}
		}
	}
	else SendClientMessage(playerid,COLOR_GREY, "You're not authorized to use this command.");
	return 1;
}

CMD:bsay(playerid, params[])
{
	if(PlayerInfo[playerid][pBeta] >=1 )
	{
	    new string[128];
	    if(sscanf(params, "s[128]",string)) return SendClientMessage(playerid,COLOR_WHITE, "USAGE: /bsay [text]");
	    format(string,sizeof(string), "{33CCFF}[Beta Tester] %s: {FFFFFF}%s",GetName(playerid),params);
	    SendClientMessageToAll(-1, string);
	}
	else return SendClientMessage(playerid, COLOR_GREY, ERROR);
	return 1;
}
COMMAND:bhelp(playerid, params[])
{
	if(PlayerInfo[playerid][pAdmin] >=1)
	{
	    ShowPlayerDialog(playerid, BHELP_DIALOG,DIALOG_STYLE_MSGBOX,"Beta Testers Help","Beta Testers Commands:\n \n/b\n/bhelp\n/bsay\n/xyz \nHead Tester Commands:\n/setbeta\n \nDo NOT abuse these commands:\n/goto\n/set\n/startround\n/endround\n/quad\n \nThey are only to be used when you are asked by a server owner. \nFailing to follow this rule will be removal from Beta Testing!","Print","OK");
	}
	else SendClientMessage(playerid,COLOR_GREY, "You're not authorized to use this command.");
	return 1;
}
COMMAND:betas(playerid,params[])
{
	new count = 0;
	new string[128];
	SendClientMessage(playerid,COLOR_RED,"");
	SendClientMessage(playerid,COLOR_LIGHTBLUE,"________________|The Hunger Games Beta Testers|________________");
	SendClientMessage(playerid,COLOR_RED,"");
	for(new i = 0; i < MAX_PLAYERS; i++)
	{
		if(IsPlayerConnected(i))
		{
			if(PlayerInfo[i][pBeta] >= 1)
			{
			    new bRank[64];
				new Name[MAX_PLAYER_NAME];
				GetPlayerName(i,Name,sizeof(Name));
				if(PlayerInfo[i][pBeta] == 1)
				{
				    bRank="Trial Tester";
				}
				if(PlayerInfo[i][pBeta] == 2)
				{
				    bRank="Beta Tester";
				}
				if(PlayerInfo[i][pBeta] == 3)
				{
				    bRank="Head Beta Tester";
				}
				format(string, sizeof(string), "%s | Name: %s (ID:%i)",bRank, Name,i);
				SendClientMessage(playerid,COLOR_CYAN,string);
				count++;
			}
		}
	}
	if(count == 0)
	SendClientMessage(playerid,COLOR_RED,"No Hunger Games Beta Testers Online");
	SendClientMessage(playerid,COLOR_LIGHTBLUE,"_______________________________________________________________");
	return 1;
}

CMD:setbeta(playerid, params[])
{
	if(PlayerInfo[playerid][pBeta] <= 2)
	{
		SendClientMessage(playerid, COLOR_GREY, "You're not authorized to use this command.");
	}
	else
	{
		new target,level;
		if(sscanf(params,"ud",target,level)) return SendClientMessage(playerid,COLOR_WHITE, "USAGE: /setbeta [playerid] [level 0-3]");
		if(target == INVALID_PLAYER_ID) return SendClientMessage(playerid,COLOR_RED, "ERROR: Player is not connected.");
		if(level > 3) return SendClientMessage(playerid, COLOR_RED, "ERROR: Maximum Beta level is 3.");
		new tstring[128];
		new pstring[128];
		//
		if(level == 0)
		{
		    format(tstring,sizeof(tstring), "%s %s has taken away your Beta rights.",GetAdminLvlName(playerid),GetName(playerid));
			format(pstring,sizeof(pstring), "You have removed %s's Beta rights.",GetName(target));
			SendClientMessage(target,COLOR_LIGHTBLUE, tstring);
			SendClientMessage(playerid, COLOR_LIGHTBLUE, pstring);
			PlayerInfo[target][pBeta] = 0;
			SetPVarInt(target, "Beta", 0);
		}
		if(level == 1)
		{
	  		format(tstring,sizeof(tstring), "You have been a Trial Beta Tester by %s %s",GetAdminLvlName(playerid),GetName(playerid));
			format(pstring,sizeof(pstring), "You have made %s a Trial Beta Tester.",GetName(target));
			SendClientMessage(target,COLOR_LIGHTBLUE, tstring);
			SendClientMessage(playerid, COLOR_LIGHTBLUE, pstring);
			PlayerInfo[target][pBeta] = 1;
			SetPVarInt(target, "Beta", 1);
		}
		if(level == 2)
		{
	  		format(tstring,sizeof(tstring), "You have been made a Beta Tester by %s %s",GetAdminLvlName(playerid),GetName(playerid));
			format(pstring,sizeof(pstring), "You have made %s a Beta Tester.",GetName(target));
			SendClientMessage(target,COLOR_LIGHTBLUE, tstring);
			SendClientMessage(playerid, COLOR_LIGHTBLUE, pstring);
			PlayerInfo[target][pBeta] = 2;
			SetPVarInt(target, "Beta", 1);
		}
		if(level == 3)
		{
	  		format(tstring,sizeof(tstring), "You have been made a Head Beta Tester by %s %s",GetAdminLvlName(playerid),GetName(playerid));
			format(pstring,sizeof(pstring), "You have made %s a Head Beta Tester.",GetName(target));
			SendClientMessage(target,COLOR_LIGHTBLUE, tstring);
			SendClientMessage(playerid, COLOR_LIGHTBLUE, pstring);
			PlayerInfo[target][pBeta] = 3;
			SetPVarInt(target, "Beta", 1);
		}
	}
	return 1;
}
//=================LEVEL 1 ADMINISTRATOR COMMANDS=========================//
CMD:ar(playerid, params[])
{
	if(PlayerInfo[playerid][pAdmin] >=1 )
	{
	    new target;
	    if(sscanf(params, "u",target)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /ar [playerid]");
	    if(reporttimer[target] == 0)
	    {
	        SendClientMessage(playerid,COLOR_RED, "ERROR: Player has not recently reported.");
	    }
	    else
	    {
			new tstring[128];
			new astring[128];
			format(tstring,sizeof(tstring), "%s %s has accepted your report, please be patient while they review it.",GetAdminLvlName(playerid),GetName(playerid));
			format(astring,sizeof(astring), "%s %s has accepted the report of %s.",GetAdminLvlName(playerid),GetName(playerid),GetName(target));
			SendClientMessage(target, COLOR_GREEN, tstring);
			SendClientMessageToAdmins(COLOR_GREEN, astring);
			reporttimer[target] = 0;
	    }
	}
	else return SendClientMessage(playerid,COLOR_GREY, ERROR);
	return 1;
}

CMD:asay(playerid, params[])
{
	if(PlayerInfo[playerid][pAdmin] >=1 )
	{
	    new string[128];
	    if(sscanf(params, "s[128]",string)) return SendClientMessage(playerid,COLOR_WHITE, "USAGE: /asay [text]");
	    format(string,sizeof(string), "{2EE61A}[%s]%s: {FFFFFF}%s",GetAdminLvlName(playerid),GetName(playerid),params);
	    SendClientMessageToAll(-1, string);
	}
	else return SendClientMessage(playerid, COLOR_GREY, ERROR);
	return 1;
}

CMD:ad(playerid, params[])
{
	if(PlayerInfo[playerid][pAdmin] >=1)
	{
	    SendClientMessageToAll(COLOR_ORANGE, "_______________SA-MP Hunger Games_______________");
	    SendClientMessageToAll(COLOR_ORANGE, "..::   Server Website and Forums:");
	    SendClientMessageToAll(COLOR_ORANGE, "..::   http://samphungergames.freeforums.org/");
	}
	else return SendClientMessage(playerid, COLOR_GREY, ERROR);
	return 1;
}

forward AdminTimer(playerid);
public AdminTimer(playerid)
{
	TogglePlayerControllable(playerid, 1);
	return 1;
}


CMD:ip(playerid, params[])
{
	if(PlayerInfo[playerid][pAdmin] >=1)
	{
		new target;
		new ip[16];
		GetPlayerIp(target, ip,sizeof(ip));
		new string[128];
		if(sscanf(params,"u",target)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /ip [playerid]");
		format(string,sizeof(string), "%s's Current IP is: %d",GetName(target),ip);
		SendClientMessage(playerid, COLOR_GREEN, string);
	}
	else return SendClientMessage(playerid,COLOR_GREY, ERROR);
	return 1;
}

CMD:fix(playerid, params[])
{
	new target;
	new tstring[128];
	new pstring[128];
	if(PlayerInfo[playerid][pAdmin] >=1)
	{
	    if(sscanf(params,"u",target)) return SendClientMessage(playerid,COLOR_WHITE, "USAGE: /fix [playerid]");
	    if(!IsPlayerConnected(target)) return SendClientMessage(playerid,COLOR_RED, "ERROR: Player is not connected.");
	    {
	        format(tstring,sizeof(tstring), "%s %s has fixed your virtual world and interior. You have been sent to Class Selection.",GetAdminLvlName(playerid),GetName(playerid));
	        format(pstring,sizeof(pstring), "You have fixed %s's virtual world and interior. %s has been sent to Class Selection.",GetName(target),GetName(target));
	        SendClientMessage(target, COLOR_GREEN, tstring);
	        SendClientMessage(playerid, COLOR_GREEN, pstring);
	        SetPlayerVirtualWorld(target, 0);
	        SetPlayerInterior(target, 0);
	        ForceClassSelection(target);
         	SetPlayerHealth(target, 0);
	    }
	}
	else return SendClientMessage(playerid,COLOR_GREY, ERROR);
	return 1;
}
COMMAND:pm(playerid,params[])
{
	new pid;
	new message1[128];
	if(sscanf(params, "us[128]", pid, message1))
	{
		return SendClientMessage(playerid, 0xADFF2F, "USAGE: /pm <playerid> <message>");
	}
	if(pid == INVALID_PLAYER_ID) SendClientMessage(playerid,-1,"ERROR: That player is not connected.");
	new pmsg[256];
	new pname[MAX_PLAYER_NAME];
	GetPlayerName(playerid,pname,sizeof(pname));
	format(pmsg,sizeof(pmsg),"PM from %s(%d): %s",pname,playerid,message1);
	new pidmsg[256];
	new pidname[MAX_PLAYER_NAME];
	GetPlayerName(pid,pidname,sizeof(pidname));
	format(pidmsg,sizeof(pidmsg),"PM to %s(%d): %s",pidname,pid,message1);
	SendClientMessage(pid, 0xADFF2F, pmsg);
	PlayerPlaySound(pid,1057,0.0,0.0,0.0);
	SendClientMessage(playerid, 0xADFF2F, pidmsg);
	return 1;
}


CMD:fakechat(playerid,params[])
{
    if(PlayerInfo[playerid][pAdmin] >= 2) //put your admin-variable from your on enum of the playerinfo here again!
    {
        new Target; //the player which'll get "blamed"
        new Msg[128]; //the string for the message
        if(sscanf(params, "us[50]", Target,Msg)) SendClientMessage(playerid, COLOR_WHITE, "USAGE: /fakechat [playerid] [message]"); //returns the right params if you've written it wrong
        if(!IsPlayerConnected(Target)) //check if the ID is valid, if not
        return SendClientMessage(playerid, COLOR_RED, "ERROR: Player is not connected."); //send the player such a message
        if(!sscanf(params, "us[50]", Target,Msg)) //if the params are written correctly, do the following! (target "u" and message "s" used here, with the size "50")
        {
            new PName[MAX_PLAYER_NAME]; //a new name for the player
            GetPlayerName(Target,PName,sizeof PName); //receive the player's name
            new textstring[400];//the string for the message

            format(textstring, sizeof(textstring), "{FFFFFF}(%i): {FFFFFF}%s", Target, Msg); //format the message with the string we've created, Target for the player, Msg for the message
            SendPlayerMessageToAll(Target, textstring); //of course everyone should see the message
            format(textstring,sizeof(textstring),"You have sent a fakechat message for %s(%d) (Message: %s)",PName,Target,Msg); //you don't have to, but you CAN add it! It sends you the success-message that you've sent the fakemessage
            SendClientMessage(playerid,COLOR_GREEN,textstring); //this message should only appear to the one which is performing the command
        }
    }
    else return SendClientMessage(playerid, COLOR_GREY,"You're not authorized to use that command!"); //if the player isn't level 2 or higher, send him this message
    return 1;
}

COMMAND:setskin(playerid,params[])
{
    if(PlayerInfo[playerid][pAdmin] >= 1)
    {
    	new Target;
    	new Skinid;
     	if(!sscanf(params, "ui", Target, Skinid))
	    {
     		if(Target == INVALID_PLAYER_ID) return SendClientMessage(playerid,COLOR_RED,"ERROR: Player is not connected.");
			if(Skinid > 299) return SendClientMessage(playerid,COLOR_RED,"ERROR: Skin IDs from 0 to 299!");
			SetPlayerSkin(Target,Skinid);
			new tname[MAX_PLAYER_NAME];
			GetPlayerName(Target,tname,sizeof(tname));
			new pname[MAX_PLAYER_NAME];
			GetPlayerName(playerid,pname,sizeof(pname));
			new tstring[256];
			new pstring[256];
			format(tstring,sizeof(tstring),"Your skin is set to %d by %s %s",Skinid, GetAdminLvlName(playerid),pname);
			format(pstring,sizeof(pstring),"You have set %s(%d) skin to %d",tname,Target,Skinid);
			SendClientMessage(Target,COLOR_CYAN,tstring);
			SendClientMessage(playerid,COLOR_CYAN,pstring);
		}
		else SendClientMessage(playerid,COLOR_WHITE,"USAGE: /setskin <playerid> <skinid>");
	}
	else SendClientMessage(playerid,COLOR_GREY,"You're not authorized to use this command.");
	return 1;
}

COMMAND:specoff(playerid,params[])
{
    #if EnableSpectate == true
	if(PlayerInfo[playerid][pAdmin] >=1)
	{
 		if(gPlayerSpectating[playerid] == 1)
 		{
  		    TogglePlayerSpectating(playerid, 0);
			gSpectateID[playerid] = INVALID_PLAYER_ID;
			gPlayerSpectating[playerid] = 0;
			gSpectateType[playerid] = ADMIN_SPEC_TYPE_NONE;
			SendClientMessage(playerid, COLOR_GREEN, "You have stopped spectating!");
			TextDrawHideForPlayer(playerid,Spectation);
			spectimer = SetTimer("SpecSpawn",1000,0);
		}
		else SendClientMessage(playerid,COLOR_RED,"ERROR: You are not in spectate mode!");
	}
	else SendClientMessage(playerid, COLOR_GREY, "You're not authorized to use this command.");
	#endif
	return 1;
}

forward SpecSpawn(playerid);
public SpecSpawn(playerid)
{
    SetPlayerPos(playerid,sx, sy, sz);
	SetPlayerFacingAngle(playerid, sa);
	SetPlayerSkin(playerid,PlayerInfo[playerid][pSkin]);
	KillTimer(spectimer);
 	return 1;
}

COMMAND:spec(playerid,params[])
{
	if(PlayerInfo[playerid][pAdmin] >=1)
	{
		    if(gPlayerSpectating[playerid] == 0)
      		{
				new Target;
				if(!sscanf(params, "u", Target))
			    {
					if(gPlayerSpectating[Target] == 0)
					{
                        if(Target == INVALID_PLAYER_ID) return SendClientMessage(playerid,COLOR_BRIGHTRED,"ERROR: That player is not connected.");
						GetPlayerPos(playerid,sx, sy, sz);
						GetPlayerFacingAngle(playerid, sa);
						TogglePlayerSpectating(playerid, 1);
						PlayerSpectatePlayer(playerid, Target);
						SetPlayerInterior(playerid,GetPlayerInterior(Target));
						gSpectateID[playerid] = Target;
						gPlayerSpectating[playerid] = 1;
						gSpectateType[playerid] = ADMIN_SPEC_TYPE_PLAYER;
		                new tname[MAX_PLAYER_NAME];
						GetPlayerName(Target,tname,sizeof(tname));
						new MyString[128];
						format(MyString,sizeof MyString, "You are now spectating %s! Type /specoff to stop!", tname);
						SendClientMessage(playerid, COLOR_GREEN, MyString);
					}
					else SendClientMessage(playerid,COLOR_RED,"ERROR: Player is in spectate mode!");
				}
				else SendClientMessage(playerid,COLOR_WHITE,"USAGE: /spec <playerid>");
			}
			else SendClientMessage(playerid,COLOR_RED,"ERROR: You are already in spectate mode!");
		}
		else SendClientMessage(playerid, COLOR_GREY, "You're not authorized to use this command.");
	return 1;
}
CMD:hhcheck(playerid, params[])
{
    if(PlayerInfo[playerid][pAdmin] >=1)
    {
        new hhackers = 0;
        new ahackers = 0;
		for (new i=0;i<MAX_PLAYERS;i++)
		{
		    new pname[MAX_PLAYER_NAME];
	     	GetPlayerName(i,pname,sizeof(pname));
		    new Float:health;
	     	new Float:armour;
	      	GetPlayerHealth(i, health);
	      	GetPlayerArmour(i, armour);
	       	if (health > 105)
	        {
	            new string[128];
	            format(string,sizeof(string),"%s is Health Hacking!", pname);
				SendClientMessage(playerid, COLOR_BRIGHTRED, string);
				hhackers++;
			}
			else if (armour > 105)
	        {
	            new string[128];
	            format(string,sizeof(string),"%s is Armor Hacking!", pname);
				SendClientMessage(playerid, COLOR_BRIGHTRED, string);
				ahackers++;
			}
		}
		new string[128];
  		format(string,sizeof(string),"Health Hack Check found %i health hacker(s) and %i armor hacker(s).", hhackers,ahackers);
		SendClientMessage(playerid, COLOR_RED, string);
	}
	else
	{
	    SendClientMessage(playerid, COLOR_GREY, "You're not authorized to use this command.");
	}
	return 1;
}

CMD:hh(playerid, params[])
{
    new iTarget;
    if(sscanf(params, "u", iTarget)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /hh(health hacks) [PlayerID] (Checks a player for Health/Armour hacks.)");
    {
        if(iTarget == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_BRIGHTRED, "ERROR: That Player is not connected.");
        {
            if(PlayerInfo[playerid][pAdmin] >=1)
            {
                new ping = GetPlayerPing(iTarget);
                new pStr[256];
                new pname[MAX_PLAYER_NAME];
                GetPlayerName(playerid,pname,sizeof(pname));
                new tname[MAX_PLAYER_NAME];
                GetPlayerName(iTarget, tname,sizeof(tname));
                format(pStr,sizeof(pStr), "You have checked %s for health hacks. Current ping: %d",tname, ping);
                SendClientMessage(playerid, COLOR_GREEN, pStr);
                new Float:health;
                new Float:armour;
                GetPlayerHealth(iTarget, health);
                GetPlayerArmour(iTarget, armour);
                if (armour > 105)
                {
                    SendClientMessage(playerid, COLOR_TAN, "Armour hacking result: POSITIVE.");
                }
                else if(armour < 100.0)
                {
                    SendClientMessage(playerid, COLOR_TAN, "Armour hacking result: NEGATIVE.");
                }
                if (health > 150)
                {
                    SendClientMessage(playerid, COLOR_TAN, "Health hacking result: POSITIVE.");
                }
                else if(health < 100.0)
                {
                    SendClientMessage(playerid, COLOR_TAN, "Health hacking result: NEGATIVE");
                }
            }
            else SendClientMessage(playerid, COLOR_GREY, "You're not authorized to use this command.");
        }
    }
    return 1;
}


COMMAND:ahelp(playerid, params[])
{
	if(PlayerInfo[playerid][pAdmin] >=1)
	{
	    ShowPlayerDialog(playerid, AHELP_DIALOG,DIALOG_STYLE_LIST,"Administrator Help","Moderator Commands\nGeneral Admin Commands\nSenior Admin Commands\nServer Owner Commands\nRCON","Select","Cancel");
	}
	else SendClientMessage(playerid,COLOR_GREY, "You're not authorized to use this command.");
	return 1;
}

COMMAND:ah(playerid, params[])
{
  return cmd_ahelp(playerid, params);
}

COMMAND:kick(playerid, params[])
{
	if(PlayerInfo[playerid][pAdmin] >= 1)
	{
	    new Target;
	    new Reason[100];
	    if(!sscanf(params, "us[70]", Target,Reason))
	    {
	    	if(Target == INVALID_PLAYER_ID) return SendClientMessage(playerid,COLOR_RED,"ERROR: player not connected");
	    	if(PlayerInfo[Target][pAdmin] >= 1 && PlayerInfo[playerid][pAdmin] < 4) return SendClientMessage(playerid, COLOR_GREY, "ERROR: Only Administrators Rank 4 and up can kick other Administrators.");
			new tname[MAX_PLAYER_NAME];
			GetPlayerName(Target,tname,sizeof(tname));
			new pname[MAX_PLAYER_NAME];
			GetPlayerName(playerid,pname,sizeof(pname));
			new MyString[256];
			new TargetString[256];
			format(MyString,sizeof(MyString),"You have kicked %s(%d)! (Reason: %s)",tname,Target,Reason);
			format(TargetString,sizeof(TargetString),"You have been kicked by %s! (Reason: %s)", pname, playerid,Reason);
			SendClientMessage(playerid,COLOR_GREEN,MyString);
			SendClientMessage(Target,COLOR_RED,TargetString);
			new AllString[256];
			format(AllString,sizeof(AllString),"AdmCmd: %s %s kicked player %s(%d) (Reason: %s)",GetAdminLvlName(playerid),pname,tname,Target,Reason);
			SendClientMessageToAll(COLOR_ORANGE,AllString);
			Kick(Target);
		}
	    else SendClientMessage(playerid, COLOR_WHITE, "USAGE: /kick [playerid] [reason]");
	}
	else SendClientMessage(playerid, COLOR_GREY, "ERROR: You're not authorized to use this command.");
	return 1;
}

CMD:ban(playerid, params[])
{
	if(PlayerInfo[playerid][pAdmin] >=2)
	{
	    new target;
	    new reason[112];
	    if(target == INVALID_PLAYER_ID) return SendClientMessage(playerid,COLOR_RED, "ERROR: That playert is not connected.");
	    if(sscanf(params,"us[112]",target,reason)) return SendClientMessage(playerid,COLOR_WHITE, "USAGE: /ban [playerid] [reason]");
	    if(PlayerInfo[target][pAdmin] >=1 && PlayerInfo[playerid][pAdmin] < 4) return SendClientMessage(playerid,COLOR_RED, "ERROR: Only rank 4 Administrators can ban other Administrators.");
	    {
	        new pstring[128];
	        format(pstring,sizeof(pstring), "AdmCmd: %s %s has banned %s. (Reason: %s )",GetAdminLvlName(playerid),GetName(playerid),GetName(target),reason);
	        SendClientMessageToAll(COLOR_ORANGE, pstring);
	        ShowPlayerDialog(target, BAN_DIALOG,DIALOG_STYLE_MSGBOX, "You have been banned.","You have been banned by a Administrator.\nTo get unbanned, please post a ban appeal at our forums\nurbangamingonline.tk","OK","");
	        PlayerInfo[target][pBan] = 1;
			Ban(target);
		}
	}
	else SendClientMessage(playerid,COLOR_RED, "You're not authorized to use this command.");
	return 1;
}


//====================LEVEL 2 ADMINISTRATOR COMMANDS===============================//

CMD:check(playerid, params[])
{
	if(PlayerInfo[playerid][pAdmin] >=1 )
	{
		new target;
		if(sscanf(params, "u",target)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /check [ID].");
		if(!IsPlayerConnected(target)) return SendClientMessage(playerid,COLOR_RED, "Player is not connected.");
	    new Float:health;
		GetPlayerHealth(target, health);
		new Float:armour;
		GetPlayerArmour(target, armour);
		new money;
		money = GetPlayerMoney(target);
		new score;
		score = GetPlayerScore(target);
	    new stats[1280];
	    format(stats, sizeof(stats), "{44A1D0}Score: %d\nHealth: %f\nArmour: %f\nMoney: %d\nVIP: %s\nAdmin Level: %s\nKills: %d\nDeaths: %d\n",
		score, health, armour, money, GetVipLvlName(target), GetAdminLvlName(target), PlayerInfo[target][pKills], PlayerInfo[target][pDeaths]);
	    ShowPlayerDialog(playerid,0,DIALOG_STYLE_MSGBOX,"Information",stats,"Ok","");
	}
	else return SendClientMessage(playerid,COLOR_GREY, ERROR);
    return 1;
}

CMD:slap(playerid, params[])
{
	new target;
	new tstring[128],pstring[128];
	if(PlayerInfo[playerid][pAdmin] >=1)
	{
	    if(sscanf(params,"u",target)) return SendClientMessage(playerid,COLOR_WHITE, "USAGE: /slap [playerid]");
	    if(!IsPlayerConnected(target)) return SendClientMessage(playerid,COLOR_RED, "ERROR: Player is not connected.");
	    new Float:x, Float:y, Float:z;
	    GetPlayerPos(target, x, y, z);
	    SetPlayerPos(target, x, y, z+15);
	    format(pstring,sizeof(pstring), "You have slapped %s.",GetName(target));
	    format(tstring,sizeof(tstring), "You have been slapped by %s %s.",GetAdminLvlName(playerid),GetName(playerid));
	    SendClientMessage(playerid, COLOR_GREEN, pstring);
	    SendClientMessage(target, COLOR_GREEN, tstring);
	}
	else return SendClientMessage(playerid,COLOR_GREY, ERROR);
	return 1;
}
COMMAND:clearchat(playerid,params[])
{
    if(PlayerInfo[playerid][pAdmin] >= 1)
    {
		new pName[24];
    	new str[128];
       	for(new i = 0; i < 135; i++) SendClientMessageToAll(0x00000000," ");
       	GetPlayerName(playerid, pName, 24);
	    format(str, 128, "Chat cleared by %s %s.",GetAdminLvlName(playerid), pName);
    	SendClientMessageToAll(COLOR_CYAN, str);
	}
	else SendClientMessage(playerid,COLOR_GREY,"You're not authorized to use this command.");
	return 1;
}


CMD:resetweapons(playerid, params[])
{
	new target;
	if(PlayerInfo[playerid][pAdmin] >=1)
	{
		if(sscanf(params,"u",target)) return SendClientMessage(playerid,COLOR_WHITE, "USAGE: /resetweapons [playerid]");
		new tstring[128];
		new pstring[128];
		format(tstring,sizeof(tstring), "%s %s has reset all of your weapons.",GetAdminLvlName(playerid),GetName(playerid));
		format(pstring,sizeof(pstring), "You have reset all of %s's weapons.",GetName(target));
		SendClientMessage(target, COLOR_GREEN, tstring);
		SendClientMessage(playerid, COLOR_GREEN, pstring);
		ResetPlayerWeapons(target);
	}
	else SendClientMessage(playerid,COLOR_GREY, "You're not authorized to use this command.");
	return 1;
}

COMMAND:gethere(playerid,params[])
{
    if(PlayerInfo[playerid][pAdmin] >= 2)
	{
 		new Target;
   		if(!sscanf(params, "u", Target))
	    {
	        if(Target == INVALID_PLAYER_ID) return SendClientMessage(playerid,COLOR_BRIGHTRED,"ERROR: That player is not connected.");
			new Float:X;
			new Float:Y;
			new Float:Z;
			GetPlayerPos(playerid,X,Y,Z);
			SetPlayerPos(Target,X+2,Y,Z+1);
			new pname[MAX_PLAYER_NAME];
			new tname[MAX_PLAYER_NAME];
			GetPlayerName(playerid,pname,sizeof(pname));
			GetPlayerName(Target,tname,sizeof(tname));
			new pstring[256];
			new tstring[256];
			format(pstring,sizeof(pstring),"You have teleported %s to your position",tname);
			format(tstring,sizeof(tstring),"%s %s has teleported you to their position",GetAdminLvlName(playerid), pname);
			SendClientMessage(playerid,COLOR_GREEN,pstring);
			SendClientMessage(Target,COLOR_GREEN,tstring);
		}
		else SendClientMessage(playerid,COLOR_WHITE,"USAGE: /gethere <playerid>");
	}
	else SendClientMessage(playerid,COLOR_GREY,"ERROR: You're not authorized to use this command.");
	return 1;
}

CMD:fine(playerid, params[])
{
	if(PlayerInfo[playerid][pAdmin] >=2 )
	{
	    new target;
	    new amount;
		new reason[75];
	    if(sscanf(params, "uis[75]",target, amount, reason)) return SendClientMessage(playerid,COLOR_WHITE, "USAGE: /fine [playerid] [amount] [reason]");
	    if(!IsPlayerConnected(target)) return SendClientMessage(playerid,COLOR_RED, "ERROR: Player is not connected.");
	    new string[150];
	    GivePlayerMoney(target, -amount);
	    format(string,sizeof(string), "AdmCmd: %s was fined %d by %s %s. (Reason: %s)",GetName(target),amount,GetAdminLvlName(playerid),GetName(playerid),reason);
	    SendClientMessageToAll(COLOR_ORANGE, string);
	}
	else return SendClientMessage(playerid,COLOR_GREY, ERROR);
	return 1;
}


COMMAND:sethp(playerid, params[])
{
    if(PlayerInfo[playerid][pAdmin] >= 2)
    {
   		new user, health;
    	if(!sscanf(params, "ui", user, health))
    	{
        	if(user == INVALID_PLAYER_ID) return SendClientMessage(playerid,COLOR_BRIGHTRED,"ERROR: Player is not connected.");
            SetPlayerHealth(user, health);
			new pstring[256];
  			format(pstring,sizeof(pstring),"You have set the players health!");
			SendClientMessage(playerid,COLOR_GREEN	,pstring);
        }
		else SendClientMessage(playerid, COLOR_WHITE, "USAGE: /sethp <id> <amount>");
	}
	else SendClientMessage(playerid,COLOR_GREY,"You're not authorized to use this command.");
    return 1;
}

COMMAND:setarmour(playerid, params[])
{
    if(PlayerInfo[playerid][pAdmin] >= 2)
    {
   		new user, armour;
    	if(!sscanf(params, "ui", user, armour))
    	{
        	if(user == INVALID_PLAYER_ID) return SendClientMessage(playerid,COLOR_BRIGHTRED,"ERROR: Player is not connected.");
            SetPlayerArmour(user, armour);
			new pstring[256];
  			format(pstring,sizeof(pstring),"You have set the players armour");
			SendClientMessage(playerid,COLOR_GREEN	,pstring);
        }
		else SendClientMessage(playerid, COLOR_WHITE, "USAGE: /setarmour <id> <amount>");
	}
	else SendClientMessage(playerid,COLOR_GREY,"You're not authorized to use this command.");
    return 1;
}

CMD:setscore(playerid, params[])
{
    new target;
    new score;
    new tstring[64];
    new pstring[64];
	if(PlayerInfo[playerid][pAdmin]>=2)
	{
		if(sscanf(params,"ui",target,score)) return SendClientMessage(playerid,COLOR_WHITE, "USAGE:/setscore [playerid] [score]");
		{
		    SetPlayerScore(target, score);
		    format(tstring,sizeof(tstring), "%s %s has set your score to %d.",GetAdminLvlName(playerid),GetName(playerid),score);
		    SendClientMessage(target,COLOR_GREEN, tstring);
		    format(pstring,sizeof(pstring), "You have set %s's score to %d.",GetName(target),score);
		    SendClientMessage(playerid,COLOR_GREEN, pstring);
		    PlayerInfo[target][pScore] = score;
		}
	}
	else SendClientMessage(playerid,COLOR_GREY, "You're not authorized to use this command.");
	return 1;
}

CMD:giveweapon(playerid,params[])
{
	if(PlayerInfo[playerid][pAdmin] >=2)
	{
	    new ID, GUN, AMMO;//Creates th variables
	    if(sscanf(params, "uii", ID, GUN, AMMO))
	    {
            SendClientMessage(playerid, COLOR_WHITE, "USAGE: /giveweapon [playerid] [gunid] [ammo]");
			SendClientMessage(playerid, COLOR_GREEN, "_______________________________________");
			SendClientMessage(playerid, COLOR_GREY, "1: Brass Knuckles 2: Golf Club 3: Nite Stick 4: Knife 5: Baseball Bat 6: Shovel 7: Pool Cue 8: Katana 9: Chainsaw");
			SendClientMessage(playerid, COLOR_GREY, "10: Purple Dildo 11: Small White Vibrator 12: Large White Vibrator 13: Silver Vibrator 14: Flowers 15: Cane 16: Frag Grenade");
			SendClientMessage(playerid, COLOR_GREY, "17: Tear Gas 18: Molotov Cocktail 19: Vehicle Missile 20: Hydra Flare 21: Jetpack 22: 9mm 23: Silenced 9mm 24: Desert Eagle 25: Shotgun");
			SendClientMessage(playerid, COLOR_GREY, "26: Sawnoff Shotgun 27: SPAS-12 28: Micro SMG (Mac 10) 29: SMG (MP5) 30: AK-47 31: M4 32: Tec9 33: Rifle");
			SendClientMessage(playerid, COLOR_GREY, "25: Shotgun 34: Sniper Rifle 35: Rocket Launcher 36: HS Rocket Launcher 37: Flamethrower 38: Minigun 39: Satchel Charge");
			SendClientMessage(playerid, COLOR_GREY, "40: Detonator 41: Spraycan 42: Fire Extinguisher 43: Camera 44: Nightvision Goggles 45: Infared Goggles 46: Parachute");
			SendClientMessage(playerid, COLOR_GREEN, "_______________________________________");
			return 1;
		}
	    if(GUN == 0 || GUN >= 46) return SendClientMessage(playerid, -1, "Invalid gunid!");//if the gunid is invalid
	    if(IsPlayerConnected(ID) && ID != INVALID_PLAYER_ID)//if the player is connected and is valid
	    {
	        GivePlayerWeapon(ID, GUN, AMMO);//Gives the GUN and AMMO specified
	        new tstring[128];
	        format(tstring,sizeof(tstring), "%s %s has given you gun ID: %d with %d ammunition.",GetAdminLvlName(playerid),GetName(playerid),GUN,AMMO);
	        SendClientMessage(ID, COLOR_GREEN, tstring);
			new pstring[128];
	  		format(pstring,sizeof(pstring),"You have gave %s a Weapon with %d Ammo.",GetName(ID),AMMO);
	  		SendClientMessage(playerid,COLOR_GREEN, pstring);
	    }
	}
   	else return SendClientMessage(playerid,COLOR_GREY,"You're not authorized to use this command.");
    return 1;
}


CMD:ann(playerid, params[])
{
	if(PlayerInfo[playerid][pAdmin] >= 2)
	{
		new text[64];
		new pstring[80];
		if(sscanf(params,"s[64]",text)) return SendClientMessage(playerid,COLOR_WHITE, "USAGE: /ann [text]");
		{
		    for (new i = 0; i<MAX_PLAYERS; i++)
		    {
			    format(pstring,sizeof(pstring),"%s",text);
			    GameTextForPlayer(i,text,5000,6);
			}
		}
	}
	else SendClientMessage(playerid,COLOR_GREY, "You're not authorized to use this command.");
	return 1;
}

//====================LEVEL 3 ADMINISTRATOR COMMANDS================================//


CMD:resetweaponsall(playerid, params[])
{
	if(PlayerInfo[playerid][pAdmin] >=3 )
	{
	    foreach (Player, i)
	    {
	        ResetPlayerWeapons(i);
	    }
	    new string[128];
	    format(string,sizeof(string), "AdmCmd: %s %s has reset everyone's Weapons.",GetAdminLvlName(playerid), GetName(playerid));
	    SendClientMessageToAll(COLOR_ORANGE, string);
	}
	else return SendClientMessage(playerid, COLOR_GREY, ERROR);
	return 1;
}

CMD:heal(playerid, params[])
{
	if(PlayerInfo[playerid][pAdmin] >=3 )
	{
	    SetPlayerHealth(playerid, 100);
	    SendClientMessage(playerid,COLOR_GREEN, "You have successfully healed yourself.");
	}
	else return SendClientMessage(playerid,COLOR_GREY, ERROR);
	return 1;
}

CMD:gethereall(playerid, params[])
{
	if(PlayerInfo[playerid][pAdmin] >=3)
	{
	    new Float:x, Float:y, Float:z;
		foreach(Player, i)
		{
			GetPlayerPos(playerid, x, y, z);
			SetPlayerPos(i, x+2, y, z+1);
		}
		new string[128];
		format(string,sizeof(string), "AdmCmd: %s %s has teleported everyone online to his location.",GetAdminLvlName(playerid), GetName(playerid));
		SendClientMessageToAll(COLOR_ORANGE, string);
	}
	else return SendClientMessage(playerid,COLOR_GREY, ERROR);
	return 1;
}

CMD:akill(playerid, params[])
{
	new target;
	new str[128];
	if(sscanf(params, "u", target)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /akill [Player ID]");
	if(!IsPlayerConnected(target)) return SendClientMessage(playerid, COLOR_RED, "ERROR: Player is not connected.");
	if(PlayerInfo[playerid][pAdmin] >=2)
	{
	    format(str, sizeof(str), "You have killed player %s", GetName(target));
	    SetPlayerHealth(target, 0);
	    SendClientMessage(playerid, COLOR_LIGHTGREEN, str);
	    format(str, sizeof(str), "You've been killed by Administrator %s.", GetName(playerid));
	    SendClientMessage(target, COLOR_RED, str);
	}
	else SendClientMessage(playerid, COLOR_GREY, "You're not authorized to use this command.");
	return 1;
}

CMD:killall(playerid, params[])
{
	if(PlayerInfo[playerid][pAdmin]>=3)
	{
	    new reason[65];
		if(sscanf(params,"s[50]",reason)) return SendClientMessage(playerid,COLOR_WHITE, "USAGE: /killall [reason]");
		new pstring[100];
		format(pstring,sizeof(pstring), "AdmCmd: %s %s has killed everyone online. (Reason: %s )",GetAdminLvlName(playerid),GetName(playerid), reason);
		SendClientMessageToAll(COLOR_ORANGE,pstring);
		for (new i = 0; i<MAX_PLAYERS; i++)
		{
  			SetPlayerHealth(i,0);
		}
	}
	else SendClientMessage(playerid,COLOR_GREY, "You're not authorized to use this command.");
	return 1;
}


CMD:giveweaponall(playerid,params[])
{
	if(PlayerInfo[playerid][pAdmin] >=3)
	{
	    new GUN, AMMO;
	    if(sscanf(params, "ii",GUN,AMMO)) return SendClientMessage(playerid,-1,"Usage: /giveweaponall [gunid] [ammo]");
	    if(GUN == 0 || GUN >= 45) return SendClientMessage(playerid, -1, "Invalid gunid!");
	    new pstring[90];
	    format(pstring,sizeof(pstring), "AdmCmd: %s %s has gave everyone online a weapon with %d ammo.",GetAdminLvlName(playerid),GetName(playerid),AMMO);
	    SendClientMessageToAll(COLOR_ORANGE, pstring);
	    {
	        for (new i = 0; i<MAX_PLAYERS; i++)
	        {
		        GivePlayerWeapon(i, GUN, AMMO);
			}
	    }
	}
	else SendClientMessage(playerid,COLOR_GREY,"You're not authorized to use this command.");
 	return 1;
}

COMMAND:sethpall(playerid, params[])
{
    if(PlayerInfo[playerid][pAdmin] >= 3)
    {
   		new health;
    	if(sscanf(params, "i",health)) return SendClientMessage(playerid,COLOR_WHITE, "USAGE: /sethpall [amount]");
    	new pstring[80];
    	format(pstring,sizeof(pstring), "AdmCmd: %s %s has set everyone's health to %d.",GetAdminLvlName(playerid),GetName(playerid),health);
    	SendClientMessageToAll(COLOR_ORANGE, pstring);
   		for (new i = 0; i<MAX_PLAYERS; i++)
   		{
     		SetPlayerHealth(i, health);
    	}
	}
	else SendClientMessage(playerid,COLOR_GREY,"You're not authorized to use this command.");
    return 1;
}

COMMAND:setarmourall(playerid, params[])
{
    if(PlayerInfo[playerid][pAdmin] >= 3)
    {
   		new health;
    	if(sscanf(params, "i",health)) return SendClientMessage(playerid,COLOR_WHITE, "USAGE: /setarmourall [amount]");
    	new pstring[80];
    	format(pstring,sizeof(pstring), "AdmCmd: %s %s has set everyone's armour to %d.",GetAdminLvlName(playerid),GetName(playerid),health);
    	SendClientMessageToAll(COLOR_ORANGE, pstring);
   		for (new i = 0; i<MAX_PLAYERS; i++)
   		{
     		SetPlayerArmour(i, health);
    	}
	}
	else SendClientMessage(playerid,COLOR_GREY,"You're not authorized to use this command.");
    return 1;
}

//=======================LEVEL 4 ADMINISTRATOR COMMANDS=============================//
CMD:god(playerid, params[])
{
	if(PlayerInfo[playerid][pAdmin] >= 4 )
	{
	    if(agod[playerid] == 0 )
	    {
	        agod[playerid] = 1;
	        SetPlayerHealth(playerid,999999999);
	        GameTextForPlayer(playerid, "~g~God Mode Activated.",3000,1);
	    }
	    else
	    {
	        agod[playerid] = 0;
	        SetPlayerHealth(playerid, 100);
	        GameTextForPlayer(playerid, "~r~God Mode Deactivated",3000,1);
	    }
	}
	else return SendClientMessage(playerid,COLOR_GREY, ERROR);
	return 1;
}

CMD:savestats(playerid, params[])
{
	if(PlayerInfo[playerid][pAdmin] >=4)
	{
		new string[128], reason[75];
		if(sscanf(params, "s[75]",reason)) return SendClientMessage(playerid,COLOR_WHITE, "USAGE: /savestats [reason]");
		{
			foreach (Player, i)
			{
			    new INI:File = INI_Open(UserPath(i));
			    INI_SetTag(File,"data");
			    INI_WriteInt(File,"Cash",GetPlayerMoney(i));
			    INI_WriteInt(File,"Admin",PlayerInfo[i][pAdmin]);
			    INI_WriteInt(File,"Beta",PlayerInfo[i][pBeta]);
			    INI_WriteInt(File,"Vip",PlayerInfo[i][pVip]);
			    INI_WriteInt(File,"Kills",PlayerInfo[i][pKills]);
			    INI_WriteInt(File,"Deaths",PlayerInfo[i][pDeaths]);
			    INI_WriteInt(File,"Ban",PlayerInfo[i][pBan]);
			    INI_WriteInt(File,"Score",PlayerInfo[i][pScore]);
			    INI_WriteInt(File,"Skin",GetPlayerSkin(i));
			    INI_Close(File);
			}
			format(string,sizeof(string), "AdmCmd: %s %s has Saved everyones stats. Reason: %s",GetAdminLvlName(playerid),GetName(playerid),reason);
			SendClientMessageToAll(COLOR_ORANGE, string);
		}
	}
	else return SendClientMessage(playerid, COLOR_GREY, ERROR);
	return 1;
}
COMMAND:givemoney(playerid,params[])
{
    if(PlayerInfo[playerid][pAdmin] >= 4)
    {
    	new Target;
	    new Ammount;
     	if(!sscanf(params, "ui", Target, Ammount))
	    {
     		if(Target == INVALID_PLAYER_ID) return SendClientMessage(playerid,COLOR_RED,"ERROR: Player is not connected");
       		if(Ammount > 9999999) return SendClientMessage(playerid,COLOR_RED,"ERROR: Money ammount from 0 to 9999999");
			GivePlayerMoney(Target,Ammount);
			new tname[MAX_PLAYER_NAME];
			GetPlayerName(Target,tname,sizeof(tname));
			new pname[MAX_PLAYER_NAME];
			GetPlayerName(playerid,pname,sizeof(pname));
			new tstring[256];
			new pstring[256];
			format(tstring,sizeof(tstring),"You have been given $%d by %s %s",Ammount,GetAdminLvlName(playerid),pname);
			format(pstring,sizeof(pstring),"You have given $%d to %s(%d)",Ammount,tname,Target);
			SendClientMessage(Target,COLOR_GREEN,tstring);
			SendClientMessage(playerid,COLOR_GREEN,pstring);
		}
		else SendClientMessage(playerid, COLOR_WHITE, "USAGE: /givemoney [Player ID] [Amount]");
 	}
	else SendClientMessage(playerid,COLOR_GREY,"You're not authorized to use this command.");
	return 1;
}

//======================RCON COMMANDS=============================================//
CMD:setvip(playerid, params[])
{
	if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, COLOR_GREY, ERROR);
	new target, level;
	if(sscanf(params, "ud",target,level)) return SendClientMessage(playerid,COLOR_WHITE, "USAGE: /setvip [playerid] [level 1-3]");
	if(level > 3 ) return SendClientMessage(playerid,COLOR_RED, "ERROR: Maximum VIP level is 3.");
	if(!IsPlayerConnected(target)) return SendClientMessage(playerid,COLOR_RED, "ERROR: Player is not connected.");
	new tstring[128];
	new pstring[128];
	//
	if(level == 0)
	{
	    format(tstring,sizeof(tstring), "%s %s has removed your VIP.",GetAdminLvlName(playerid),GetName(playerid));
		format(pstring,sizeof(pstring), "You have removed %s's VIP",GetName(target));
		SendClientMessage(target,COLOR_VIOLET, tstring);
		SendClientMessage(playerid, COLOR_VIOLET, pstring);
		PlayerInfo[target][pVip] = 0;
	}
	if(level == 1)
	{
  		format(tstring,sizeof(tstring), "You have been set to a Bronze VIP by %s %s",GetAdminLvlName(playerid),GetName(playerid));
		format(pstring,sizeof(pstring), "You have made %s a Bronze Vip",GetName(target));
		SendClientMessage(target,COLOR_VIOLET, tstring);
		SendClientMessage(playerid, COLOR_VIOLET, pstring);
		PlayerInfo[target][pVip] = 1;
	}
	if(level == 2)
	{
	    format(tstring,sizeof(tstring), "You have been set to a Silver Vip by %s %s",GetAdminLvlName(playerid),GetName(playerid));
		format(pstring,sizeof(pstring), "You have made %s a Silver Vip.",GetName(target));
		SendClientMessage(target,COLOR_VIOLET, tstring);
		SendClientMessage(playerid, COLOR_VIOLET, pstring);
		PlayerInfo[target][pVip] = 2;
	}
	if(level == 3)
	{
	    format(tstring,sizeof(tstring), "You have been set to a Gold Vip by %s %s",GetAdminLvlName(playerid),GetName(playerid));
		format(pstring,sizeof(pstring), "You have made %s a Gold Vip.",GetName(target));
		SendClientMessage(target,COLOR_VIOLET, tstring);
		SendClientMessage(playerid, COLOR_VIOLET, pstring);
		PlayerInfo[target][pVip] = 3;
	}
	return 1;
}

CMD:asetbeta(playerid, params[])
{
	if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You're not authorized to use this command.");
	{
		new target,level;
		if(sscanf(params,"ud",target,level)) return SendClientMessage(playerid,COLOR_WHITE, "USAGE: /asetbeta [playerid] [level 0-3]");
		if(target == INVALID_PLAYER_ID) return SendClientMessage(playerid,COLOR_RED, "ERROR: Player is not connected.");
		if(level > 3) return SendClientMessage(playerid, COLOR_RED, "ERROR: Maximum Beta level is 3.");
		new tstring[128];
		new pstring[128];
		//
		if(level == 0)
		{
		    format(tstring,sizeof(tstring), "%s %s has taken away your Beta rights.",GetAdminLvlName(playerid),GetName(playerid));
			format(pstring,sizeof(pstring), "You have removed %s's Beta rights.",GetName(target));
			SendClientMessage(target,COLOR_LIGHTGREEN, tstring);
			SendClientMessage(playerid, COLOR_LIGHTBLUE, pstring);
			PlayerInfo[target][pBeta] = 0;
			SetPVarInt(target, "Beta", 0);
		}
		if(level == 1)
		{
	  		format(tstring,sizeof(tstring), "You have been a Trial Beta Tester by %s %s",GetAdminLvlName(playerid),GetName(playerid));
			format(pstring,sizeof(pstring), "You have made %s a Trial Beta Tester.",GetName(target));
			SendClientMessage(target,COLOR_LIGHTGREEN, tstring);
			SendClientMessage(playerid, COLOR_LIGHTBLUE, pstring);
			PlayerInfo[target][pBeta] = 1;
			SetPVarInt(target, "Beta", 1);
		}
		if(level == 2)
		{
	  		format(tstring,sizeof(tstring), "You have been made a Beta Tester by %s %s",GetAdminLvlName(playerid),GetName(playerid));
			format(pstring,sizeof(pstring), "You have made %s a Beta Tester.",GetName(target));
			SendClientMessage(target,COLOR_LIGHTGREEN, tstring);
			SendClientMessage(playerid, COLOR_LIGHTBLUE, pstring);
			PlayerInfo[target][pBeta] = 2;
			SetPVarInt(target, "Beta", 1);
		}
		if(level == 3)
		{
	  		format(tstring,sizeof(tstring), "You have been made a Head Beta Tester by %s %s",GetAdminLvlName(playerid),GetName(playerid));
			format(pstring,sizeof(pstring), "You have made %s a Head Beta Tester.",GetName(target));
			SendClientMessage(target,COLOR_LIGHTGREEN, tstring);
			SendClientMessage(playerid, COLOR_LIGHTBLUE, pstring);
			PlayerInfo[target][pBeta] = 3;
			SetPVarInt(target, "Beta", 1);
		}
	}
	return 1;
}

CMD:setadmin(playerid, params[])
{
	if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You're not authorized to use this command.");
	{
		new target,level;
		if(sscanf(params,"ud",target,level)) return SendClientMessage(playerid,COLOR_WHITE, "USAGE: /setadmin [playerid] [level 1-4]");
		if(target == INVALID_PLAYER_ID) return SendClientMessage(playerid,COLOR_RED, "ERROR: Player is not connected.");
		if(level > 4) return SendClientMessage(playerid, COLOR_RED, "ERROR: Maximum Administrator level is 4.");
		new tstring[128];
		new pstring[128];
		//
		if(level == 0)
		{
		    format(tstring,sizeof(tstring), "%s %s has taken away your Administration rights.",GetAdminLvlName(playerid),GetName(playerid));
			format(pstring,sizeof(pstring), "You have removed %s's Administration rights.",GetName(target));
			SendClientMessage(target,COLOR_LIGHTGREEN, tstring);
			SendClientMessage(playerid, COLOR_LIGHTGREEN, pstring);
			PlayerInfo[target][pAdmin] = 0;
		}
		if(level == 1)
		{
	  		format(tstring,sizeof(tstring), "You have been promoted/demoted to a Moderator by %s %s",GetAdminLvlName(playerid),GetName(playerid));
			format(pstring,sizeof(pstring), "You have made %s a Moderator.",GetName(target));
			SendClientMessage(target,COLOR_LIGHTGREEN, tstring);
			SendClientMessage(playerid, COLOR_LIGHTGREEN, pstring);
			PlayerInfo[target][pAdmin] = 1;
		}
		if(level == 2)
		{
		    format(tstring,sizeof(tstring), "You have been promoted/demoted to a General Administrator by %s %s",GetAdminLvlName(playerid),GetName(playerid));
			format(pstring,sizeof(pstring), "You have made %s a General Administrator.",GetName(target));
			SendClientMessage(target,COLOR_LIGHTGREEN, tstring);
			SendClientMessage(playerid, COLOR_LIGHTGREEN, pstring);
			PlayerInfo[target][pAdmin] = 2;
		}
		if(level == 3)
		{
		    format(tstring,sizeof(tstring), "You have been promoted/demoted to a Senior Administrator by %s %s",GetAdminLvlName(playerid),GetName(playerid));
			format(pstring,sizeof(pstring), "You have made %s a Senior Administrator.",GetName(target));
			SendClientMessage(target,COLOR_LIGHTGREEN, tstring);
			SendClientMessage(playerid, COLOR_LIGHTGREEN, pstring);
			PlayerInfo[target][pAdmin] = 3;
		}
		if(level == 4)
		{
		    format(tstring,sizeof(tstring), "You have been promoted to a Server Owner by %s %s",GetAdminLvlName(playerid),GetName(playerid));
			format(pstring,sizeof(pstring), "You have made %s a Server Owner.",GetName(target));
			SendClientMessage(target,COLOR_LIGHTGREEN, tstring);
			SendClientMessage(playerid, COLOR_LIGHTGREEN, pstring);
			PlayerInfo[target][pAdmin] = 4;
		}
	}
	return 1;
}

CMD:a(playerid, params[])
{
    new text[128];
	if(PlayerInfo[playerid][pAdmin]>=1)
	{
		if(sscanf(params, "s[128]",text)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /a(dmin) [Text]");
		format(text,sizeof(text),"[%s]%s: %s",GetAdminLvlName(playerid),GetName(playerid),params);
		foreach(Player, i)
		{
			if(PlayerInfo[i][pAdmin]>=1)
			{
				SendClientMessage(i,COLOR_RED,text);
		}   }
	}
	else SendClientMessage(playerid,COLOR_GREY, "You're not authorized to use this command.");
	return 1;
}

COMMAND:admins(playerid,params[])
{
	new AdminRank[128];
	new count = 0;
	new string[128];
	SendClientMessage(playerid,COLOR_RED,"");
	SendClientMessage(playerid,COLOR_GREEN,"________________|The Hunger Games Administrators|________________");
	SendClientMessage(playerid,COLOR_RED,"");
	for(new i = 0; i < MAX_PLAYERS; i++)
	{
		if(IsPlayerConnected(i))
		{
			if(PlayerInfo[i][pAdmin] > 0)
			{
				if(PlayerInfo[i][pAdmin] == 1)
				{
					AdminRank = "Moderator";
				}
				else if(PlayerInfo[i][pAdmin] == 2)
				{
					AdminRank = "General Administrator";
				}
				else if(PlayerInfo[i][pAdmin] == 3)
				{
					AdminRank = "Senior Administrator";
				}
				else if(PlayerInfo[i][pAdmin] == 4)
				{
					AdminRank = "Server Owner";
				}
				new Name[MAX_PLAYER_NAME];
				GetPlayerName(i,Name,sizeof(Name));
				format(string, sizeof(string), "Level: %d | Name: %s (ID:%i) | Rank: %s ", PlayerInfo[i][pAdmin], Name,i,AdminRank);
				SendClientMessage(playerid,COLOR_CYAN,string);
				count++;
			}
		}
	}
	if(count == 0)
	SendClientMessage(playerid,COLOR_RED,"No Hunger Games members currently online.");
	SendClientMessage(playerid,COLOR_GREEN,"_________________________________________________________________");
	return 1;
}
Reply
#2

Bump
Reply
#3

Of course it is lost. This looks like more like GM and not FS. If you restart GM you will also lost unsaved data. If you reload this FS then all the variables will be created as a new.

//Aww just load mmm..
Reply
#4

Quote:
Originally Posted by Matess
Посмотреть сообщение
Of course it is lost. This looks like more like GM and not FS. If you restart GM you will also lost unsaved data. If you reload this FS then all the variables will be created as a new.

//Aww just load mmm..
It would be great if you could help me with it.
Reply
#5

Bump
Reply
#6

Код:
#include <YSI\y_ini>
Is that how the file is called in ur samp directory?

navigate to SampServer\Includes\ tell me if its the same name.
Reply
#7

Quote:
Originally Posted by yvoms
Посмотреть сообщение
Код:
#include <YSI\y_ini>
Is that how the file is called in ur samp directory?

navigate to SampServer\Includes\ tell me if its the same name.
It is lol
Reply
#8

Download nativechecker.dll
https://sampforum.blast.hk/showthread.php?tid=249226
and put it in ur plugins folder,
Add it to ur server.cfg and give me the error it gives you in the server_log
Reply
#9

You newed a script call the "saveaccounts" to check every action to open your save file and write what he need
Reply
#10

im awaiting the nativechecker result, wich would reveal any broken / misconfigured functions within the plugins and or gamemode.
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)