Not a member of Pastebin yet?
                        Sign Up,
                        it unlocks many cool features!                    
                - //-----
 - // Credits...
 - // iAdmin created by Zezombia (Nov 11 2008)
 - // Jacob - IRC Plugin and Include
 - // Grove/Jay - Players command
 - // ThePro - Crash command help
 - // Xtreme - Jail cords
 - // Andre9977 - Basic help
 - //-----
 - //--CONFIG--[EDIT THIS]-----------------------------
 - #define EchoBot "iAdmin" //your bots name
 - #define EchoServer "irc.gamesurge.net" //irc hoster
 - #define EchoChan "#SA-FE" //server channel
 - #define EchoPort 6667 //this port is used by default
 - #define CmdChar '!' //used for commands, as in !ikick
 - //--CONFIG--END--[NO NEED TO EDIT PAST THIS POINT]--
 - #include <a_samp>
 - #include <a_irc>
 - #pragma unused sztmp
 - #define yellow 0xFFFF00AA
 - #define red 0xFF0000AA
 - #define white 0xFFFFFFFF
 - forward ircOnConnect(conn);
 - forward ircOnUserSay(conn, channel[], user[], message[]);
 - forward ircOnUserPart(conn, channel[], user[]);
 - forward ircOnUserJoin(conn, channel[], user[]);
 - forward EventTimer(); //do not remove
 - forward ircConn();
 - forward ircJoin(conn);
 - new EchoConnection;
 - new wire[MAX_PLAYERS];
 - new jail[MAX_PLAYERS];
 - //connection crap
 - public OnFilterScriptInit()
 - {
 - SetTimer("ircConn", 10000, 0);
 - SetTimer("EventTimer", 500, 1);
 - return 1;
 - }
 - public OnFilterScriptExit()
 - {
 - ircDisconnect(EchoConnection);
 - return 1;
 - }
 - public ircOnConnect(conn)
 - {
 - SetTimerEx("ircJoin", 10000, 0, "i", conn);
 - return 1;
 - }
 - public ircConn()
 - {
 - new string[100];
 - format(string, sizeof(string), "a%d", random(50));
 - EchoConnection = ircConnect(EchoServer, EchoPort, string);
 - return 1;
 - }
 - public ircJoin(conn)
 - {
 - new string[256];
 - ircJoinChan(conn, EchoChan);
 - format(string, sizeof(string), "nick %s", EchoBot);
 - ircSendRawData(conn, string);
 - return 1;
 - }
 - public EventTimer()
 - {
 - ircPollEvents();
 - return 1;
 - }
 - //connection crap end
 - //irc crap
 - public ircOnUserSay(conn, channel[], user[], message[])
 - {
 - new string[256];
 - format(string, sizeof(string), "[IRC]%s: %s", user, message);
 - SendClientMessageToAll(white, string);
 - if(message[0] == CmdChar)
 - {
 - irccmd(ikick, 5, conn, channel, user, message);
 - irccmd(crash, 5, conn, channel, user, message);
 - irccmd(iban, 4, conn, channel, user, message);
 - irccmd(rangeban, 8, conn, channel, user, message);
 - irccmd(wire, 4, conn, channel, user, message);
 - irccmd(unwire, 6, conn, channel, user, message);
 - irccmd(ann, 3, conn, channel, user, message);
 - irccmd(getinfo, 7, conn, channel, user, message);
 - irccmd(jail, 4, conn, channel, user, message);
 - irccmd(unjail, 6, conn, channel, user, message);
 - irccmd(getid, 5, conn, channel, user, message);
 - irccmd(gmx, 3, conn, channel, user, message);
 - irccmd(clearchat, 9, conn, channel, user, message);
 - irccmd(slap, 4, conn, channel, user, message);
 - irccmd(freeze, 6, conn, channel, user, message);
 - irccmd(unfreeze, 8, conn, channel, user, message);
 - irccmd(tele, 4, conn, channel, user, message);
 - irccmd(eject, 5, conn, channel, user, message);
 - irccmd(sethealth, 9, conn, channel, user, message);
 - irccmd(disarm, 6, conn, channel, user, message);
 - irccmd(explode, 7, conn, channel, user, message);
 - irccmd(givemoney, 9, conn, channel, user, message);
 - irccmd(setscore, 8, conn, channel, user, message);
 - irccmd(setname, 7, conn, channel, user, message);
 - irccmd(akill, 5, conn, channel, user, message);
 - irccmd(giveweapon, 10, conn, channel, user, message);
 - irccmd(players, 7, conn, channel, user, message);
 - }
 - return 1;
 - }
 - //end of irc crap
 - //commands
 - irccmd_ikick(conn, channel[], user[], message[])
 - {
 - new tmp[256];
 - tmp = zcmd(1, message);
 - if(ircIsOp(conn, channel, user) == 0) return ircSay(conn, channel, "You are not a channel admin");
 - if(strlen(tmp) == 0) return ircSay(conn, channel, "You did not put in an id");
 - if(IsPlayerConnected(strval(tmp)) == 0) return ircSay(conn, channel, "That player is not connected");
 - new oname[MAX_PLAYER_NAME];
 - GetPlayerName(strval(tmp), oname, sizeof(oname));
 - new string[256];
 - format(string, sizeof(string), "\"%s\" has been kicked from the game by IRC admin \"%s\"", oname, user);
 - SendClientMessageToAll(yellow, string);
 - ircSay(conn, channel, string);
 - Kick(strval(tmp));
 - return 1;
 - }
 - irccmd_crash(conn, channel[], user[], message[])
 - {
 - new tmp[256];
 - tmp = zcmd(1, message);
 - if(ircIsOp(conn, channel, user) == 0) return ircSay(conn, channel, "You are not a channel admin");
 - if(strlen(tmp) == 0) return ircSay(conn, channel, "You did not put in an id");
 - if(IsPlayerConnected(strval(tmp)) == 0) return ircSay(conn, channel, "That player is not connected");
 - new oname[MAX_PLAYER_NAME];
 - GetPlayerName(strval(tmp), oname, sizeof(oname));
 - new string[256];
 - format(string, sizeof(string), "\"%s\" has been crashed from the game by IRC admin \"%s\"", oname, user);
 - SendClientMessageToAll(yellow, string);
 - ircSay(conn, channel, string);
 - new Float:X, Float:Y, Float:Z;
 - GetPlayerPos(strval(tmp), X, Y, Z);
 - new objectcrash = CreatePlayerObject(strval(tmp), 11111111, X, Y, Z, 0, 0, 0); // credits to ThePro
 - DestroyObject(objectcrash);
 - return 1;
 - }
 - irccmd_iban(conn, channel[], user[], message[])
 - {
 - new tmp[256];
 - tmp = zcmd(1, message);
 - if(ircIsOp(conn, channel, user) == 0) return ircSay(conn, channel, "You are not a channel admin");
 - if(strlen(tmp) == 0) return ircSay(conn, channel, "You did not put in an id");
 - if(IsPlayerConnected(strval(tmp)) == 0) return ircSay(conn, channel, "That player is not connected");
 - new oname[MAX_PLAYER_NAME];
 - GetPlayerName(strval(tmp), oname, sizeof(oname));
 - new string[256];
 - format(string, sizeof(string), "\"%s\" has been banned from the game by IRC admin \"%s\"", oname, user);
 - SendClientMessageToAll(yellow, string);
 - ircSay(conn, channel, string);
 - Ban(strval(tmp));
 - return 1;
 - }
 - irccmd_rangeban(conn, channel[], user[], message[])
 - {
 - new tmp[256];
 - tmp = zcmd(1, message);
 - if(ircIsOp(conn, channel, user) == 0) return ircSay(conn, channel, "You are not a channel admin");
 - if(strlen(tmp) == 0) return ircSay(conn, channel, "You did not put in an id");
 - if(IsPlayerConnected(strval(tmp)) == 0) return ircSay(conn, channel, "That player is not connected");
 - new oname[MAX_PLAYER_NAME];
 - GetPlayerName(strval(tmp), oname, sizeof(oname));
 - new string[256];
 - format(string, sizeof(string), "\"%s\" has been range banned from the game by IRC admin \"%s\"", oname, user);
 - SendClientMessageToAll(yellow, string);
 - ircSay(conn, channel, string);
 - RangeBan(strval(tmp));
 - return 1;
 - }
 - irccmd_wire(conn, channel[], user[], message[])
 - {
 - new tmp[256];
 - tmp = zcmd(1, message);
 - if(ircIsOp(conn, channel, user) == 0) return ircSay(conn, channel, "You are not a channel admin");
 - if(strlen(tmp) == 0) return ircSay(conn, channel, "You did not put in an id");
 - if(IsPlayerConnected(strval(tmp)) == 0) return ircSay(conn, channel, "That player is not connected");
 - new oname[MAX_PLAYER_NAME];
 - GetPlayerName(strval(tmp), oname, sizeof(oname));
 - wire[strval(tmp)] == 1;
 - new string[256];
 - format(string, sizeof(string), "\"%s\" has been wired by admin \"%s\"", oname, user);
 - SendClientMessageToAll(yellow, string);
 - ircSay(conn, channel, string);
 - return 1;
 - }
 - irccmd_unwire(conn, channel[], user[], message[])
 - {
 - new tmp[256];
 - tmp = zcmd(1, message);
 - if(ircIsOp(conn, channel, user) == 0) return ircSay(conn, channel, "You are not a channel admin");
 - if(strlen(tmp) == 0) return ircSay(conn, channel, "You did not put in an id");
 - if(IsPlayerConnected(strval(tmp)) == 0) return ircSay(conn, channel, "That player is not connected");
 - new oname[MAX_PLAYER_NAME];
 - GetPlayerName(strval(tmp), oname, sizeof(oname));
 - wire[strval(tmp)] == 0;
 - new string[256];
 - format(string, sizeof(string), "\"%s\" has been unwired by admin \"%s\"", oname, user);
 - SendClientMessageToAll(yellow, string);
 - ircSay(conn, channel, string);
 - return 1;
 - }
 - irccmd_ann(conn, channel[], user[], message[])
 - {
 - new tmp[256];
 - tmp = zcmd(1, message);
 - if(ircIsOp(conn, channel, user) == 0) return ircSay(conn, channel, "You are not a channel admin");
 - if(strlen(tmp) == 0) return ircSay(conn, channel, "You did not put in a msg");
 - new string[256];
 - format(string, sizeof(string), "%s", message[6]);
 - GameTextForAll(string, 5000, 3);
 - return 1;
 - }
 - irccmd_getinfo(conn, channel[], user[], message[])
 - {
 - new tmp[256];
 - tmp = zcmd(1, message);
 - if(ircIsOp(conn, channel, user) == 0) return ircSay(conn, channel, "You are not a channel admin");
 - if(strlen(tmp) == 0) return ircSay(conn, channel, "You did not put in an id");
 - if(IsPlayerConnected(strval(tmp)) == 0) return ircSay(conn, channel, "That player is not connected");
 - new oname[MAX_PLAYER_NAME];
 - GetPlayerName(strval(tmp), oname, sizeof(oname));
 - new string[256];
 - format(string, sizeof(string), "Name: %s", oname);
 - ircSay(conn, channel, string);
 - format(string, sizeof(string), "ID: %d", strval(tmp));
 - ircSay(conn, channel, string);
 - format(string, sizeof(string), "Cash: %d", GetPlayerMoney(strval(tmp)));
 - ircSay(conn, channel, string);
 - format(string, sizeof(string), "Score: %d", GetPlayerScore(strval(tmp)));
 - ircSay(conn, channel, string);
 - return 1;
 - }
 - irccmd_jail(conn, channel[], user[], message[])
 - {
 - new tmp[256];
 - tmp = zcmd(1, message);
 - if(ircIsOp(conn, channel, user) == 0) return ircSay(conn, channel, "You are not a channel admin");
 - if(strlen(tmp) == 0) return ircSay(conn, channel, "You did not put in an id");
 - if(IsPlayerConnected(strval(tmp)) == 0) return ircSay(conn, channel, "That player is not connected");
 - new oname[MAX_PLAYER_NAME];
 - GetPlayerName(strval(tmp), oname, sizeof(oname));
 - jail[strval(tmp)] = 1;
 - TeleportPlayer(strval(tmp), 197.6661,173.8179,1003.0234, 0, 3); //location credits to XtremeAdmin2
 - SetPlayerHealth(strval(tmp), 100);
 - new string[256];
 - format(string, sizeof(string), "\"%s\" has been jailed by admin \"%s\"", oname, user);
 - SendClientMessageToAll(yellow, string);
 - ircSay(conn, channel, string);
 - return 1;
 - }
 - irccmd_unjail(conn, channel[], user[], message[])
 - {
 - new tmp[256];
 - tmp = zcmd(1, message);
 - if(ircIsOp(conn, channel, user) == 0) return ircSay(conn, channel, "You are not a channel admin");
 - if(strlen(tmp) == 0) return ircSay(conn, channel, "You did not put in an id");
 - if(IsPlayerConnected(strval(tmp)) == 0) return ircSay(conn, channel, "That player is not connected");
 - new oname[MAX_PLAYER_NAME];
 - GetPlayerName(strval(tmp), oname, sizeof(oname));
 - jail[strval(tmp)] = 0;
 - SetPlayerHealth(strval(tmp), 0);
 - new string[256];
 - format(string, sizeof(string), "\"%s\" has been unjailed by admin \"%s\"", oname, user);
 - SendClientMessageToAll(yellow, string);
 - ircSay(conn, channel, string);
 - return 1;
 - }
 - irccmd_getid(conn, channel[], user[], message[])
 - {
 - new tmp[256], id;
 - tmp = zcmd(1, message);
 - id = GetPlayerIDFromName(tmp);
 - if(ircIsOp(conn, channel, user) == 0) return ircSay(conn, channel, "You are not a channel admin");
 - if(strlen(tmp) == 0) return ircSay(conn, channel, "You did not give a name");
 - if(id == -1) return ircSay(conn, channel, "That player name was not found");
 - new pname[MAX_PLAYER_NAME];
 - GetPlayerName(strval(tmp), pname, sizeof(pname));
 - new string[256];
 - format(string, sizeof(string), "%s: %d", pname, id);
 - ircSay(conn, channel, string);
 - return 1;
 - }
 - irccmd_gmx(conn, channel[], user[], message[])
 - {
 - if(ircIsOp(conn, channel, user) == 0) return ircSay(conn, channel, "You are not a channel admin");
 - new string[256];
 - format(string, sizeof(string), "IRC admin \"%s\" has done a /GMX (server restart)", user);
 - SendClientMessageToAll(yellow, string);
 - ircSay(conn, channel, string);
 - #pragma unused message
 - return 1;
 - }
 - irccmd_clearchat(conn, channel[], user[], message[])
 - {
 - if(ircIsOp(conn, channel, user) == 0) return ircSay(conn, channel, "You are not a channel admin");
 - new string[256];
 - format(string, sizeof(string), "IRC admin \"%s\" has cleared the chat", user);
 - SendClientMessageToAll(yellow, string);
 - ircSay(conn, channel, string);
 - #pragma unused message
 - return 1;
 - }
 - irccmd_slap(conn, channel[], user[], message[])
 - {
 - new tmp[256];
 - tmp = zcmd(1, message);
 - if(ircIsOp(conn, channel, user) == 0) return ircSay(conn, channel, "You are not a channel admin");
 - if(strlen(tmp) == 0) return ircSay(conn, channel, "You did not put in an id");
 - if(IsPlayerConnected(strval(tmp)) == 0) return ircSay(conn, channel, "That player is not connected");
 - new Float:x, Float:y, Float:z;
 - GetPlayerPos(strval(tmp), x, y, z);
 - SetPlayerPos(strval(tmp), x, y, z + 10);
 - new oname[MAX_PLAYER_NAME];
 - GetPlayerName(strval(tmp), oname, sizeof(oname));
 - new string[256];
 - format(string, sizeof(string), "\"%s\" has been slapped by IRC admin \"%s\"", oname, user);
 - SendClientMessageToAll(yellow, string);
 - ircSay(conn, channel, string);
 - return 1;
 - }
 - irccmd_freeze(conn, channel[], user[], message[])
 - {
 - new tmp[256];
 - tmp = zcmd(1, message);
 - if(ircIsOp(conn, channel, user) == 0) return ircSay(conn, channel, "You are not a channel admin");
 - if(strlen(tmp) == 0) return ircSay(conn, channel, "You did not put in an id");
 - if(IsPlayerConnected(strval(tmp)) == 0) return ircSay(conn, channel, "That player is not connected");
 - TogglePlayerControllable(strval(tmp), 0);
 - new oname[MAX_PLAYER_NAME];
 - GetPlayerName(strval(tmp), oname, sizeof(oname));
 - new string[256];
 - format(string, sizeof(string), "\"%s\" has been frozen by IRC admin \"%s\"", oname, user);
 - SendClientMessageToAll(yellow, string);
 - ircSay(conn, channel, string);
 - return 1;
 - }
 - irccmd_unfreeze(conn, channel[], user[], message[])
 - {
 - new tmp[256];
 - tmp = zcmd(1, message);
 - if(ircIsOp(conn, channel, user) == 0) return ircSay(conn, channel, "You are not a channel admin");
 - if(strlen(tmp) == 0) return ircSay(conn, channel, "You did not put in an id");
 - if(IsPlayerConnected(strval(tmp)) == 0) return ircSay(conn, channel, "That player is not connected");
 - TogglePlayerControllable(strval(tmp), 0);
 - new oname[MAX_PLAYER_NAME];
 - GetPlayerName(strval(tmp), oname, sizeof(oname));
 - new string[256];
 - format(string, sizeof(string), "\"%s\" has been unfrozen by IRC admin \"%s\"", oname, user);
 - SendClientMessageToAll(yellow, string);
 - ircSay(conn, channel, string);
 - return 1;
 - }
 - irccmd_tele(conn, channel[], user[], message[])
 - {
 - new tmp[256], tmp2[256];
 - tmp = zcmd(1, message);
 - tmp2 = zcmd(2, message);
 - if(ircIsOp(conn, channel, user) == 0) return ircSay(conn, channel, "You are not a channel admin");
 - if(strlen(tmp) == 0) return ircSay(conn, channel, "You did not put in the first id");
 - if(IsPlayerConnected(strval(tmp)) == 0) return ircSay(conn, channel, "The first player is not connected");
 - if(strlen(tmp2) == 0) return ircSay(conn, channel, "You did not put in the second id");
 - if(IsPlayerConnected(strval(tmp2)) == 0) return ircSay(conn, channel, "The second player is not connected");
 - new Float:X, Float:Y, Float:Z;
 - GetPlayerPos(strval(tmp2), X, Y, Z);
 - Teleport(strval(tmp), X, Y, Z + 2, random(360), GetPlayerInterior(strval(tmp2)));
 - new oname[MAX_PLAYER_NAME], pname[MAX_PLAYER_NAME];
 - GetPlayerName(strval(tmp), pname, sizeof(pname));
 - GetPlayerName(strval(tmp2), oname, sizeof(oname));
 - new string[256];
 - format(string, sizeof(string), "\"%s\" has been teled to \"%s\" by IRC admin \"%s\"", pname, oname, user);
 - SendClientMessageToAll(yellow, string);
 - ircSay(conn, channel, string);
 - return 1;
 - }
 - irccmd_eject(conn, channel[], user[], message[])
 - {
 - new tmp[256];
 - tmp = zcmd(1, message);
 - if(ircIsOp(conn, channel, user) == 0) return ircSay(conn, channel, "You are not a channel admin");
 - if(strlen(tmp) == 0) return ircSay(conn, channel, "You did not put in an id");
 - if(IsPlayerConnected(strval(tmp)) == 0) return ircSay(conn, channel, "That player is not connected");
 - RemovePlayerFromVehicle(strval(tmp));
 - new oname[MAX_PLAYER_NAME];
 - GetPlayerName(strval(tmp), oname, sizeof(oname));
 - new string[256];
 - format(string, sizeof(string), "\"%s\" has been ejected by IRC admin \"%s\"", oname, user);
 - SendClientMessageToAll(yellow, string);
 - ircSay(conn, channel, string);
 - return 1;
 - }
 - irccmd_sethealth(conn, channel[], user[], message[])
 - {
 - new tmp[256], tmp2[256], Float:health;
 - tmp = zcmd(1, message);
 - tmp2 = zcmd(2, message);
 - if(ircIsOp(conn, channel, user) == 0) return ircSay(conn, channel, "You are not a channel admin");
 - if(strlen(tmp) == 0) return ircSay(conn, channel, "Use: /sethealth [ID] [HEALTH]");
 - if(IsPlayerConnected(strval(tmp)) == 0) return ircSay(conn, channel, "That player is not connected");
 - if(strlen(tmp2) == 0) return ircSay(conn, channel, "Use: /sethealth [ID] [HEALTH]");
 - health = strval(tmp2);
 - SetPlayerHealth(strval(tmp), health);
 - new oname[MAX_PLAYER_NAME];
 - GetPlayerName(strval(tmp), oname, sizeof(oname));
 - new string[256];
 - format(string, sizeof(string), "\"%s\" has had his health set to \"%0.0f\" by IRC admin \"%s\"", oname, health, user);
 - SendClientMessageToAll(yellow, string);
 - ircSay(conn, channel, string);
 - return 1;
 - }
 - irccmd_disarm(conn, channel[], user[], message[])
 - {
 - new tmp[256];
 - tmp = zcmd(1, message);
 - if(ircIsOp(conn, channel, user) == 0) return ircSay(conn, channel, "You are not a channel admin");
 - if(strlen(tmp) == 0) return ircSay(conn, channel, "You did not put in an id");
 - if(IsPlayerConnected(strval(tmp)) == 0) return ircSay(conn, channel, "That player is not connected");
 - ResetPlayerWeapons(strval(tmp));
 - new oname[MAX_PLAYER_NAME];
 - GetPlayerName(strval(tmp), oname, sizeof(oname));
 - new string[256];
 - format(string, sizeof(string), "\"%s\" has had his weapons reset by IRC admin \"%s\"", oname, user);
 - SendClientMessageToAll(yellow, string);
 - ircSay(conn, channel, string);
 - return 1;
 - }
 - irccmd_explode(conn, channel[], user[], message[])
 - {
 - new tmp[256];
 - tmp = zcmd(1, message);
 - if(ircIsOp(conn, channel, user) == 0) return ircSay(conn, channel, "You are not a channel admin");
 - if(strlen(tmp) == 0) return ircSay(conn, channel, "You did not put in an id");
 - if(IsPlayerConnected(strval(tmp)) == 0) return ircSay(conn, channel, "That player is not connected");
 - new Float:x, Float:y, Float:z;
 - GetPlayerPos(strval(tmp), x, y, z);
 - CreateExplosion(x, y, z, 10, 0);
 - new oname[MAX_PLAYER_NAME];
 - GetPlayerName(strval(tmp), oname, sizeof(oname));
 - new string[256];
 - format(string, sizeof(string), "\"%s\" has been exploded by IRC admin \"%s\"", oname, user);
 - SendClientMessageToAll(yellow, string);
 - ircSay(conn, channel, string);
 - return 1;
 - }
 - irccmd_givemoney(conn, channel[], user[], message[])
 - {
 - new tmp[256], tmp2[256];
 - tmp = zcmd(1, message);
 - tmp2 = zcmd(2, message);
 - if(ircIsOp(conn, channel, user) == 0) return ircSay(conn, channel, "You are not a channel admin");
 - if(strlen(tmp) == 0) return ircSay(conn, channel, "Use: /givemoney [ID] [AMMOUNT]");
 - if(IsPlayerConnected(strval(tmp)) == 0) return ircSay(conn, channel, "That player is not connected");
 - if(strlen(tmp2) == 0) return ircSay(conn, channel, "Use: /givemoney [ID] [AMMOUNT]");
 - GivePlayerMoney(strval(tmp), strval(tmp2));
 - new oname[MAX_PLAYER_NAME];
 - GetPlayerName(strval(tmp), oname, sizeof(oname));
 - new string[256];
 - format(string, sizeof(string), "\"%s\" has been given $%d by IRC admin \"%s\"", oname, strval(tmp2), user);
 - SendClientMessageToAll(yellow, string);
 - ircSay(conn, channel, string);
 - return 1;
 - }
 - irccmd_setscore(conn, channel[], user[], message[])
 - {
 - new tmp[256], tmp2[256];
 - tmp = zcmd(1, message);
 - tmp2 = zcmd(2, message);
 - if(ircIsOp(conn, channel, user) == 0) return ircSay(conn, channel, "You are not a channel admin");
 - if(strlen(tmp) == 0) return ircSay(conn, channel, "Use: /setscore [ID] [AMMOUNT]");
 - if(IsPlayerConnected(strval(tmp)) == 0) return ircSay(conn, channel, "That player is not connected");
 - if(strlen(tmp2) == 0) return ircSay(conn, channel, "Use: /setscore [ID] [AMMOUNT]");
 - SetPlayerScore(strval(tmp), strval(tmp2));
 - new oname[MAX_PLAYER_NAME];
 - GetPlayerName(strval(tmp), oname, sizeof(oname));
 - new string[256];
 - format(string, sizeof(string), "\"%s\"'s score has been set to %d by IRC admin \"%s\"", oname, strval(tmp2), user);
 - SendClientMessageToAll(yellow, string);
 - ircSay(conn, channel, string);
 - return 1;
 - }
 - irccmd_setname(conn, channel[], user[], message[])
 - {
 - new tmp[256], tmp2[256];
 - tmp = zcmd(1, message);
 - tmp2 = zcmd(2, message);
 - if(ircIsOp(conn, channel, user) == 0) return ircSay(conn, channel, "You are not a channel admin");
 - if(strlen(tmp) == 0) return ircSay(conn, channel, "Use: /setname [ID] [NAME]");
 - if(IsPlayerConnected(strval(tmp)) == 0) return ircSay(conn, channel, "That player is not connected");
 - if(strlen(tmp2) == 0) return ircSay(conn, channel, "Use: /setname [ID] [NAME]");
 - new oname[MAX_PLAYER_NAME];
 - GetPlayerName(strval(tmp), oname, sizeof(oname));
 - new string[256];
 - format(string, sizeof(string), "\"%s\"'s score has had his name set to \"%s\" by IRC admin \"%s\"", oname, tmp2, user);
 - SetPlayerName(strval(tmp), tmp2);
 - SendClientMessageToAll(yellow, string);
 - ircSay(conn, channel, string);
 - return 1;
 - }
 - irccmd_akill(conn, channel[], user[], message[])
 - {
 - new tmp[256];
 - tmp = zcmd(1, message);
 - if(ircIsOp(conn, channel, user) == 0) return ircSay(conn, channel, "You are not a channel admin");
 - if(strlen(tmp) == 0) return ircSay(conn, channel, "You did not put in an id");
 - if(IsPlayerConnected(strval(tmp)) == 0) return ircSay(conn, channel, "That player is not connected");
 - SetPlayerHealth(strval(tmp), 0);
 - new oname[MAX_PLAYER_NAME];
 - GetPlayerName(strval(tmp), oname, sizeof(oname));
 - new string[256];
 - format(string, sizeof(string), "\"%s\" has been killed by IRC admin \"%s\"", oname, user);
 - SendClientMessageToAll(yellow, string);
 - ircSay(conn, channel, string);
 - return 1;
 - }
 - irccmd_giveweapon(conn, channel[], user[], message[])
 - {
 - new tmp[256], tmp2[256], tmp3[256];
 - tmp = zcmd(1, message);
 - tmp2 = zcmd(2, message);
 - tmp3 = zcmd(3, message);
 - if(ircIsOp(conn, channel, user) == 0) return ircSay(conn, channel, "You are not a channel admin");
 - if(IsPlayerConnected(strval(tmp)) == 0) return ircSay(conn, channel, "That player is not connected");
 - if(strlen(tmp) == 0) return ircSay(conn, channel, "Use: /giveweapon [ID] [WEPID] [AMMO]");
 - if(strlen(tmp2) == 0) return ircSay(conn, channel, "Use: /giveweapon [ID] [WEPID] [AMMO]");
 - if(strlen(tmp3) == 0) return ircSay(conn, channel, "Use: /giveweapon [ID] [WEPID] [AMMO]");
 - GivePlayerWeapon(strval(tmp), strval(tmp2), strval(tmp3));
 - new oname[MAX_PLAYER_NAME];
 - GetPlayerName(strval(tmp), oname, sizeof(oname));
 - new string[256];
 - format(string, sizeof(string), "\"%s\"'s has been given weapon ID %d with %d ammo by IRC admin \"%s\"", oname, strval(tmp2), strval(tmp3), user);
 - SendClientMessageToAll(yellow, string);
 - ircSay(conn, channel, string);
 - return 1;
 - }
 - irccmd_players(conn, channel[], user[], params[]) //made by Grove, taken from CYS Echo Bot 1.2
 - {
 - new count, PlayerNames[512], string[256];
 - for(new i=0; i<=MAX_PLAYERS; i++)
 - {
 - if(IsPlayerConnected(i))
 - {
 - if(count == 0)
 - {
 - new PlayerName1[MAX_PLAYER_NAME];
 - GetPlayerName(i, PlayerName1, sizeof(PlayerName1));
 - format(PlayerNames, sizeof(PlayerNames),"2%s1", PlayerName1);
 - count++;
 - }
 - else
 - {
 - new PlayerName1[MAX_PLAYER_NAME];
 - GetPlayerName(i, PlayerName1, sizeof(PlayerName1));
 - format(PlayerNames, sizeof(PlayerNames),"%s, 2%s1", PlayerNames, PlayerName1);
 - count++;
 - }
 - }
 - else { if(count == 0) format(PlayerNames, sizeof(PlayerNames), "1No Players Online!"); }
 - }
 - new counter = 0;
 - for(new i=0; i<=MAX_PLAYERS; i++)
 - {
 - if(IsPlayerConnected(i)) counter++;
 - }
 - format(string, 256, "6Connected Players[%d]:1 %s", counter, PlayerNames);
 - ircSay(conn, channel, string);
 - #pragma unused params,user
 - return true;
 - }
 - //end of commands
 - //SA-MP functions
 - public OnPlayerConnect(playerid)
 - {
 - wire[playerid] = 0;
 - jail[playerid] = 0;
 - new string[256], pname[MAX_PLAYER_NAME];
 - GetPlayerName(playerid, pname, sizeof(pname));
 - format(string, sizeof(string), "2%s has joined the server", pname);
 - ircSay(EchoConnection, EchoChan, string);
 - }
 - public OnPlayerDisconnect(playerid)
 - {
 - new string[256], pname[MAX_PLAYER_NAME];
 - GetPlayerName(playerid, pname, sizeof(pname));
 - format(string, sizeof(string), "2%s has left the server", pname);
 - ircSay(EchoConnection, EchoChan, string);
 - }
 - public OnPlayerText(playerid, text[])
 - {
 - if(wire[playerid] == 1)
 - {
 - SendClientMessage(playerid, red, ">> You can not talk when wired");
 - return 0;
 - }
 - new string[256], pname[MAX_PLAYER_NAME];
 - GetPlayerName(playerid, pname, sizeof(pname));
 - format(string , sizeof(string),"4[%d]1 %s: %s", playerid, pname, text);
 - ircSay(EchoConnection, EchoChan, string);
 - return 1;
 - }
 - public OnPlayerCommandText(playerid, cmdtext[])
 - {
 - if(jail[playerid] == 1) return SendClientMessage(playerid, red, "You can not use commands when in jail");
 - return 0;
 - }
 - //end of SA-MP functions
 - //other config [no need to modify]
 - RangeBan(playerid) //just so I don't have to add more credits, I'll use mine
 - {
 - new pos, oldpos, ip[15], ip2[15], tmp[21];
 - GetPlayerIp(playerid, ip, sizeof(ip));
 - pos = strfind(ip, ".", true);
 - pos++;
 - for(new i = 0; i < pos; i++)
 - {
 - ip2[i] = ip[pos-pos+i];
 - }
 - pos--;
 - ip[pos] = ' ';
 - oldpos = pos;
 - oldpos++;
 - pos = strfind(ip, ".", true);
 - pos++;
 - for(new i = oldpos; i < pos; i++)
 - {
 - ip2[i] = ip[pos-pos+i];
 - }
 - format(ip2, sizeof(ip2), "%s*.*", ip2);
 - format(tmp, sizeof(tmp), "banip %s", ip2);
 - SendRconCommand(tmp);
 - return ip2;
 - }
 - zcmd(param, cmdtext[])
 - {
 - new pos, string[256], first = 1;
 - format(string, sizeof(string), "%s", cmdtext);
 - for(new i = 0; i < param; i++)
 - {
 - if(first == 1)
 - {
 - first = 0;
 - }
 - else
 - {
 - pos = strfind(string, " ", true);
 - strdel(string, 0, pos + 1);
 - }
 - }
 - if(strfind(string, " ", true))
 - {
 - pos = strfind(string, " ", true);
 - strdel(string, pos, 256);
 - }
 - return string;
 - }
 - Teleport(playerid, Float:x, Float:y, Float:z, Float:a, i)
 - {
 - SetPlayerInterior(playerid, i);
 - SetCameraBehindPlayer(playerid);
 - ResetPlayerWeapons(playerid);
 - if(IsPlayerInAnyVehicle(playerid) == 1)
 - {
 - SetVehiclePos(GetPlayerVehicleID(playerid), x, y, z);
 - SetVehicleZAngle(GetPlayerVehicleID(playerid), a);
 - LinkVehicleToInterior(GetPlayerVehicleID(playerid), i);
 - }
 - else
 - {
 - SetPlayerPos(playerid, x, y, z);
 - SetPlayerFacingAngle(playerid, a);
 - }
 - }
 - GetPlayerIDFromName(pname[])
 - {
 - for(new i = 0; i < MAX_PLAYERS; i++)
 - {
 - new playername[MAX_PLAYER_NAME];
 - GetPlayerName(i, playername, sizeof(playername));
 - if(strfind(playername, pname, true) != -1)
 - return i + 0;
 - }
 - return -1;
 - }
 - TeleportPlayer(playerid, Float:x, Float:y, Float:z, Float:a, i)
 - {
 - SetPlayerPos(playerid, x, y, z);
 - SetPlayerFacingAngle(playerid, a);
 - SetPlayerInterior(playerid, i);
 - SetCameraBehindPlayer(playerid);
 - ResetPlayerWeapons(playerid);
 - }
 - ircIsOp(conn, channel[], user[])
 - {
 - new ircLevel[4];
 - ircGetUserLevel(conn, channel, user, ircLevel);
 - if(!strcmp(ircLevel, "~", true, 1) || !strcmp(ircLevel, "&", true, 1) || !strcmp(ircLevel, "@", true, 1)) return 1;
 - return 0;
 - }
 - //end of other config
 
Advertisement
 
                    Add Comment                
                
                        Please, Sign In to add comment