Need help with SSCANF 2.8.1!
#1

Guys when I install 2.8.1 it's totally bugged, every command work ONLY for ID 0 and sometimes doesn't work like /goto, If I try /goto 0 (it is a NPC) it teleport me underworld at the center of the map (original spawn)!
So I downgraded it to 2.6, and it work but not the chat!
This is what I do:
ID 0 = npctest
ID 1 = Me
So, I use /slap 1 50, and the chat says: "Admin npctest has been slapped by TheLorizz(Me)" but it wasn't the NPC writing the command but me! Any help?
This is my ENTIRE admin system:
Код:
#include <a_samp>
#include <zcmd>
#include <sscanf2>
#include <YSI\y_ini>

#define DIALOG_REGISTER 1
#define DIALOG_LOGIN 2
#define DIALOG_SUCCESS_1 3
#define DIALOG_SUCCESS_2 4

#define PATH "/Users/%s.ini"

#define COL_WHITE "{FFFFFF}"
#define COL_RED "{F81414}"
#define COL_GREEN "{00FF22}"
#define COL_LIGHTBLUE "{00CED1}"

#if defined FILTERSCRIPT

public OnFilterScriptInit()
{
	print("\n--------------------------------------");
	print(" Total Admin by TheLorizz Loaded");
	print("--------------------------------------\n");
}
#endif

enum pInfo
{
    pPass,
    pCash,
    pAdmin,
    pKills,
    pDeaths,
    pVip,
    pFreezed,
    pWarn
}
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("Kills",PlayerInfo[playerid][pKills]);
    INI_Int("Deaths",PlayerInfo[playerid][pDeaths]);
    INI_Int("Vip",PlayerInfo[playerid][pVip]);
    INI_Int("Freezed",PlayerInfo[playerid][pFreezed]);
    INI_Int("Warn",PlayerInfo[playerid][pWarn]);
    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;
}

PlaySoundForAll(sound)
{
	for (new i = 0; i < MAX_PLAYERS; i++)
	{
		if(IsPlayerConnected(i)) PlayerPlaySound(i,sound,0,0,0);
	}
}
/*Credits to Dracoblue*/
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;
}

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"Scrivi la tua password per loggarti.","Login","Esci");
    }
    else
    {
        ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT,""COL_WHITE"Registrando...",""COL_WHITE"Scrivi una password per registrarti.","Registrati","Esci");
    }
    return 1;
}

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    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"Registrando...",""COL_RED"Hai inserito una password sbagliata!\n"COL_WHITE"Scrivi una password per registrarti.","Registrati","Esci");
                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,"Kills",0);
                INI_WriteInt(File,"Deaths",0);
                INI_WriteInt(File,"Vip",0);
                INI_WriteInt(File,"Freezed",0);
                INI_WriteInt(File,"Warn",0);
                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"Completato!",""COL_GREEN"Ti sei registrato al server!. Rilogga per giocare!","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"Completato!",""COL_GREEN"Ti sei loggato!!","Ok","");
                }
                else
                {
                    ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT,""COL_WHITE"Login",""COL_RED"Hai inserito una password sbagliata!\n"COL_WHITE"Scrivi una password per loggarti.","Login","Esci");
                }
                return 1;
            }
        }
    }
    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,"Kills",PlayerInfo[playerid][pKills]);
    INI_WriteInt(File,"Deaths",PlayerInfo[playerid][pDeaths]);
    INI_WriteInt(File,"Vip",PlayerInfo[playerid][pVip]);
    INI_WriteInt(File,"Freezed",PlayerInfo[playerid][pFreezed]);
    INI_WriteInt(File,"Warn",PlayerInfo[playerid][pWarn]);
    INI_Close(File);
    return 1;
}
public OnPlayerDeath(playerid, killerid, reason)
{
    PlayerInfo[killerid][pKills]++;
    PlayerInfo[playerid][pDeaths]++;
    return 1;
}
//Level 6
CMD:setadmin(playerid, params[])
{
	new ID;
	new pn[MAX_PLAYER_NAME];
	new str[128];
	new level;
	GetPlayerName(ID, pn, MAX_PLAYER_NAME);
	if(PlayerInfo[playerid][pAdmin] < 6) return SendClientMessage(playerid, 0xFF0000AA, "ERROR: You need to be atleast FOUNDER (6) to use this command!");
	if(!IsPlayerConnected(ID)) return SendClientMessage(playerid, 0xFF0000AA, "ERROR: Player not connected!");
	if(sscanf(params, "ui", ID, level)) return SendClientMessage(playerid, 0xFF0000AA, "USAGE: /setadmin [ID] [Level]");
	if(ID == playerid) return SendClientMessage(playerid, 0xFF0000AA, "ERROR: You can't use this command on you!");
	if(PlayerInfo[ID][pAdmin] == level) return SendClientMessage(playerid, 0xFF0000AA, "ERROR: This player has already got this level!");
	if(level > 6 || level < 0) return SendClientMessage(playerid, 0xFF0000AA, "ERROR: Levels <0-6>");
	if(level > PlayerInfo[ID][pAdmin])
	{
	    format(str, sizeof(str), "{FFFFFF}%s {00FF00}has been promoted!", pn);
	    SendClientMessageToAll(0xFFFFFFAA, str);
	    GameTextForPlayer(ID, "{00FF00}PROMOTED!", 2500, 3);
	    PlayerPlaySound(ID, 1150, 0, 0, 0);
	    PlayerInfo[ID][pAdmin] = level;
	    return 1;
	}
	if(level < PlayerInfo[ID][pAdmin])
	{
	    format(str, sizeof(str), "{FFFFFF}%s {FF0000}has been demoted!", pn);
	    SendClientMessageToAll(0xFFFFFFAA, str);
	    GameTextForPlayer(ID, "{FF0000}DEMOTED!", 2500, 3);
	    PlayerPlaySound(ID, 1150, 0, 0, 0);
	    PlayerInfo[ID][pAdmin] = level;
		return 1;
	}
	return 1;
}
CMD:setvip(playerid, params[])
{
	new ID;
	new pn[MAX_PLAYER_NAME];
	new str[128];
	new level;
	GetPlayerName(ID, pn, MAX_PLAYER_NAME);
	if(PlayerInfo[playerid][pAdmin] < 6) return SendClientMessage(playerid, 0xFF0000AA, "ERROR: You need to be atleast FOUNDER (6) to use this command!");
	if(!IsPlayerConnected(ID)) return SendClientMessage(playerid, 0xFF0000AA, "ERROR: Player not connected!");
	if(sscanf(params, "ui", ID, level)) return SendClientMessage(playerid, 0xFF0000AA, "USAGE: /setvip [ID] [Level]");
	if(PlayerInfo[ID][pVip] == level) return SendClientMessage(playerid, 0xFF0000AA, "ERROR: This player has already got this level!");
	if(level > 3 || level < 0) return SendClientMessage(playerid, 0xFF0000AA, "ERROR: Levels <0-3>");
	if(level > PlayerInfo[ID][pVip])
	{
	    format(str, sizeof(str), "{FFFFFF}%s {00FF00}has been vip-promoted!", pn);
	    SendClientMessageToAll(0xFFFFFFAA, str);
	    GameTextForPlayer(ID, "VIP-PROMOTED!", 2500, 3);
	    PlayerPlaySound(ID, 1054, 0, 0, 0);
	    PlayerInfo[ID][pVip] = level;
	    return 1;
	}
	if(level < PlayerInfo[ID][pVip])
	{
	    format(str, sizeof(str), "{FFFFFF}%s {FF0000}has been vip-demoted!", pn);
	    SendClientMessageToAll(0xFFFFFFAA, str);
	    GameTextForPlayer(ID, "VIP-DEMOTED!", 2500, 3);
	    PlayerPlaySound(ID, 1055, 0, 0, 0);
	    PlayerInfo[ID][pVip] = level;
		return 1;
	}
	return 1;
}
//Level 5
CMD:ban(playerid, params[])
{
	new ID;
	new pn[MAX_PLAYER_NAME];
	new an[MAX_PLAYER_NAME];
	new str[128];
	new reason[128];
	GetPlayerName(ID, pn, MAX_PLAYER_NAME);
	GetPlayerName(playerid, an, MAX_PLAYER_NAME);
	if(PlayerInfo[playerid][pAdmin] < 5) return SendClientMessage(playerid, 0xFF0000AA, "ERROR: You need to be atleast SUPER ADMIN (5) to use this command!");
	if(!IsPlayerConnected(ID)) return SendClientMessage(playerid, 0xFF0000AA, "ERROR: Player not connected!");
	if(sscanf(params, "us[128]", ID, reason)) return SendClientMessage(playerid, 0xFF0000AA, "USAGE: /ban [ID] [Reason]");
	if(ID == playerid) return SendClientMessage(playerid, 0xFF0000AA, "ERROR: You can't ban yourself!");
	if(PlayerInfo[ID][pAdmin] > PlayerInfo[playerid][pAdmin]) return SendClientMessage(playerid, 0xFF0000AA, "ERROR: You can't ban admins that have a level higher than yours!");
	format(str, sizeof(str), "{FFFFFF}%s {FF0000}has been banned by %s! Reason: %s", pn, an, reason);
	SendClientMessageToAll(0xFFFFFFAA, str);
	format(str, sizeof(str), "{FF0000}You have been banned by {FFFFFF}%s{FF0000}! Reason: {FFFFFF}%s", an, reason);
	SendClientMessage(playerid, 0xFFFFFFAA, str);
	PlaySoundForAll(1140);
	Ban(ID);
	return 1;
}
CMD:explode(playerid, params[])
{
	new ID;
	new Float:x;
	new Float:y;
	new Float:z;
	if(PlayerInfo[playerid][pAdmin] < 5) return SendClientMessage(playerid, 0xFF0000AA, "ERROR: You need to be atleast SUPER ADMIN (5) to use this command!");
	if(!IsPlayerConnected(ID)) return SendClientMessage(playerid, 0xFF0000AA, "ERROR: Player not connected!");
	if(sscanf(params, "u", ID)) return SendClientMessage(playerid, 0xFF0000AA, "USAGE: /explode [ID]");
	if(ID == playerid) return SendClientMessage(playerid, 0xFF0000AA, "ERROR: You can't explode yourself!");
	if(PlayerInfo[ID][pAdmin] > PlayerInfo[playerid][pAdmin]) return SendClientMessage(playerid, 0xFF0000AA, "ERROR: You can't explode admins that have a level higher than yours!");
	GetPlayerPos(ID, x, y, z);
	CreateExplosion(x, y, z, 0, 5);
	return 1;
}
CMD:kickall(playerid, params[])
{
	new an[MAX_PLAYER_NAME];
	new str[128];
	new reason[128];
	GetPlayerName(playerid, an, MAX_PLAYER_NAME);
	if(PlayerInfo[playerid][pAdmin] < 5) return SendClientMessage(playerid, 0xFF0000AA, "ERROR: You need to be atleast SUPER ADMIN (5) to use this command!");
	if(sscanf(params, "s[128]", reason)) return SendClientMessage(playerid, 0xFF0000AA, "USAGE: /kickall [Reason]");
	for(new i = 0; i < MAX_PLAYERS; i++)
	{
	    if(PlayerInfo[i][pAdmin] < 1)
	    {
	        if(!IsPlayerConnected(i))
	        {
	            if(!IsPlayerNPC(i))
	            {
					format(str, sizeof(str), "{FF0000}Admin {FFFFFF}%s {FF0000has kicked everyone from the server!(Except Admins) Reason: {FF9900}%s", an, reason);
					Kick(i);
					return 1;
				}
			}
			else
			{
			    SendClientMessage(playerid, 0xFF0000AA, "ERROR: No player connected!");
			}
		}
	}
	return 1;
}
//Level 4
CMD:kick(playerid, params[])
{
	new ID;
	new pn[MAX_PLAYER_NAME];
	new an[MAX_PLAYER_NAME];
	new str[128];
	new reason[128];
	GetPlayerName(ID, pn, MAX_PLAYER_NAME);
	GetPlayerName(playerid, an, MAX_PLAYER_NAME);
	if(PlayerInfo[playerid][pAdmin] < 5) return SendClientMessage(playerid, 0xFF0000AA, "ERROR: You need to be atleast ADMIN (4) to use this command!");
	if(!IsPlayerConnected(ID)) return SendClientMessage(playerid, 0xFF0000AA, "ERROR: Player not connected!");
	if(sscanf(params, "us[128]", ID, reason)) return SendClientMessage(playerid, 0xFF0000AA, "USAGE: /kick [ID] [Reason]");
	if(ID == playerid) return SendClientMessage(playerid, 0xFF0000AA, "ERROR: You can't kicked yourself!");
	if(PlayerInfo[ID][pAdmin] > PlayerInfo[playerid][pAdmin]) return SendClientMessage(playerid, 0xFF0000AA, "ERROR: You can't kick admins that have a level higher than yours!");
	format(str, sizeof(str), "{FFFFFF}%s {FF0000}has been kicked by %s! Reason: %s", pn, an, reason);
	SendClientMessageToAll(0xFFFFFFAA, str);
	format(str, sizeof(str), "{FF0000}You have been kicked by {FFFFFF}%s{FF0000}! Reason: {FFFFFF}%s", an, reason);
	SendClientMessage(playerid, 0xFFFFFFAA, str);
	PlaySoundForAll(1141);
	Kick(ID);
	return 1;
}
CMD:freeze(playerid, params[])
{
	new ID;
	new pn[MAX_PLAYER_NAME];
	new an[MAX_PLAYER_NAME];
	new str[128];
	GetPlayerName(ID, pn, MAX_PLAYER_NAME);
	GetPlayerName(playerid, an, MAX_PLAYER_NAME);
	if(PlayerInfo[playerid][pAdmin] < 4) return SendClientMessage(playerid, 0xFF0000AA, "ERROR: You need to be atleast ADMIN (4) to use this command!");
	if(!IsPlayerConnected(ID)) return SendClientMessage(playerid, 0xFF0000AA, "ERROR: Player not connected!");
	if(PlayerInfo[playerid][pFreezed] == 1) return SendClientMessage(playerid, 0xFF0000AA, "ERROR: This player is already freezed!");
	if(sscanf(params, "u", ID)) return SendClientMessage(playerid, 0xFF0000AA, "USAGE: /freeze [ID]");
	if(PlayerInfo[ID][pAdmin] > PlayerInfo[playerid][pAdmin]) return SendClientMessage(playerid, 0xFF0000AA, "ERROR: You can't freeze admins that have a level higher than yours!");
	format(str, sizeof(str), "You have been freezed by {FFFFFF}%s", an);
	SendClientMessage(ID, 0xFF9900AA, str);
	format(str, sizeof(str), "You have freezed {FFFFFF}%s", pn);
	SendClientMessage(playerid, 0xFF9900AA, str);
	PlayerInfo[playerid][pFreezed] = 1;
	PlayerPlaySound(ID, 1055, 0, 0, 0);
	TogglePlayerControllable(ID, 0);
	return 1;
}
CMD:unfreeze(playerid, params[])
{
	new ID;
	new pn[MAX_PLAYER_NAME];
	new an[MAX_PLAYER_NAME];
	new str[128];
	GetPlayerName(ID, pn, MAX_PLAYER_NAME);
	GetPlayerName(playerid, an, MAX_PLAYER_NAME);
	if(PlayerInfo[playerid][pAdmin] < 4) return SendClientMessage(playerid, 0xFF0000AA, "ERROR: You need to be atleast ADMIN (4) to use this command!");
	if(!IsPlayerConnected(ID)) return SendClientMessage(playerid, 0xFF0000AA, "ERROR: Player not connected!");
	if(PlayerInfo[playerid][pFreezed] == 0) return SendClientMessage(playerid, 0xFF0000AA, "ERROR: This player is already unfreezed!");
	if(sscanf(params, "u", ID)) return SendClientMessage(playerid, 0xFF0000AA, "USAGE: /unfreeze [ID]");
	if(PlayerInfo[ID][pAdmin] > PlayerInfo[playerid][pAdmin]) return SendClientMessage(playerid, 0xFF0000AA, "ERROR: You can't unfreeze admins that have a level higher than yours!");
	format(str, sizeof(str), "You have been unfreezed by {FFFFFF}%s", an);
	SendClientMessage(ID, 0xFF9900AA, str);
	format(str, sizeof(str), "You have unfreezed {FFFFFF}%s", pn);
	SendClientMessage(playerid, 0xFF9900AA, str);
	PlayerInfo[playerid][pFreezed] = 0;
	PlayerPlaySound(ID, 1054, 0, 0, 0);
	TogglePlayerControllable(ID, 1);
	return 1;
}
CMD:givewp(playerid, params[])
{
	new ID;
	new pn[MAX_PLAYER_NAME];
	new an[MAX_PLAYER_NAME];
	new str[128];
	new ammo;
	new ammoid;
	GetPlayerName(ID, pn, MAX_PLAYER_NAME);
	GetPlayerName(playerid, an, MAX_PLAYER_NAME);
	if(PlayerInfo[playerid][pAdmin] < 4) return SendClientMessage(playerid, 0xFF0000AA, "ERROR: You need to be atleast ADMIN (4) to use this command!");
	if(sscanf(params, "uii", ID, ammoid, ammo)) return SendClientMessage(playerid, 0xFF0000AA, "USAGE: /givewp [ID] [ID Weapon] [Ammo]");
	if(!IsPlayerConnected(ID)) return SendClientMessage(playerid, 0xFF0000AA, "ERROR: Player not connected!");
	if(ammoid > 1 || ammoid < 46)
	{
		if(ammo > 1 || ammoid < 100)
		{
			GivePlayerWeapon(ID, ammoid, ammo);
		}
		else
		{
		    SendClientMessage(playerid, 0xFF0000AA, "ERROR: Ammos <1-100>");
		}
	}
	else
	{
	    SendClientMessage(playerid, 0xFF0000AA, "ERROR: Weapons ID <1-46>");
	}
	format(str, sizeof(str), "{FF0000}Admin {FFFFFF}%s {FF0000} has give you {FF9900}%d {FF0000}with a round of {FF9900}%d", an, ammoid, ammo);
	SendClientMessage(ID, 0xFFFFFFAA, str);
	format(str, sizeof(str), "{FF0000}You give to {FFFFFF}%s {FF0000}a {FF9900}%d {FF0000}with a round of {FF9900}%d", pn, ammoid, ammo);
	SendClientMessage(playerid, 0xFFFFFFAA, str);
	return 1;
}
//Level 3
CMD:slap(playerid, params[])
{
	new ID;
	new pn[MAX_PLAYER_NAME];
	new an[MAX_PLAYER_NAME];
	new health;
	new str[128];
	new Float:x;
	new Float:y;
	new Float:z;
	GetPlayerName(ID, pn, MAX_PLAYER_NAME);
	GetPlayerName(playerid, an, MAX_PLAYER_NAME);
	if(PlayerInfo[playerid][pAdmin] < 3) return SendClientMessage(playerid, 0xFF0000AA, "ERROR: You need to be atleast MODERATOR (3) to use this command!");
	if(!IsPlayerConnected(ID)) return SendClientMessage(playerid, 0xFF0000AA, "ERROR: Player not connected!");
	if(sscanf(params, "ui", ID, health)) return SendClientMessage(playerid, 0xFF0000AA, "USAGE: /slap [ID] [HP]");
	if(health < 0 || health > 100) return SendClientMessage(playerid, 0xFF0000AA, "ERROR: Health <0-100>");
	if(PlayerInfo[ID][pAdmin] > PlayerInfo[playerid][pAdmin]) return SendClientMessage(playerid, 0xFF0000AA, "ERROR: You can't slap admins that have a level higher than yours!");
	format(str, sizeof(str), "{FFFFFF}%s {FF9900}has been slapped by {FFFFFF}%s{FF0000}! (HP Remains: {FF8899}%d/100)", pn, an, health);
	SendClientMessageToAll(0xFFFFFF, str);
	GetPlayerPos(ID, x, y, z);
	SetPlayerPos(ID, x, y, z+2);
	PlaySoundForAll(1190);
	SetPlayerHealth(ID, health);
	return 1;
}
CMD:get(playerid, params[])
{
	new ID;
	new ID2;
	new pn[MAX_PLAYER_NAME];
	new pn2[MAX_PLAYER_NAME];
	new str[128];
	new Float:x;
	new Float:y;
	new Float:z;
	GetPlayerName(ID, pn, MAX_PLAYER_NAME);
	GetPlayerName(ID2, pn2, MAX_PLAYER_NAME);
	if(PlayerInfo[playerid][pAdmin] < 3) return SendClientMessage(playerid, 0xFF0000AA, "ERROR: You need to be atleast MODERATOR (3) to use this command!");
	if(!IsPlayerConnected(ID)) return SendClientMessage(playerid, 0xFF0000AA, "ERROR: Player not connected!");
	if(!IsPlayerConnected(ID2)) return SendClientMessage(playerid, 0xFF0000AA, "ERROR: Target player not connected!");
	if(sscanf(params, "uu", ID, ID2)) return SendClientMessage(playerid, 0xFF0000AA, "USAGE: /get [ID] [ToID]");
	if(ID == ID2) return SendClientMessage(playerid, 0xFF0000AA, "ERROR: You can't teleport a player at the same player!");
	format(str, sizeof(str), "{FFFFFF}%s {FF9900}has been teleported to you by an admin", pn2);
	SendClientMessage(ID, 0xFFFFFFAA, str);
	format(str, sizeof(str), "{FF0000}You have been teleported to {FFFFFF}%s {FF0000}by an admin", pn);
	SendClientMessage(ID2, 0xFFFFFFAA, str);
	GetPlayerPos(ID, x, y, z);
	SetPlayerPos(ID2, x+1, y, z);
	return 1;
}
//Level 2
CMD:warn(playerid, params[])
{
	new ID;
	new pn[MAX_PLAYER_NAME];
	new an[MAX_PLAYER_NAME];
	new str[128];
	new reason[128];
	GetPlayerName(ID, pn, MAX_PLAYER_NAME);
	GetPlayerName(playerid, an, MAX_PLAYER_NAME);
	if(PlayerInfo[playerid][pAdmin] < 2) return SendClientMessage(playerid, 0xFF0000AA, "ERROR: You need to be atleast HELPER (2) to use this command!");
	if(!IsPlayerConnected(ID)) return SendClientMessage(playerid, 0xFF0000AA, "ERROR: Player not connected!");
	if(sscanf(params, "us[128]", ID, reason)) return SendClientMessage(playerid, 0xFF0000AA, "USAGE: /warn [ID] [Reason]");
	if(ID == playerid) return SendClientMessage(playerid, 0xFF0000AA, "ERROR: You can't warn yourself!!");
	if(PlayerInfo[ID][pAdmin] > PlayerInfo[playerid][pAdmin]) return SendClientMessage(playerid, 0xFF0000AA, "ERROR: You can't warn admins with a higher level than yours!");
	if(PlayerInfo[ID][pWarn] == 0)
	{
	    format(str, sizeof(str), "{FFFFFF}%s {FF0000}has been warned by {FFFFFF}%s{FF0000}!(1/3) Reason: {FF9900}%s", pn, an, reason);
	    SendClientMessageToAll(0xFFFFFFAA, str);
	    PlayerInfo[playerid][pWarn] = 1;
	    return 1;
	}
	if(PlayerInfo[ID][pWarn] == 1)
	{
	    format(str, sizeof(str), "{FFFFFF}%s {FF0000}has been warned by {FFFFFF}%s{FF0000}!(2/3) Reason: {FF9900}%s", pn, an, reason);
	    SendClientMessageToAll(0xFFFFFFAA, str);
	    PlayerInfo[playerid][pWarn] = 2;
	    return 1;
	}
	if(PlayerInfo[ID][pWarn] == 2)
	{
	    format(str, sizeof(str), "{FFFFFF}%s {FF0000}has been warned by {FFFFFF}%s{FF0000}!(3/3 KICKED) Reason: {FF9900}%s", pn, an, reason);
	    SendClientMessageToAll(0xFFFFFFAA, str);
	    PlayerInfo[playerid][pWarn] = 0;
	    Kick(ID);
	    return 1;
	}
	return 1;
}
CMD:gethere(playerid, params[])
{
    new ID;
	new pn[MAX_PLAYER_NAME];
	new an[MAX_PLAYER_NAME];
	new str[128];
	new Float:x;
	new Float:y;
	new Float:z;
	GetPlayerName(ID, pn, MAX_PLAYER_NAME);
	GetPlayerName(playerid, an, MAX_PLAYER_NAME);
	if(PlayerInfo[playerid][pAdmin] < 3) return SendClientMessage(playerid, 0xFF0000AA, "ERROR: You need to be atleast HELPER (2) to use this command!");
	if(!IsPlayerConnected(ID)) return SendClientMessage(playerid, 0xFF0000AA, "ERROR: Player not connected!");
	if(sscanf(params, "u", ID)) return SendClientMessage(playerid, 0xFF0000AA, "USAGE: /gethere [ID]");
	if(ID == playerid) return SendClientMessage(playerid, 0xFF0000AA, "ERROR: You can't get yourself to yourself!");
	format(str, sizeof(str), "{FF0000}Admin{FFFFFF}%s {FF9900}has teleported you to him", an);
	SendClientMessage(ID, 0xFFFFFFAA, str);
	format(str, sizeof(str), "{FF0000}You have teleported {FFFFFF}%s to you", pn);
	SendClientMessage(playerid, 0xFFFFFFAA, str);
	GetPlayerPos(playerid, x, y, z);
	SetPlayerPos(ID, x+1, y, z);
	return 1;
}
CMD:resetwp(playerid, params[])
{
	new ID;
	new pn[MAX_PLAYER_NAME];
	new an[MAX_PLAYER_NAME];
	new str[128];
	GetPlayerName(ID, pn, MAX_PLAYER_NAME);
	GetPlayerName(playerid, an, MAX_PLAYER_NAME);
	if(PlayerInfo[playerid][pAdmin] < 3) return SendClientMessage(playerid, 0xFF0000AA, "ERROR: You need to be atleast HELPER (2) to use this command!");
	if(sscanf(params, "u", ID)) return SendClientMessage(playerid, 0xFF0000AA, "ERROR: You need to be atleast HELPER (2) to use this command!");
	if(!IsPlayerConnected(ID)) return SendClientMessage(playerid, 0xFF0000AA, "USAGE: /resetwp [ID]");
	if(ID == playerid) return SendClientMessage(playerid, 0xFF0000AA, "ERROR: You can't use this command on you!");
	if(PlayerInfo[ID][pAdmin] > PlayerInfo[playerid][pAdmin]) return SendClientMessage(playerid, 0xFF0000AA, "ERROR: You can't use this command on admins that have a higher level than yours!");
	format(str, sizeof(str), "{FF0000}Admin {FFFFFF}%s {FF0000} has resetted your weapons!", an);
	SendClientMessage(ID, 0xFFFFFFAA, str);
	format(str, sizeof(str), "{FF0000}You resetted the weapons of {FFFFFF}%s{FF0000}!", pn);
	SendClientMessage(playerid, 0xFFFFFFAA, str);
	ResetPlayerWeapons(ID);
	return 1;
}
//Level 1
CMD:goto(playerid, params[])
{
    new ID;
	new pn[MAX_PLAYER_NAME];
	new an[MAX_PLAYER_NAME];
	new str[128];
	new Float:x;
	new Float:y;
	new Float:z;
	GetPlayerName(ID, pn, MAX_PLAYER_NAME);
	GetPlayerName(playerid, an, MAX_PLAYER_NAME);
	if(PlayerInfo[playerid][pAdmin] < 3) return SendClientMessage(playerid, 0xFF0000AA, "ERROR: You need to be atleast TRUSTED PLAYER (1) to use this command!");
	if(!IsPlayerConnected(ID)) return SendClientMessage(playerid, 0xFF0000AA, "ERROR: Player not connected!");
	if(sscanf(params, "u", ID)) return SendClientMessage(playerid, 0xFF0000AA, "USAGE: /goto [ID]");
	if(ID == playerid) return SendClientMessage(playerid, 0xFF0000AA, "ERROR: You can't go to yourself!");
	format(str, sizeof(str), "{FF0000}Admin {FFFFFF}%s {FF0000}has been teleported to you", an);
	SendClientMessage(ID, 0xFFFFFFAA, str);
	format(str, sizeof(str), "{FF0000}You have been teleported to {FFFFFF}%s", pn);
	SendClientMessage(playerid, 0xFFFFFFAA, str);
	GetPlayerPos(ID, x, y, z);
	SetPlayerPos(playerid, x+1, y, z);
	return 1;
}
CMD:akill(playerid, params[])
{
	new ID;
	new pn[MAX_PLAYER_NAME];
	new an[MAX_PLAYER_NAME];
	new str[128];
	GetPlayerName(ID, pn, MAX_PLAYER_NAME);
	GetPlayerName(playerid, an, MAX_PLAYER_NAME);
	if(PlayerInfo[playerid][pAdmin] < 3) return SendClientMessage(playerid, 0xFF0000AA, "ERROR: You need to be atleast TRUSTED PLAYER (1) to use this command!");
    if(!IsPlayerConnected(ID)) return SendClientMessage(playerid, 0xFF0000AA, "ERROR: Player not connected!");
	if(sscanf(params, "u", ID)) return SendClientMessage(playerid, 0xFF0000AA, "USAGE: /akill [ID]");
	if(ID == playerid) return SendClientMessage(playerid, 0xFF0000AA, "ERROR: You can't admin-kill yourself!");
	format(str, sizeof(str), "{FF0000}Admin {FFFFFF}%s {FF0000}has admin-killed {FFFFFF}%s{FF0000}!", an, pn);
	SendClientMessageToAll(0xFFFFFFAA, str);
	SetPlayerHealth(ID, 0);
	return 1;
}
CMD:acmds(playerid, params[])
{
	if(PlayerInfo[playerid][pAdmin] == 0) return SendClientMessage(playerid, 0xFF0000AA, "ERROR: You need to be atleast TRUSTED PLAYER (1) to use this command!");
	if(PlayerInfo[playerid][pAdmin] > 0) return SendClientMessage(playerid, 0x00FFFFAA, "TRUSTED PLAYER (1): /akill /goto");
	else if(PlayerInfo[playerid][pAdmin] > 1) return SendClientMessage(playerid, 0x00FFFFAA, "HELPER (2): /gethere /warn /resetwp");
	else if(PlayerInfo[playerid][pAdmin] > 2) return SendClientMessage(playerid, 0x00FFFFAA, "MODERATOR (3): /get /slap /givewp");
	else if(PlayerInfo[playerid][pAdmin] > 3) return SendClientMessage(playerid, 0x00FFFFAA, "ADMIN (4): /unfreeze /freeze /kick");
	else if(PlayerInfo[playerid][pAdmin] > 4) return SendClientMessage(playerid, 0x00FFFFAA, "SUPER ADMIN (5): /explode /ban /kickall");
    else if(PlayerInfo[playerid][pAdmin] > 5) return SendClientMessage(playerid, 0x00FFFFAA, "FOUNDER (6): /setadmin /setvip");
    return 1;
}
Reply
#2

Bump need a serious help!
Reply
#3

https://sampforum.blast.hk/showthread.php?tid=355296

Read Rule #6
Reply
#4

Done, I put the code at the startv
Reply
#5

Bump
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)