[Ajuda] Com comando /setint
#1

Bom galera... muitos servers RPG tem aquele problema da prisгo
onde o cara usa o bug da prisгo /setint 0 para que suma tudo e depois consegue fugir..
tah mais eu quero saber como eu posso bloquear esse comando numa coordenada
tipo se o player digitar /setint 0 na prisгo devia vim uma menssagem "Vocк nгo pode usar esse comando aqui"

Alguem pode ajudar?

Vou mandar o cуdigo do /setint
Код:
	if(strcmp(cmd, "/setint", true) == 0)
	{
	    if(IsPlayerConnected(playerid))
	    {
			tmp = strtok(cmdtext, idx);
			if(!strlen(tmp))
			{
				SendClientMessage(playerid, COLOR_GRAD2, "USO: /setint [interiorid]");
				return 1;
			}
			new intid;
			intid = strval(tmp);
			if (PlayerInfo[playerid][pAdmin] >= 0)
			{
				SetPlayerInterior(playerid,intid);
				PlayerInfo[playerid][pInt] = intid;
				format(string, sizeof(string), "INTERIOR: %d", intid);
				SendClientMessage(playerid, COLOR_GRAD1, string);
			}
			else
			{
				SendClientMessage(playerid, COLOR_GRAD1, "   Vocк nгo pode usar esse comando !");
			}
		}
		return 1;
	}
Reply
#2

pawn Код:
if(strcmp(cmd, "/setint", true) == 0)
    {
            if(IsPlayerConnected(playerid))
     {
               if(IsPlayerInRangeOfPoint(playerid, 7.0, CORDENADAS DA PRISГO))
               {
                        SendClientMessage(playerid, 0xFFF000AA, "Comando proibido nesta secзгo!");
               }
               else
               {
            tmp = strtok(cmdtext, idx);
            if(!strlen(tmp))
            {
                SendClientMessage(playerid, COLOR_GRAD2, "USO: /setint [interiorid]");
                return 1;
            }
            new intid;
            intid = strval(tmp);
            if (PlayerInfo[playerid][pAdmin] >= 0)
            {
                SetPlayerInterior(playerid,intid);
                PlayerInfo[playerid][pInt] = intid;
                format(string, sizeof(string), "INTERIOR: %d", intid);
                SendClientMessage(playerid, COLOR_GRAD1, string);
            }
            else
            {
                SendClientMessage(playerid, COLOR_GRAD1, "   Vocк nгo pode usar esse comando !");
            }
        }
        return 1;
    }
Reply
#3

pawn Код:
if(IsPlayerInRangeOfPoint(playerid, 100, x,y,z)) return SendClientMessage(playerid, 0xFFFFFFAA, "Comando proibido nesse lugar.");
Reply
#4

Код:
if(strcmp(cmd, "/setint", true) == 0)
{
	if(!IsPlayerInRangeOfPoint(playerid, Raio, X, Y, Z))
	return SendClientMessage(playerid, Cor, "Vocк nгo pode utilizar este comando aqui!");
	
	tmp = strtok(cmdtext, idx);
	if(!strlen(tmp))
	{
		SendClientMessage(playerid, COLOR_GRAD2, "USO: /setint [interiorid]");
		return 1;
	}
	new intid;
	intid = strval(tmp);
	if (PlayerInfo[playerid][pAdmin] >= 0)		
	{
		SetPlayerInterior(playerid,intid);
		PlayerInfo[playerid][pInt] = intid;
		format(string, sizeof(string), "INTERIOR: %d", intid);
		SendClientMessage(playerid, COLOR_GRAD1, string);
	}
	else return SendClientMessage(playerid, COLOR_GRAD1, "   Vocк nгo pode usar esse comando !");
}
return 1;
}
Substituia "IsPlayerInRangeOfPoint" (X,Y,Z) posiзгo X,Y,Z da prisгo, e defina um certo "Raio" de alcance. Se preferir pode tambйm utilizar "PVars", para bloquear o uso do comando dentro da prisгo sem checar sua posiзгo:
Код:
if(strcmp(cmd, "/setint", true) == 0)
{
	if(GetPVarInt(playerid, "NaPrisao") == 1)
	return SendClientMessage(playerid, Cor, "Vocк nгo pode utilizar este comando aqui!");
	
	tmp = strtok(cmdtext, idx);
	if(!strlen(tmp))
	{
		SendClientMessage(playerid, COLOR_GRAD2, "USO: /setint [interiorid]");
		return 1;
	}
	new intid;
	intid = strval(tmp);
	if (PlayerInfo[playerid][pAdmin] >= 0)		
	{
		SetPlayerInterior(playerid,intid);
		PlayerInfo[playerid][pInt] = intid;
		format(string, sizeof(string), "INTERIOR: %d", intid);
		SendClientMessage(playerid, COLOR_GRAD1, string);
	}
	else return SendClientMessage(playerid, COLOR_GRAD1, "   Vocк nгo pode usar esse comando !");
}
return 1;
}
Apenas coloque no comando/funзгo que envia o jogador a prisгo:
Код:
SetPVarInt(playerid, "NaPrisao",1);
e, no comando/funзгo que remove o jogador da prisгo:
Код:
SetPVarInt(playerid, "NaPrisao",0);
Reply
#5

Vlw galera deu certinho aqui ... muito obrigado a todos.. quando precisar de mim tamo aew
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)