SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 31/10/2011, 01:38 PM   #1
GAMER_PS2
Huge Clucker
 
GAMER_PS2's Avatar
 
Join Date: Aug 2011
Posts: 345
Reputation: 19
Angry I'm crying with all of bugs on my script!

Note: I post this because i'm tried and crying with all bugs on my script i'm crying!

ORDER BUG that i'm giving up and posting here!

- Mute Bug
- Admin System Bug
- PM Bug Text

ORDER That i need to make

- Round Time - http://forum.sa-mp.com/showthread.php?t=294126

Mute Bug - My Friend say he can still talk even mute so i need help with this
Admin System Bug - My Friend say the .ini file is not creating
PM Bug Text - when i type /pm 0 theres bug on PM it will show up like this "theres bug on P"
Round Time - Forget About That

I'm giving up i'm tried i need help.

Mute Code:

pawn Code:
SetPVarInt(playerid,"textspam",GetPVarInt(playerid,"textspam")+1);
    SetTimerEx("clearspam",5000,false,"d",playerid);
    if(GetPVarInt(playerid,"textspam") == 5) {
        new string[128];
        new pname[MAX_PLAYER_NAME];
        GetPlayerName(playerid,pname,sizeof(pname));
        format(string,sizeof(string),"ANTICHEAT: %s has been mute for 2 minutes <Reason: Text Spam>",pname);
        SendClientMessageToAll(COLOR_RED,string);
        SetPVarInt(playerid,"mute",1);
        SetTimer("Unmute",70000, true);
    }
    else if(GetPVarInt(playerid,"textspam") == 4) {
        SendClientMessage(playerid,COLOR_RED,"ANTICHEAT: Stop spamming or you will be mute! <Wait 5 secs>");
        return 0;
    }
   
    if(GetPVarInt(playerid,"mute") == 1)
    {
       SendClientMessage(playerid,COLOR_RED,"ANTICHEAT: You cannot talk your mute!");
    }
    else if(GetPVarInt(playerid,"mute") == 0)
    {
       new PlayerName[MAX_PLAYER_NAME];
       GetPlayerName(playerid, PlayerName, sizeof(PlayerName));
       GetPlayerColor(playerid);
       format(text,1024, "%s {FFFFFF} (%d): {FFFFFF}%s", PlayerName, playerid, text);
       SendClientMessageToAll(GetPlayerColor(playerid), text);
       return 0;
    }
   
    if(GetPVarInt(playerid,"AFK") == 1)
    {
       new PlayerName[MAX_PLAYER_NAME];
       GetPlayerName(playerid, PlayerName, sizeof(PlayerName));
       GetPlayerColor(playerid);
       format(text,1024, "[AFK] %s {FFFFFF} (%d): {FFFFFF}%s", PlayerName, playerid, text);
       SendClientMessageToAll(GetPlayerColor(playerid), text);
    }
    else if(GetPVarInt(playerid,"AFK") == 0)
    {
       new PlayerName[MAX_PLAYER_NAME];
       GetPlayerName(playerid, PlayerName, sizeof(PlayerName));
       GetPlayerColor(playerid);
       format(text,1024, "%s {FFFFFF} (%d): {FFFFFF}%s", PlayerName, playerid, text);
       SendClientMessageToAll(GetPlayerColor(playerid), text);
       return 0;
    }

pawn Code:
public Unmute(playerid)
{
    new string[128],pname[MAX_PLAYER_NAME];
    GetPlayerName(playerid,pname,sizeof(pname));
    SetPVarInt(playerid,"mute",0);
    SendClientMessage(playerid,COLOR_GREEN,"You have been unmute by our ANTICHEAT!");
    format(string,sizeof(string),"%s has been unmute",pname);
    SendClientMessageToAll(COLOR_GREEN,string);
    return 1;
}

Admin System Code:

pawn Code:
/*

                       Xteme AdminScript System v1.0
                        ---------------------------
                       Made by Mr.Kakashi & GAMER_PS2
                    Associate with Wolf Pack Clan Management
                                Sponsors:
                        ---------------------------
                        SP Community Management
                        Wolf Pack Clan Community
                            TSU Community
                         Mr.Kakashi's Community
                        ---------------------------
                Copyright(c), [SP]Mr.Kakashi[WP] & GAMER_PS2Ö

*/


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

/*
________________________________________________________________________________
Bug Fixer: Aprest <SAMP Forum User>
Y_Less - Y_INI/Sscanf/YSI
Zeex - ZCMD
[SP]Mr.Kakashi[WP] (me) - Xtreme Kakashi Include
________________________________________________________________________________

EXPLAIN:

Xtreme Admin was developed on the same time with Xtreme Gangwar this both
Script is combine. We Have Two Versions of Xtreme Admin first version is
The Gamemode one which is the admin system is attach on gamemode. Second One
is Filterscript which means is the script is not attach on gamemode.

STORYLINE:

Theres no Storyline on Xtreme Admin because it will just role as admin system
of Xtreme Gangwar. NOTE:Xtreme Gangwar have connection with Xtreme Admin!

BEHIND THE SCENES:

October 6.2011 - 2:30PM
The Xtreme Gangwar is the 5th idea of me to be a Project and release it to public
Xtreme Gangwar almost the same as the 3rd idea (Xtreme Kakashi Gamemode). Xtreme
Gangwar has been announce to be release after the construction is finish. Since
the 3rd Idea (Xtreme Kakashi) has been finish on August 29,2011. the 4th idea
is the message filterscript.

INFORMATION:

DEFINITAION: Gangwar
MAP: Xtreme Gangwar World

October 9,2011 - 9:30AM
Another script is really this is have connection between the gamemode and the
admin script. This is the 6th Idea of me. This would be the Xtreme Admin which
is gonna be use on Xtreme Gangwar. Xtreme Admin can support the Gamemode. if
You change the gamemode like LuxAdmin, LuxAdmin will not support the gamemode
little bit it look like a fail script, and theres missing commands for server.
Xtreme Admin is already connect on Xtreme Gangwar. so dont change it.

*/


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

#include <a_samp>
#include <YSI\y_ini>
#include <zcmd>
#include <sscanf2>

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

#define RULEDIALOG          311  //Dialog ID for /forcerules
#define WARNDIALOG          455  //Dialog ID for /warn
#define SECOND(%1) ((%1)*(1000)) // Second TIMER - Aprezt
#define MAX_WARNINGS         3   //Max Warning of /warn command
#define ADM_CHAT_LOG        true //Turns off/on Saving Admin Chat!
#define SERVER_OWN_CHAT_LOG true //Turns off/on Saving Server Owner Chat!
#define SaveLogs            true //Turns off/on Save Logs To The Admin Folder
#define AUTOLOGIN           //Admin System Autologin Dont use it if you dont want it
                            //But it will work you to long to remove this autologin

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

enum pInfo
{
    pPass,
    pCash,
    pScore,
    pAdmin,
    pKills,
    pFreeze,
    pBanned,
    pDeaths,
    pGod,
    pMute,
    pWarn,
};
new PlayerInfo[MAX_PLAYERS][pInfo],
    AdmRank[128],
    adminduty[MAX_PLAYERS], //ADMINDUTY FUNCTION
    Count,
    accountstimer;

forward SaveIn(filename[],text[]);
forward LoadUser_data(playerid,name[],value[]);
forward Counting(playerid);
forward Counting4(playerid);
forward Counting3(playerid);
forward Counting2(playerid);
forward SaveAccountStats(playerid);
forward Counting1(playerid);
forward SaveAccounts();
forward GO(playerid);


#define DIALOG_REGISTER 451
#define DIALOG_LOGIN 452

#define PATH "Server/Users/%s.ini"
#define REGISTERED_MONEY 5000

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

#define red "{FF002B}"
#define pink "{FF00D9}"
#define purple "{DFA7F2}"
#define blue "{A1C2FF}"
#define green "{008000}"
#define yellow "{FAF623}"
#define black "{69670C}"
#define orange "{F2C80C}"
#define ice "{03F2FF}"
#define white "{FFFFFF}"
#define lime "{00FF40}"

#define COLOR_LIGHTBLUE 0x33CCFFAA
#define COLOR_RED 0xFF0000FF
#define COLOR_GREY 0xAFAFAFAA
#define COLOR_YELLOW 0xFFFF00AA
#define COLOR_PINK 0xFF66FFAA
#define COLOR_BLUE 0x0000BBAA
#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_GREEN 0x33AA33AA
#define COLOR_YELLOW 0xFFFF00AA
#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

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

#if defined FILTERSCRIPT

public OnFilterScriptInit()
{
    print("\n--------------------------------------");
    print("        Xtreme Administration V1.0.0    ");
    print("            Made by Mr.Kakashi          ");
    print("          Copyright 2011 - 2020         ");
    print("--------------------------------------\n");
    accountstimer = SetTimer("SaveAccounts", SECOND(20), 1);
    return 1;
}

public OnFilterScriptExit()
{
    KillTimer(accountstimer);
    return 1;
}

#endif

public SaveAccountStats(playerid)
{
    new
        INI:File = INI_Open(UserPath(playerid))
    ;
    INI_SetTag(File,"data");
    INI_WriteInt(File,"Password",PlayerInfo[playerid][pPass]);
    INI_WriteInt(File,"Cash",PlayerInfo[playerid][pCash]);
    INI_WriteInt(File,"Score",PlayerInfo[playerid][pScore]);
    INI_WriteInt(File,"Admin",PlayerInfo[playerid][pAdmin]);
    INI_WriteInt(File,"Kills",PlayerInfo[playerid][pKills]);
    INI_WriteInt(File,"Freeze",PlayerInfo[playerid][pFreeze]);
    INI_WriteInt(File,"Banned",PlayerInfo[playerid][pBanned]);
    INI_WriteInt(File,"Deaths",PlayerInfo[playerid][pDeaths]);
    INI_WriteInt(File,"God",PlayerInfo[playerid][pGod]);
    INI_WriteInt(File,"Mute",PlayerInfo[playerid][pMute]);
    INI_WriteInt(File,"Warn",PlayerInfo[playerid][pWarn]);
    INI_Close(File);
    return 1;
}

public SaveAccounts()
{
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        if(IsPlayerConnected(i))
        {
            SaveAccountStats(i);
        }
    }
}

public LoadUser_data(playerid,name[],value[])
{
    INI_Int("Password", PlayerInfo[playerid][pPass]);
    INI_Int("Cash",PlayerInfo[playerid][pCash]);
    INI_Int("Score",PlayerInfo[playerid][pScore]);
    INI_Int("Admin",PlayerInfo[playerid][pAdmin]);
    INI_Int("Banned",PlayerInfo[playerid][pBanned]);
    INI_Int("Kills",PlayerInfo[playerid][pKills]);
    INI_Int("Deaths",PlayerInfo[playerid][pDeaths]);
    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,""white"Login",""red"Note:"white"If this is not your account please leave to this account and create your own one.\n\n"white"Type your password below to login to your account","Login","Exit");
    }
    else
    {
        ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT,""white"Register",""red"Note:"white"If you crash ingame your account will be save.\n\n"white"Type the password below to create new account","Register","Exit");
    }
    return 1;
}

public OnPlayerDisconnect(playerid, reason)
{
    SaveAccountStats(playerid);
    new pname[MAX_PLAYER_NAME], string[39 + MAX_PLAYER_NAME];
    GetPlayerName(playerid, pname, sizeof(pname));
    switch(reason)
    {
        case 0: format(string, sizeof(string), "%s has left the server (Lost Connection/Crash)", pname);
        case 1: format(string, sizeof(string), "%s has left the server (Leaving)", pname);
        case 2: format(string, sizeof(string), "%s has left the server (Kicked/Banned)", pname);
    }
    SendClientMessageToAll(COLOR_GREY, string);
    return 1;
}

public Counting(playerid)
{
    Count = 1;
    GameTextForAll("~b~5",1000,3);
    PlayerPlaySound(playerid, 1056,0,0,0);
    SetTimer("Counting4",1000,false);
    return 1;
}
public Counting4(playerid)
{
    Count = 1;
    GameTextForAll("~y~4",1000,3);
    PlayerPlaySound(playerid, 1056,0,0,0);
    SetTimer("Counting3",1000,false);
    return 1;
}
public Counting3(playerid)
{
    Count = 1;
    GameTextForAll("~p~3",1000,3);
    PlayerPlaySound(playerid, 1056,0,0,0);
    SetTimer("Counting2",1000,false);
    return 1;
}
public Counting2(playerid)
{
    Count = 1;
    GameTextForAll("~g~2",1000,3);
    PlayerPlaySound(playerid, 1056,0,0,0);
    SetTimer("Counting1",1000,false);
    return 1;
}
public Counting1(playerid)
{
    Count = 1;
    GameTextForAll("~r~1",1000,3);
    PlayerPlaySound(playerid, 1056,0,0,0);
    SetTimer("GO",1000,false);
    return 1;
}
public GO(playerid)
{
    Count = 0;
    PlayerPlaySound(playerid, 1057,0,0,0);
    GameTextForAll("~g~Server Restart Activate!",1000,3);
    SendRconCommand("gmx");
    return 1;
}

public OnPlayerRequestSpawn(playerid)
{
    return 1;
}

public OnPlayerSpawn(playerid)
{
    return 1;
}

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

public OnPlayerText(playerid, text[])
{
    if(text[0] == '#' && PlayerInfo[playerid][pAdmin] >= 1 && strlen(text[1]))
    {
        new string[128];
        new adminname[MAX_PLAYER_NAME];
        GetPlayerName(playerid,adminname,sizeof(string));
        format(string,sizeof(string),"Admin Chat: %s: "white"%s",adminname,text[1]);
        MessageToAdmins(COLOR_RED,string);
        #if ADM_CHAT_LOG == true
        SaveIn("AdminChat",string);
        #endif
        return 0;
    }

    if(text[0] == '!' && PlayerInfo[playerid][pAdmin] >= 10 && strlen(text[1]))
    {
        new string[128];
        new adminname[MAX_PLAYER_NAME];
        GetPlayerName(playerid,adminname,sizeof(string));
        format(string,sizeof(string),"Server Owner Chat: %s: "white"%s",adminname,text[1]);
        MessageToAdmins(COLOR_RED,string);
        #if SERVER_OWN_CHAT_LOG == true
        SaveIn("ServerOwnChat",string);
        #endif
        return 0;
    }
    return 1;
}

public SaveIn(filename[],text[])
{
    #if SaveLogs == true
    new File:Lfile;
    new filepath[256];
    new string[256];
    new year,month,day;
    new hour,minute,second;

    getdate(year,month,day);
    gettime(hour,minute,second);
    format(filepath,sizeof(filepath),"Server/Logs/%s.txt",filename);
    Lfile = fopen(filepath,io_append);
    format(string,sizeof(string),"[%02d/%02d/%02d | %02d:%02d:%02d] %s\r\n",month,day,year,hour,minute,second,text);
    fwrite(Lfile,string);
    fclose(Lfile);
    #endif
    return 1;
}

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

public OnPlayerPickUpPickup(playerid, pickupid)
{
    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 OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(dialogid == DIALOG_REGISTER)
    {
          if (!response) return ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT,""white"Register",""red"Note:"white"If you crash ingame your account will be save.\n\n"white"Type the password below to create new account","Register","Exit");
          if(response)
          {
             if(!strlen(inputtext)) return ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT,""white"Register",""red"Note:"white"If you crash ingame your account will be save.\n\n"white"Type the password below to create new account","Register","Exit");
             new INI:File = INI_Open(UserPath(playerid));
             INI_SetTag(File,"data");
             INI_WriteInt(File,"Password",udb_hash(inputtext));
             INI_WriteInt(File,"Cash",REGISTERED_MONEY);
             INI_WriteInt(File,"Score",0);
             INI_WriteInt(File,"Admin",0);
             INI_WriteInt(File,"Banned",0);
             INI_WriteInt(File,"Kills",0);
             INI_WriteInt(File,"Deaths",0);
             INI_Close(File);
             SendClientMessage(playerid, COLOR_GREEN, "You have successfully register!");
             return 1;
         }
    }

    if(dialogid == DIALOG_LOGIN)
    {
        if (!response) return ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT,""white"Login",""red"Note:"white"If this is not your account please leave to this account and create your own one.\n\n"white"Type your password below to login to your account","Login","Exit");
        if(response)
        {
            if(udb_hash(inputtext) == PlayerInfo[playerid][pPass])
            {
                INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
                GivePlayerMoney(playerid, PlayerInfo[playerid][pCash]);
                SetPlayerScore(playerid, PlayerInfo[playerid][pScore]);
                if(PlayerInfo[playerid][pAdmin] == 0)
                {
                   SendClientMessage(playerid, COLOR_GREEN, "You have successfully login to your account");
                }
                else
                {
                   switch(PlayerInfo[playerid][pAdmin])
                   {
                      case 1: AdmRank = "Trial Moderator";
                      case 2: AdmRank = "Moderator";
                      case 3: AdmRank = "Global Moderator";
                      case 4: AdmRank = "Trial Manager";
                      case 5: AdmRank = "Header Administrator";
                      case 6: AdmRank = "Senior Administrator";
                      case 7: AdmRank = "Junior Administrator";
                      case 8: AdmRank = "Scripter/Mapper";
                      case 9: AdmRank = "Co-Owner";
                   }
                   if(PlayerInfo[playerid][pAdmin] >= 10)
                   {
                      AdmRank = "Server Owner";
                   }
                   new string[128];
                   new PlayerName[MAX_PLAYER_NAME];
                   GetPlayerName(playerid, PlayerName, MAX_PLAYER_NAME);
                   format(string,sizeof(string),"You have been automaticlly login | - Level %d - %s - |",PlayerInfo[playerid][pAdmin],AdmRank);
                   SendClientMessage(playerid,COLOR_GREEN,string);
                }
            }
            else
            {
              ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT,""white"Login",""red"You have entered an incorrect password.\n"white"Type your password below to login.","Login","Exit");
            }
            return 1;
        }
    }

    if(dialogid == RULEDIALOG)
    {
      if(response == 1)
      {
        if(GetPVarInt(playerid,"RulesAccepted")!=1)
        {
            SetPVarInt(playerid,"RulesAccepted",1);
        }
        else
        {
            SendClientMessage(playerid, COLOR_RED, "You Already Accepted The Rules");
        }
      }
      else
      {
        new name[MAX_PLAYER_NAME], string[128];
        GetPlayerName(playerid, name, sizeof(name));
        format(string, sizeof(string), "ANTIRULES: %s has been kicked, Reason: Ignoring Rules",name);
        SendClientMessageToAll(COLOR_RED,string);
        SendClientMessage(playerid, COLOR_RED, "You Ignore The Rules");
        SendClientMessage(playerid, COLOR_RED, "You Have Been Kicked!, Reason : Ignoring The Rules");
        Kick(playerid);
      }
    }
    return 1;
}

//==========================COMMANDS==========================//

CMD:freeze(playerid, params[])
{
    new victimname[MAX_PLAYER_NAME], adminname[MAX_PLAYER_NAME], reason[128], id;
    if (PlayerInfo[playerid][pAdmin] >= 2)
    {
        if (sscanf(params, "rs", id, reason)) return SendClientMessage(playerid, COLOR_RED, "USAGE: /freeze <playerid/name> <reason>");
        if(IsPlayerConnected(id) && id != INVALID_PLAYER_ID && id != playerid)
        {
           GetPlayerName(id, victimname, sizeof(victimname));
           GetPlayerName(playerid, adminname, sizeof(adminname));
           new str[128];
           if(PlayerInfo[id][pFreeze] == 0)
           {
              format(str,128,"Administrator %s has frozen %s <Reason: %s>",adminname,victimname,reason);
              SendClientMessageToAll(COLOR_RED,str);
              format(str, sizeof(str), "Administrator %s has freeze you <Reason: %s>",adminname,reason);
              SendClientMessage(id,COLOR_GREEN,str);
              format(str, sizeof(str), "You freeze %s <Reason: %s>",victimname,reason);
              SendClientMessage(id,COLOR_GREEN,str);
              TogglePlayerControllable(id,0);
              format(str, sizeof(str), "Administrator %s has freeze %s",adminname,victimname);
              SendToAdmins(COLOR_GREY,str);
              format(str, sizeof(str), "Administrator %s has freeze %s",adminname,victimname);
              printf(str);
              PlayerInfo[id][pFreeze] = 1;
           }
           else return SendClientMessage(playerid,COLOR_RED, "ERROR: Player is Already Freeze");
        }
        else return SendClientMessage(playerid, COLOR_RED, "ERROR: Player is not connected or its yourself.");
    }
    else return SendClientMessage(playerid,COLOR_RED,"ERROR: You must be Administrator Level 2 to use this command");
    return 1;
}

CMD:unfreeze(playerid, params[])
{
    new victimname[MAX_PLAYER_NAME], adminname[MAX_PLAYER_NAME], id;
    if (PlayerInfo[playerid][pAdmin] >= 2)
    {
        if (sscanf(params, "rs", id)) return SendClientMessage(playerid, COLOR_RED, "USAGE: /unfreeze <playerid/name>");
        if(IsPlayerConnected(id) && id != INVALID_PLAYER_ID)
        {
           GetPlayerName(id, victimname, sizeof(victimname));
           GetPlayerName(playerid, adminname, sizeof(adminname));
           new str[128];
           if(PlayerInfo[id][pFreeze] == 1)
           {
              format(str,128,"Administrator %s has unfreeze %s",adminname,victimname);
              SendClientMessageToAll(COLOR_RED,str);
              format(str, sizeof(str), "Administrator %s has unfreeze you",adminname);
              SendClientMessage(id,COLOR_GREEN,str);
              format(str, sizeof(str), "You unfreeze %s",victimname);
              SendClientMessage(id,COLOR_GREEN,str);
              TogglePlayerControllable(id,1);
              format(str, sizeof(str), "Administrator %s has unfreeze %s",adminname,victimname);
              SendToAdmins(COLOR_GREY,str);
              format(str, sizeof(str), "Administrator %s has unfreeze %s",adminname,victimname);
              printf(str);
              PlayerInfo[id][pFreeze] = 0;
           }
           else return SendClientMessage(playerid,COLOR_RED, "ERROR: Player is not Frozen");
        }
        else return SendClientMessage(playerid, COLOR_RED, "ERROR: Player is not connected!");
    }
    else return SendClientMessage(playerid,COLOR_RED,"ERROR: You must be Administrator Level 2 to use this command");
    return 1;
}

CMD:god(playerid, params[])
{
    if(PlayerInfo[playerid][pAdmin] >= 1)
    {
      if(PlayerInfo[playerid][pGod] == 0)
      {
         PlayerInfo[playerid][pGod] = 1;
         SetPlayerHealth(playerid,100000);
         SetPlayerArmour(playerid,100000);
         GivePlayerWeapon(playerid,16,50000);
         GivePlayerWeapon(playerid,8,1);
         GivePlayerWeapon(playerid,28,50000);
         GivePlayerWeapon(playerid,34,50000);
         GivePlayerWeapon(playerid,22,50000);
         PlayerPlaySound(playerid,1085,0.0,0.0,0.0);
         SendClientMessage(playerid,COLOR_GREEN,"| - God Mode On - |");
      }
      else
      {
         PlayerInfo[playerid][pGod] = 0;
         SendClientMessage(playerid,COLOR_RED,"| - God Mode Off - |");
         SetPlayerHealth(playerid, 100.0);
         SetPlayerArmour(playerid, 100.0);
         ResetPlayerWeapons(playerid);
         PlayerPlaySound(playerid,1085,0.0,0.0,0.0);
         SpawnPlayer(playerid);
      }
    }
    else return SendClientMessage(playerid,COLOR_RED,"ERROR: You must be Administrator Level 1 to use this command");
    return 1;
}

CMD:adminduty(playerid, params[])
{
    new string[128],skin,adminname[MAX_PLAYER_NAME];
    GetPlayerName(playerid, adminname, sizeof(adminname));
    if(PlayerInfo[playerid][pAdmin] >= 1 || IsPlayerAdmin(playerid))
    {
        if(adminduty[playerid] == 0)
        {
            if(sscanf(params,"i",skin)) return SendClientMessage(playerid,COLOR_RED,"USAGE: /adminduty <skin>");
            if(skin < 0 || skin > 299) return SendClientMessage(playerid,COLOR_RED,"ERROR: Invalid Skin Id (0-299)");
            format(string,sizeof(string),""yellow"Administrator %s is on "green"Admin Duty!",adminname);
            SendClientMessageToAll(COLOR_RED,string);
            SendClientMessage(playerid,COLOR_GREEN,"| - Your Now on Admin Duty - |");
            SetPVarInt(playerid, "skin", GetPlayerSkin(playerid));
            SetPVarInt(playerid, "color", GetPlayerColor(playerid));
            SetPlayerColor(playerid,COLOR_RED);
            SetPlayerSkin(playerid,skin);
            SetPlayerHealth(playerid,999999.999);
            SetPlayerArmour(playerid,999999.999);
            GivePlayerWeapon(playerid,16,50000);
            GivePlayerWeapon(playerid,8,1);
            GivePlayerWeapon(playerid,28,50000);
            GivePlayerWeapon(playerid,34,50000);
            GivePlayerWeapon(playerid,22,50000);
            format(string,sizeof(string),"Administrator %s is on Admin Duty!",adminname);
            SendToAdmins(COLOR_GREY,string);
            format(string,sizeof(string),"Administrator %s is on Admin Duty!",adminname);
            printf(string);
            adminduty[playerid] = 1;
        }
        else
        {
            format(string,sizeof(string),""yellow"Administrator %s is now off "red"Duty!",adminname);
            SendClientMessageToAll(COLOR_RED,string);
            SetPlayerSkin(playerid, GetPVarInt(playerid,"skin"));
            SetPlayerColor(playerid, GetPVarInt(playerid,"color"));
            SendClientMessage(playerid,COLOR_RED,"| - Your Now off Duty - |");
            SetPlayerHealth(playerid,100);
            SetPlayerArmour(playerid,100);
            SpawnPlayer(playerid);
            format(string,sizeof(string),"Administrator %s is now off Duty!",adminname);
            SendToAdmins(COLOR_GREY,string);
            format(string,sizeof(string),"Administrator %s is now off Duty!",adminname);
            printf(string);
            adminduty[playerid] = 0;
        }
    } else return SendClientMessage(playerid,COLOR_RED,"ERROR: You must be Administrator Level 1 to use this command");
    return 1;
}

CMD:announce(playerid, params[])
{
    if(PlayerInfo[playerid][pAdmin] >= 1)
    {
       if(isnull(params)) return SendClientMessage(playerid,COLOR_RED, "USAGE: /announce <Text>");
       GameTextForAll(params,4000,3);
    }
    else return SendClientMessage(playerid,COLOR_RED,"ERROR: You must be Administrator Level 1 to use this command");
    return 1;
}

CMD:ann(playerid, params[])
{
    if(PlayerInfo[playerid][pAdmin] >= 1)
    {
       if(isnull(params)) return SendClientMessage(playerid,COLOR_RED, "USAGE: /announce <Text>");
       GameTextForAll(params,4000,3);
    }
    else return SendClientMessage(playerid,COLOR_RED,"ERROR: You must be Administrator Level 1 to use this command");
    return 1;
}

CMD:akill(playerid, params[])
{
    new victimname[MAX_PLAYER_NAME], adminname[MAX_PLAYER_NAME], reason[128], id;
    GetPlayerName(id, victimname, sizeof(victimname));
    GetPlayerName(playerid, adminname, sizeof(adminname));
    new str[128];
    if(PlayerInfo[playerid][pAdmin] >= 1)
    {
        if(sscanf(params, "rs", id, reason)) return SendClientMessage(playerid, COLOR_RED, "USAGE: /akill <playerid/name> <reason>");
        if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid,COLOR_RED, "ERROR: Player is not connected!");
        if(id == playerid) return SendClientMessage(playerid,COLOR_RED, "ERROR: You cant akill yourself!");
        format(str,sizeof(str),"ADMKILL: Administrator %s has kill %s <Reason: %s>",adminname,victimname,reason);
        SendClientMessageToAll(COLOR_RED,str);
        format(str, sizeof(str), "ADMKILL: Administrator %s has killed you <Reason: %s>",adminname,reason);
        SendClientMessage(id,COLOR_RED,str);
        format(str, sizeof(str), "You kill %s <Reason: %s>",victimname,reason);
        SendClientMessage(id,COLOR_RED,str);
        SetPlayerHealth(id,0.0);
    }
    else return SendClientMessage(playerid,COLOR_RED,"ERROR: You must be Administrator Level 2 to use this command");
    return 1;
}

CMD:healall(playerid,params[])
{
    if(PlayerInfo[playerid][pAdmin] >= 6)
    {
      new str[128], name[MAX_PLAYER_NAME];
      GetPlayerName(playerid,name,sizeof(name));
      format(str,sizeof(str),"Administrator %s has healed all players!",name);
      SendClientMessageToAll(COLOR_GREEN,str);
      for(new i=0; i<MAX_PLAYERS; i++)
      {
          if(IsPlayerConnected(i))
          {
              SetPlayerHealth(i,100);
          }
      }
    }
    else return SendClientMessage(playerid,COLOR_RED,"ERROR: You must be Administrator Level 6 to use this command");
    return 1;
}

CMD:armourall(playerid,params[])
{
    if(PlayerInfo[playerid][pAdmin] >= 6)
    {
      new str[128], name[MAX_PLAYER_NAME];
      GetPlayerName(playerid,name,sizeof(name));
      format(str,sizeof(str),"Administrator %s has restored all players armour!",name);
      SendClientMessageToAll(COLOR_GREEN,str);
      for(new i=0; i<MAX_PLAYERS; i++)
      {
          if (IsPlayerConnected(i))
          {
              SetPlayerArmour(i,100);
          }
      }
    }
    else return SendClientMessage(playerid,COLOR_RED,"ERROR: You must be Administrator Level 6 to use this command");
    return 1;
}

CMD:setscore(playerid, params[])
{
    new string[128], pName[MAX_PLAYER_NAME], adminname[MAX_PLAYER_NAME], pID, score;
    if(PlayerInfo[playerid][pAdmin] >= 9)
    {
        if(sscanf(params, "ud", pID, score)) return SendClientMessage(playerid,COLOR_RED, "USAGE: /setscore <playerid/name> <amount>");
        if(IsPlayerConnected(pID) && pID != INVALID_PLAYER_ID)
        {
           if(score == 1000000000)
           {
             SendClientMessage(playerid,COLOR_RED, "ERROR: Instead of the ammount you put, The System Automaticlly change it to 9782321");
             SendClientMessage(playerid,COLOR_RED, "SYSTEM REASON: "white"Too many ammount!");
             return SetPlayerScore(pID,9782321);
           }
           GetPlayerName(playerid, adminname, sizeof(adminname));
           GetPlayerName(pID, pName, sizeof(pName));
           format(string, sizeof(string), "Administrator %s has set %s's score to %d", adminname,pName,score);
           SendClientMessageToAll(COLOR_GREEN, string);
           format(string, sizeof(string), "Administrator %s has set your score to %d", adminname, score);
           SendClientMessage(pID,COLOR_GREEN, string);
           format(string, sizeof(string), "You set %s's score to %d score",pName,score);
           SendClientMessage(playerid,COLOR_GREEN, string);
           SetPlayerScore(pID, score);
           format(string, sizeof(string), "Administrator %s has set %s's Score to %d",adminname,pName,score);
           SendToAdmins(COLOR_GREY,string);
           format(string, sizeof(string), "Administrator %s has set %s's Score to %d",adminname,pName,score);
           printf(string);
        }
        else return SendClientMessage(playerid,COLOR_RED, "ERROR: Player is not connected!");
    }
    else return SendClientMessage(playerid,COLOR_RED, "ERROR:You must be Administrator Level 4 to use this command");
    return 1;
}

CMD:goto(playerid, params[])
{
    if(PlayerInfo[playerid][pAdmin] >= 2)
    {
      new string[128],ID,adminname[MAX_PLAYER_NAME],pname[MAX_PLAYER_NAME];
      GetPlayerName(playerid,adminname,MAX_PLAYER_NAME);
      GetPlayerName(ID,pname,MAX_PLAYER_NAME);
      if(sscanf(params, "u", ID)) return SendClientMessage(playerid, COLOR_RED, "USAGE: /goto <playername/id>");
      if(IsPlayerConnected(ID) && ID != INVALID_PLAYER_ID && ID != playerid)
      {
         new Float:x, Float:y, Float:z;
         new vehicleid = GetPlayerVehicleID(playerid);
         GetPlayerPos(ID, x, y, z);
         SetPlayerPos(playerid, x+1, y+1, z);
         format(string, sizeof(string), "You teleported to %s",pname);
         SendClientMessage(playerid,COLOR_BLUE,string);
         format(string, sizeof(string), "Administrator %s has been teleport to you",adminname);
         SendClientMessage(ID,COLOR_GREEN,string);
         if(IsPlayerInVehicle(playerid,vehicleid))
         {
           SetVehiclePos(GetPlayerVehicleID(playerid),x+3,y,z);
           LinkVehicleToInterior(GetPlayerVehicleID(playerid),GetPlayerInterior(ID));
           SetVehicleVirtualWorld(GetPlayerVehicleID(playerid),GetPlayerVirtualWorld(ID));
         }
      }
      else return SendClientMessage(playerid, COLOR_RED, "ERROR: Player is not connected or its yourself.");
    }
    else return SendClientMessage(playerid,COLOR_RED, "ERROR: You must be Administrator Level 2 to use this command");
    return 1;
}

CMD:showadmlvl(playerid, params[])
{
    if(PlayerInfo[playerid][pAdmin] >= 1)
    {
        new string[128],AdminName[24],Level;
        Level = PlayerInfo[playerid][pAdmin];
        GetPlayerName(playerid,AdminName,128);
        format(string, sizeof(string), ""white"<LEVEL>:"yellow" Administrator "red"%s "yellow"| Level %d - %s |",AdminName,Level,AdmRank);
        SendClientMessageToAll(COLOR_RED,string);
    }
    else return SendClientMessage(playerid,COLOR_RED, "ERROR: You must be Administrator Level 1 to use this command");
    return 1;
}

CMD:get(playerid, params[])
{
    if(PlayerInfo[playerid][pAdmin] >= 2)
    {
       new targetid, string[128];
       if(sscanf(params, "u", targetid)) return SendClientMessage(playerid, COLOR_RED, "USAGE: /get <playerid/name>");
       if(IsPlayerConnected(targetid) && targetid != INVALID_PLAYER_ID && targetid != playerid)
       {
           new AdminName[24];
           new pName[24];
           GetPlayerName(playerid,AdminName,128);
           GetPlayerName(targetid,pName,128);
           format(string, sizeof(string), "You have been teleported to Administrator %s",AdminName);
           SendClientMessage(targetid,COLOR_BLUE,string);
           format(string, sizeof(string), "%s has been teleport to you",pName);
           SendClientMessage(playerid,COLOR_GREEN,string);
           SetPlayerInterior(targetid,GetPlayerInterior(playerid));
           new Float:TPX, Float:TPY, Float:TPZ;
           GetPlayerPos(playerid, TPX, TPY, TPZ);
           SetPlayerPos(targetid, TPX, TPY, TPZ+1);
       }
       else return SendClientMessage(playerid, COLOR_RED, "ERROR: Player is not connected or its yourself.");
    }
    else return SendClientMessage(playerid,COLOR_RED, "ERROR: You must be Administrator Level 2 to use this command");
    return 1;
}

CMD:report(playerid,params[])
{
    new string[128],id,reason[128];
    new reportername[MAX_PLAYER_NAME],hackername[MAX_PLAYER_NAME];
    GetPlayerName(playerid,reportername,sizeof(string));
    GetPlayerName(id,hackername,sizeof(string));
    if(sscanf(params,"us",id,reason)) return SendClientMessage(playerid,COLOR_RED,"ERROR: /report <Playername/id> <Reason>");
    else if(!IsPlayerConnected(id)) return SendClientMessage(playerid, COLOR_RED, "ERROR: Player is not connected!");
    format(string,sizeof(string),"REPORT: %s has reported %s <Reason: %s>",reportername,hackername,reason);
    MessageToAdmins(COLOR_YELLOW,string);
    return 1;
}

CMD:warn(playerid, params[])
{
    new id,reason[128];
    if(PlayerInfo[playerid][pAdmin] >= 2 || IsPlayerAdmin(playerid))
    {
        if(sscanf(params, "us[128]",id, reason)) return SendClientMessage(playerid,COLOR_RED, "USAGE: /warn <playerid/name> <reason>");
        if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid,COLOR_RED, "ERROR: Player is not connected!");
        if(id == playerid) return SendClientMessage(playerid,COLOR_RED, "ERROR: You cant warn yourself!");
        new adminname[MAX_PLAYER_NAME], victimname[MAX_PLAYER_NAME], string[180];
        GetPlayerName(id, victimname, sizeof(victimname));
        GetPlayerName(playerid, adminname, sizeof(adminname));
        PlayerInfo[id][pWarn]++;
        if(PlayerInfo[id][pWarn] <= PlayerInfo[id][pWarn])
        {
           format(string, sizeof(string), ""red"WARNING:"white"You have recieve some message!\n\n"red"Administrator %s has warn you\nReason:%s\nWarnings:%d/%d",adminname,reason,PlayerInfo[id][pWarn],MAX_WARNINGS);
           ShowPlayerDialog(id,WARNDIALOG, DIALOG_STYLE_MSGBOX,""red"Warning Message!:",string,"Ok","");
        }
        if(PlayerInfo[id][pWarn] == MAX_WARNINGS)
        {
           format(string, sizeof(string), "Administrator %s has warn %s <Reason: %s> <Warnings %d/%d>",adminname,victimname,reason,PlayerInfo[id][pWarn],MAX_WARNINGS);
           SendClientMessageToAll(COLOR_RED, string);
           format(string, sizeof(string), "%s has been Kicked! <Reason: Over Reach Warnings!> <Warnings %d/%d>",victimname,PlayerInfo[id][pWarn],MAX_WARNINGS);
           SendClientMessageToAll(COLOR_RED, string);
           format(string, sizeof(string), ""red"You have over reach the Maxium Warnings You Have Been Kicked!\n\nAdministrator:%s has warn you\nReason:%s\nWarnings:%d/%d",adminname,reason,PlayerInfo[id][pWarn],MAX_WARNINGS);
           ShowPlayerDialog(id,456, DIALOG_STYLE_MSGBOX,""red"Over Reach! (KICKED!):",string,"Ok","");
           Kick(id);
        }
        format(string, sizeof(string), "Administrator %s has warn %s <Reason: %s> <Warnings %d/%d>",adminname,victimname,reason,PlayerInfo[id][pWarn],MAX_WARNINGS);
        SendClientMessageToAll(COLOR_RED, string);
        format(string, sizeof(string), "Administrator %s has warn %s <Reason: %s> <Warnings %d/%d>",adminname,victimname,reason,PlayerInfo[id][pWarn],MAX_WARNINGS);
        SendToAdmins(COLOR_GREY, string);
        format(string, sizeof(string), "Administrator %s has warn %s <Reason: %s> <Warnings %d/%d>",adminname,victimname,reason,PlayerInfo[id][pWarn],MAX_WARNINGS);
        printf(string);
    }
    else return SendClientMessage(playerid,COLOR_RED, "ERROR: You must be Administrator Level 2 to use this command");
    return 1;
}

CMD:clearwarn(playerid, params[])
{
    new id;
    if(PlayerInfo[playerid][pAdmin] >= 2 || IsPlayerAdmin(playerid))
    {
        if(sscanf(params, "u",id)) return SendClientMessage(playerid,COLOR_RED, "USAGE: /clearwarn <playerid/name>");
        if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid,COLOR_RED, "ERROR: Player is not connected!");
        new adminname[MAX_PLAYER_NAME], victimname[MAX_PLAYER_NAME], string[180];
        GetPlayerName(id, victimname, sizeof(victimname));
        GetPlayerName(playerid, adminname, sizeof(adminname));
        if(PlayerInfo[id][pWarn] == 0)
        {
            SendClientMessage(playerid,COLOR_RED, "ERROR: This Player is already clear warned!");
            return 1;
        }
        PlayerInfo[id][pWarn]=0;
        if(PlayerInfo[id][pWarn] >= PlayerInfo[id][pWarn])
        {
           format(string, sizeof(string), ""white"You have recieve some message!\n\n"green"Administrator %s has clear your warn\nWarnings:%d/%d\n\n"white"Congratz!:"green"Your Warnings has been remove!",adminname,PlayerInfo[id][pWarn],MAX_WARNINGS);
           ShowPlayerDialog(id,WARNDIALOG, DIALOG_STYLE_MSGBOX,""red"Warning Message!:",string,"Ok","");
        }
        format(string, sizeof(string), "Administrator %s has clear the warn of %s <Warnings %d/%d>",adminname,victimname,PlayerInfo[id][pWarn],MAX_WARNINGS);
        SendClientMessageToAll(COLOR_GREEN, string);
        format(string, sizeof(string), "Administrator %s has clear the warn of %s <Warnings %d/%d>",adminname,victimname,PlayerInfo[id][pWarn],MAX_WARNINGS);
        SendToAdmins(COLOR_GREY, string);
        format(string, sizeof(string), "Administrator %s has clear the warn of %s <Warnings %d/%d>",adminname,victimname,PlayerInfo[id][pWarn],MAX_WARNINGS);
        printf(string);
    }
    else return SendClientMessage(playerid,COLOR_RED, "ERROR: You must be Administrator Level 2 to use this command");
    return 1;
}

CMD:kick(playerid, params[])
{
    new pid;
    if(PlayerInfo[playerid][pAdmin] >= 2 || IsPlayerAdmin(playerid))
    {
        if(sscanf(params, "us[128]", pid, params[2])) return SendClientMessage(playerid,COLOR_RED, "USAGE: /kick <playerid/name> <reason>");
        if(pid == INVALID_PLAYER_ID) return SendClientMessage(playerid,COLOR_RED, "ERROR: Player is not connected!");
        if(pid == playerid) return SendClientMessage(playerid,COLOR_RED, "ERROR: You cant kick yourself!");
        new adminname[MAX_PLAYER_NAME], paramname[MAX_PLAYER_NAME], string[180];
        GetPlayerName(pid, paramname, sizeof(paramname));
        GetPlayerName(playerid, adminname, sizeof(adminname));
        format(string, sizeof(string), "Administrator %s has kicked %s <Reason: %s>",adminname,paramname, params[2]);
        SendClientMessageToAll(COLOR_RED, string);
        SaveIn("KickLog",string);
        format(string, sizeof(string), "You have been kicked by Administrator %s <Reason: %s>", paramname, params[2]);
        SendClientMessage(pid,COLOR_RED, string);
        format(string, sizeof(string), "You kicked %s <Reason: %s>", paramname, params[2]);
        SendClientMessage(playerid,COLOR_GREEN, string);
        Kick(pid);
        format(string,sizeof(string),"Administrator %s has kicked %s",adminname,paramname);
        SendToAdmins(COLOR_GREY,string);
        format(string, sizeof(string), "Administrator %s has kicked %s <Reason:%s>",adminname,paramname,params[2]);
        printf(string);
    }
    else return SendClientMessage(playerid,COLOR_RED, "ERROR: You must be Administrator Level 2 to use this command");
    return 1;
}

CMD:gmx(playerid, params[])
{
    if(PlayerInfo[playerid][pAdmin] >= 9 || !IsPlayerAdmin(playerid))
    {
       new adminname[MAX_PLAYER_NAME],string[180];
       GetPlayerName(playerid, adminname, sizeof(adminname));
       if(Count == 0)
       {
          SetTimer("Counting",1000,false);
          SendClientMessage(playerid,COLOR_RED, "Server Restart Activate!");
          SendClientMessage(playerid,COLOR_GREEN, "Server Restart Launch Start!");
          format(string,sizeof(string),"Administrator %s has start a countdown for the server restart!",adminname);
          SendClientMessageToAll(COLOR_RED,string);
          GameTextForAll("~r~Server Restart Countdown Launched!",3000,3);
          format(string,sizeof(string),"Administrator %s has restart the server!",adminname);
          SendToAdmins(COLOR_GREY,string);
       }else{
       SendClientMessage(playerid,COLOR_RED,"Server Restart is Already Launching!");
       }
    }
    else return SendClientMessage(playerid,COLOR_RED, "ERROR: You must be Administrator Level 9/10/RCON Leader to use this command");
    return 1;
}

CMD:jetpack(playerid, params[])
{
    if(PlayerInfo[playerid][pAdmin] > 1 || !IsPlayerAdmin(playerid))
    {
       new adminname[MAX_PLAYER_NAME],string[180];
       GetPlayerName(playerid, adminname, sizeof(adminname));
       SetPlayerSpecialAction(playerid, 2);
       SendClientMessage(playerid,COLOR_GREEN, "|- Jetpack Spawned! -|");
       format(string,sizeof(string),"Administrator %s has spawned a jetpack!",adminname);
       SendToAdmins(COLOR_GREY,string);
    }
    else return SendClientMessage(playerid,COLOR_RED, "ERROR: You must be Administrator Level 1 to use this command");
    return 1;
}

CMD:ban(playerid, params[])
{
    new pid;
    new ip[128];
    if(PlayerInfo[playerid][pAdmin] >= 3 || IsPlayerAdmin(playerid))
    {
        if(sscanf(params, "us[128]", pid, params[2])) return SendClientMessage(playerid,COLOR_RED, "USAGE: /ban <playerid/name> <reason>");
        if(pid == INVALID_PLAYER_ID) return SendClientMessage(playerid,COLOR_RED, "ERROR: Player is not connected!");
        if(pid == playerid) return SendClientMessage(playerid,COLOR_RED, "ERROR: You cant ban yourself!");
        new adminname[MAX_PLAYER_NAME], paramname[MAX_PLAYER_NAME], string[180];
        new year,month,day; getdate(year, month, day);
        new hour,minute,second; gettime(hour,minute,second);
        GetPlayerName(pid, paramname, sizeof(paramname));
        GetPlayerName(playerid, adminname, sizeof(adminname));
        format(string, sizeof(string), "Administrator %s has ban %s <Reason: %s> <Date: %d/%d/%d> <Time: %d:%d>",adminname,paramname, params[2],month,day,year,hour,minute);
        SendClientMessageToAll(COLOR_RED, string);
        SaveIn("BanLog",string);
        format(string, sizeof(string), "You have been ban by Administrator %s <Reason: %s>", paramname, params[2]);
        SendClientMessage(pid,COLOR_RED, string);
        format(string, sizeof(string), ""red"Administrator Bans You: %s\nTime: %d:%d\nDate: %d/%d/%d\nReason: %n\nNote:"white"If you are mistakely get banned go to our forums at [url]www.server.com\nand[/url] make unban appeal", adminname, params[2],hour,minute,month,day,year,params[2]);
        ShowPlayerDialog(pid,453, DIALOG_STYLE_MSGBOX,""white"Banned Info:",string,"Ok","");
        SendClientMessage(pid,COLOR_WHITE, "==============================================");
        format(string, sizeof(string), "You have been ban by Administrator %s <Reason: %s>", paramname, params[2]);
        SendClientMessage(pid,COLOR_RED, string);
        SendClientMessage(pid,COLOR_RED, "Make unban appeal at our forums. www.server.com");
        SendClientMessage(pid,COLOR_WHITE, "==============================================");
        format(string, sizeof(string), "You ban %s <Reason: %s>", paramname, params[2]);
        SendClientMessage(playerid,COLOR_RED, string);
        Ban(pid);
        format(ip,128,"%s**",ip);
        format(ip,128,"banip %s",params[2]);
        SendRconCommand(ip);
        new INI:File = INI_Open(UserPath(playerid));
        PlayerInfo[pid][pBanned] = 1;
        INI_WriteInt(File,"Banned",1);
        INI_Close(File);
        format(string,sizeof(string),"Administrator %s has banned %s",adminname,paramname);
        SendToAdmins(COLOR_GREY,string);
        format(string, sizeof(string), "Administrator %s has banned %s <Reason:%s>",adminname,paramname,params[2]);
        printf(string);
    }
    else return SendClientMessage(playerid,COLOR_RED, "ERROR: You must be Administrator Level 3 to use this command");
    return 1;
}

CMD:stats(playerid,params[])
{
    new string[128];
    new name[MAX_PLAYER_NAME];
    new deaths = PlayerInfo[playerid][pDeaths];
    new kills = PlayerInfo[playerid][pKills];
    new admin = PlayerInfo[playerid][pAdmin];
    new money = PlayerInfo[playerid][pCash];
    new score = PlayerInfo[playerid][pScore];
    new stats[1024];
    GetPlayerName(playerid, name, sizeof(string));
    format(string, sizeof(string), "Name:%s\nScore:%d\nMoney:%d\nAdmin Level:%d\nKills:%d\nDeaths:%d",name,score,money,admin,kills,deaths);
    format(stats, sizeof(stats), "%s", string);
    ShowPlayerDialog(playerid,454, DIALOG_STYLE_MSGBOX,""white"Stats:",stats,"Ok","");
    return 1;
}

CMD:clearchat(playerid,params[])
{
    if(PlayerInfo[playerid][pAdmin] >= 2)
    {
       for(new i = 0; i < 100; i++)
       SendClientMessageToAll(COLOR_GREY,"");
       new string[128];
       new adminname[MAX_PLAYER_NAME];
       GetPlayerName(playerid, adminname, sizeof(string));
       format(string, sizeof(string), "Administrator %s has cleared the chat", adminname);
       SendClientMessageToAll(COLOR_RED, string);
       format(string, sizeof(string), "Administrator %s has cleared the chat",adminname);
       printf(string);
    }
    else return SendClientMessage(playerid,COLOR_RED,"ERROR: You must be Administrator Level 2 to use this command");
    return 1;
}

CMD:kill(playerid,params[])
{
    SetPlayerHealth(playerid, 0);
    PlayerPlaySound(playerid,1085,0.0,0.0,0.0);
    PlayerInfo[playerid][pDeaths]++;
    return 1;
}

CMD:suicide(playerid,params[])
{
    SetPlayerHealth(playerid, 0);
    PlayerPlaySound(playerid,1085,0.0,0.0,0.0);
    PlayerInfo[playerid][pDeaths]++;
    return 1;
}

CMD:asay(playerid, params[])
{
    new string[128], pname[MAX_PLAYER_NAME];
    if(PlayerInfo[playerid][pAdmin] >= 1)
    {
       if(isnull(params)) return SendClientMessage(playerid,COLOR_RED, "USAGE: /asay <text>");
       GetPlayerName(playerid, pname, MAX_PLAYER_NAME);
       format(string, sizeof(string), "Admin %s: "white"%s", pname, params);
       SendClientMessageToAll(COLOR_RED,string);
    }
    else return SendClientMessage(playerid,COLOR_RED,"ERROR: You must be Administrator Level 1 to use this command");
    return 1;
}

CMD:forcerules(playerid, params[])
{
    new pid;
    if(PlayerInfo[playerid][pAdmin] >= 2)
    {
        if(sscanf(params, "us[128]", pid, params[2])) return SendClientMessage(playerid,COLOR_RED, "USAGE: /forcerules <playerid/name> <reason>");
        if(IsPlayerConnected(pid) && pid != INVALID_PLAYER_ID && pid != playerid)
        {
           new adminname[MAX_PLAYER_NAME], paramname[MAX_PLAYER_NAME], string[180];
           GetPlayerName(pid, paramname, sizeof(paramname));
           GetPlayerName(playerid, adminname, sizeof(adminname));
           format(string, sizeof(string), "Administrator %s has force to read rules %s <Reason: %s> <Warning %d/%d>",adminname,paramname, params[2],PlayerInfo[pid][pWarn],MAX_WARNINGS);
           SendClientMessageToAll(COLOR_RED, string);
           format(string, sizeof(string), "You have been force to read rules by Administrator %s <Reason: %s> <Warning: %d/%d>", paramname, params[2],PlayerInfo[pid][pWarn],MAX_WARNINGS);
           SendClientMessage(pid,COLOR_RED, string);
           format(string, sizeof(string), "You force to read rules %s <Reason: %s>", paramname, params[2]);
           SendClientMessage(playerid,COLOR_GREEN, string);
           PlayerInfo[pid][pWarn]++;
           if(PlayerInfo[pid][pWarn] <= PlayerInfo[pid][pWarn])
           {
              format(string, sizeof(string), ""red"WARNING:"white"You have recieve some message!\n\n"red"Administrator %s has warn you\nReason:%s\nWarnings:%d/%d",adminname,params[2],PlayerInfo[pid][pWarn],MAX_WARNINGS);
              ShowPlayerDialog(pid,WARNDIALOG, DIALOG_STYLE_MSGBOX,""red"Warning Message!:",string,"Ok","");
           }
           if(PlayerInfo[pid][pWarn] == MAX_WARNINGS)
           {
              format(string, sizeof(string), "%s has been Kicked! <Reason: Over Reach Warnings!> <Warnings %d/%d>",paramname,PlayerInfo[pid][pWarn],MAX_WARNINGS);
              SendClientMessageToAll(COLOR_RED, string);
              format(string, sizeof(string), ""red"You have over reach the Maxium Warnings You Have Been Kicked!\n\nAdministrator:%s has warn you\nReason:%s\nWarnings:%d/%d",adminname,params[2],PlayerInfo[pid][pWarn],MAX_WARNINGS);
              ShowPlayerDialog(pid,456, DIALOG_STYLE_MSGBOX,""red"Over Reach! (KICKED!):",string,"Ok","");
              Kick(pid);
           }
           ShowPlayerDialog(pid,RULEDIALOG, DIALOG_STYLE_MSGBOX, "Rules:", "1.)Do Not Hack/Cheat/Mods\n2.)Respect Admins/Players\n3.)Ask To Be Admin if we are Hiring\n4.)No Insulting/Flamming\n5.)Dont AFK on Spawn Areas\n6.)Dont Team Carjack\n7.)Dont Team Kill\n\nIf you break those rules you may Punishment by Our Server Administrators", "Accept", "Ignore");
           format(string,sizeof(string),"Administrator %s has force to read rules %s",adminname,paramname);
           SendToAdmins(COLOR_GREY,string);
        }
        else return SendClientMessage(playerid,COLOR_RED, "ERROR: Player is not connected or its yourself.");
    }
    else return SendClientMessage(playerid,COLOR_RED, "ERROR: You must be Administrator Level 2 to use this command");
    return 1;
}

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

stock MessageToOwners(COLOR,message[])
{
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
       if(PlayerInfo[i][pAdmin] > 10 || IsPlayerAdmin(i))
       SendClientMessage(i,COLOR,message);
    }
    return 1;
}

stock MessageToAdmins(COLOR,message[])
{
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
       if(PlayerInfo[i][pAdmin] > 1 || IsPlayerAdmin(i))
       SendClientMessage(i,COLOR,message);
    }
    return 1;
}

stock SendToAdmins(COLOR,message[])
{
    for( new i = 0; i < MAX_PLAYERS; i++ )
    {
       if(PlayerInfo[i][pAdmin] > 1) return 0;
       SendClientMessage(i,COLOR,message);
    }
    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;
}

PM Code:

pawn Code:
CMD:pm(playerid, params[])
{
    new str[256], str2[256], id, Name1[MAX_PLAYER_NAME], Name2[MAX_PLAYER_NAME];
    if(sscanf(params, "us", id, str2)) return SendClientMessage(playerid,COLOR_RED, "USAGE: /pm <playerid/name> <text>");
    if(!IsPlayerConnected(id)) return SendClientMessage(playerid,COLOR_RED, "ERROR: Player is not connected");
    if(playerid == id) return SendClientMessage(playerid,COLOR_RED, "ERROR: You cannot pm yourself!");
    {
        GetPlayerName(playerid, Name1, sizeof(Name1));
        GetPlayerName(id, Name2, sizeof(Name2));
        format(str, sizeof(str), "PM To %s(ID %d): %s", Name2, id, str2);
        SendClientMessage(playerid,COLOR_YELLOW, str);
        format(str, sizeof(str), "PM From %s(ID %d): %s", Name1, playerid, str2);
        SendClientMessage(id,COLOR_YELLOW, str);
        PlayerPlaySound(id,1085,0.0,0.0,0.0);
    }
    return 1;
}

I'm crying!
__________________
Ronnie Ronnie Ronnie Ronnie
Not GAMER_PS2
GAMER_PS2 is offline   Reply With Quote
Old 31/10/2011, 01:51 PM   #2
vassilis
High-roller
 
vassilis's Avatar
 
Join Date: Nov 2009
Location: Greece,Athens
Posts: 1,103
Reputation: 142
Default Re: I'm crying with all of bugs on my script!

try to use the Mute(playerid) fuction..
__________________
|
Scripting again Chaos Cops N Robbers for Unlimited Gaming Community | Greek SA-MP Community
Vassilis.
vassilis is offline   Reply With Quote
Old 31/10/2011, 01:54 PM   #3
GAMER_PS2
Huge Clucker
 
GAMER_PS2's Avatar
 
Join Date: Aug 2011
Posts: 345
Reputation: 19
Default Re: I'm crying with all of bugs on my script!

didnt work
__________________
Ronnie Ronnie Ronnie Ronnie
Not GAMER_PS2
GAMER_PS2 is offline   Reply With Quote
Old 31/10/2011, 01:57 PM   #4
SuperViper
High-roller
 
SuperViper's Avatar
 
Join Date: Sep 2011
Posts: 1,217
Reputation: 311
Default Re: I'm crying with all of bugs on my script!

Change

pawn Code:
if(sscanf(params, "us", id, str2)) return SendClientMessage(playerid,COLOR_RED, "USAGE: /pm <playerid/name> <text>");

to

pawn Code:
if(sscanf(params, "ds", id, str2)) return SendClientMessage(playerid,COLOR_RED, "USAGE: /pm <playerid/name> <text>");

if you're using 0.3d.

Change

pawn Code:
if(GetPVarInt(playerid,"mute") == 1)
    {
       SendClientMessage(playerid,COLOR_RED,"ANTICHEAT: You cannot talk your mute!");
    }

to

pawn Code:
if(GetPVarInt(playerid,"mute") == 1)
    {
       SendClientMessage(playerid,COLOR_RED,"ANTICHEAT: You cannot talk your mute!");
       return 0;
    }

Change

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

to

pawn Code:
stock UserPath(playerid)
{
    new playername[MAX_PLAYER_NAME], returnstring;
    GetPlayerName(playerid,playername,sizeof(playername));
    format(returnstring, sizeof(returnstring), "%s%s.ini", PATH, playername);
    return returnstring;
}

Change

pawn Code:
#define PATH "Server/Users/%s.ini"

to

pawn Code:
#define PATH "Server/Users/"

Lastly, make sure the folder server exists in scriptfiles and the folder users exists in server.
SuperViper is offline   Reply With Quote
Old 31/10/2011, 02:08 PM   #5
GAMER_PS2
Huge Clucker
 
GAMER_PS2's Avatar
 
Join Date: Aug 2011
Posts: 345
Reputation: 19
Default Re: I'm crying with all of bugs on my script!

it give me 8 Error On Admin System

pawn Code:
H:\GTA San Andreas\SAMP Server\filterscripts\Admin.pwn(219) : error 035: argument type mismatch (argument 1)
H:\GTA San Andreas\SAMP Server\filterscripts\Admin.pwn(262) : error 035: argument type mismatch (argument 1)
H:\GTA San Andreas\SAMP Server\filterscripts\Admin.pwn(264) : error 035: argument type mismatch (argument 1)
H:\GTA San Andreas\SAMP Server\filterscripts\Admin.pwn(443) : error 035: argument type mismatch (argument 1)
H:\GTA San Andreas\SAMP Server\filterscripts\Admin.pwn(465) : error 035: argument type mismatch (argument 1)
H:\GTA San Andreas\SAMP Server\filterscripts\Admin.pwn(1057) : error 035: argument type mismatch (argument 1)
H:\GTA San Andreas\SAMP Server\filterscripts\Admin.pwn(1212) : error 035: argument type mismatch (argument 1)
H:\GTA San Andreas\SAMP Server\filterscripts\Admin.pwn(1212) : error 035: argument type mismatch (argument 1)
H:\GTA San Andreas\SAMP Server\filterscripts\Admin.pwn(1228) : warning 203: symbol is never used: "accountstimer"
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


8 Errors.
__________________
Ronnie Ronnie Ronnie Ronnie
Not GAMER_PS2
GAMER_PS2 is offline   Reply With Quote
Old 31/10/2011, 02:11 PM   #6
GAMER_PS2
Huge Clucker
 
GAMER_PS2's Avatar
 
Join Date: Aug 2011
Posts: 345
Reputation: 19
Default Re: I'm crying with all of bugs on my script!

Anyway Fix i will call you if the problem is still there
__________________
Ronnie Ronnie Ronnie Ronnie
Not GAMER_PS2
GAMER_PS2 is offline   Reply With Quote
Old 31/10/2011, 02:22 PM   #7
GAMER_PS2
Huge Clucker
 
GAMER_PS2's Avatar
 
Join Date: Aug 2011
Posts: 345
Reputation: 19
Default Re: I'm crying with all of bugs on my script!

it still not saving
__________________
Ronnie Ronnie Ronnie Ronnie
Not GAMER_PS2
GAMER_PS2 is offline   Reply With Quote
Old 31/10/2011, 02:43 PM   #8
Zonoya
Gangsta
 
Zonoya's Avatar
 
Join Date: Jul 2011
Location: Am I in Rio de Janeiro or the Amazon, you tell me?
Posts: 637
Reputation: 17
Default Re: I'm crying with all of bugs on my script!

pawn Code:
#define PATH "/Admin System/Users/%s.ini"
Change that to your PATH
pawn Code:
stock PlayerPath(playerid) {
    new iStr[256],name[MAX_PLAYER_NAME];
    GetPlayerName(playerid,name,sizeof(name));
    format(iStr,sizeof(iStr),PATH,name);
    return iStr;
}
that is the UserPath Function so it will save
__________________
Code:
public OnRconLoginAttempt(ip[], password[], success)
{
    if(!success) //If the password was incorrect
    {
        printf("FAILED RCON LOGIN BY IP %s USING PASSWORD %s",ip, password);
        new pip[16];
        for(new i=0; i<MAX_PLAYERS; i++) //Loop through all players
        {
            GetPlayerIp(i, pip, sizeof(pip));
            if(!strcmp(ip, pip, true)) //If a player's IP is the IP that failed the login
            {
                SendClientMessage(i, 0xFFFFFFFF, "Wrong Password. Bye!"); //Send a message
                Ban(i); //They are now banned.
            }
        }
    }
    return 1;
}
Zonoya is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[0.3c] 2 bugs Mike_Peterson Client Support 13 24/04/2011 04:07 PM
bugs with Raven's Role play script cstatus94 Server Support 5 15/12/2010 08:31 PM
mY map have many bugs ken9926 Help Archive 1 05/09/2010 04:54 AM
2 bugs in admin script help please iStarzz Help Archive 4 25/05/2010 06:12 PM
Crying Animation Gappy Help Archive 7 03/10/2009 10:15 PM


All times are GMT. The time now is 04:18 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.