Criar comando pra bloquear o /ir
#1

Pessoal. nгo sei como fazer. mas queria bloquear de um jogador usar /ir se outro tiver bloqueado o /ir nele. Ex: /blockir .. dai nгo pode dar /ir nele lol. OSB: Pros admin nгo tem isso.. eles podem ir do mesmo jeito.. \o

pawn Код:
CMD:ir(playerid, params[])
{
    new id, Float:P[3];
    if(Info[playerid][Admin] < 1) return SendClientMessage(playerid, VERMELHO, "[ERRO] Vocк nгo estб autorizado a usar este comando.");
    if(sscanf(params, "u", id)) return SendClientMessage(playerid, CINZA, "USO: /ir [Nome do Jogador / ID]");
    if(!IsPlayerConnected(id) || id == INVALID_PLAYER_ID) return SendClientMessage(playerid, VERMELHO, "[ERRO] Jogador OFFLINE.");
    GetPlayerPos(id, P[0], P[1], P[2]);
    SetPlayerPos(playerid, P[0]+1, P[1], P[2]+0.5);
    SetPlayerInterior(playerid, GetPlayerInterior(id));
    SetPlayerVirtualWorld(playerid, GetPlayerVirtualWorld(id));
    GetPlayerName(id, str, MAX_PLAYER_NAME);
    format(str, 128, "[ADMIN] Vocк foi atй o jogador %s [ID %d].", str, id);
    SendClientMessage(playerid, AMARELO, str);
    GetPlayerName(playerid, str, MAX_PLAYER_NAME);
    format(str, 128, "[VPAdmin] O(a) admin %s [ID %d] veio atй vocк.", str, playerid);
    SendClientMessage(id, VERDE, str);
    return 1;
}
Reply
#2

Use uma simples bool, para ativar ou desativar o 'Block' do player....
pawn Код:
new bool:IsBlock[MAX_PLAYERS]; //bool para bloquear...

CMD:blockir(playerid, params[])
{
    IsBlock[playerid] = true; // Bool de block ativada.
    return 1;
}

CMD:ir(playerid, params[])
{
    new id, Float:P[3];
    if(Info[playerid][Admin] < 1)
    {
        SendClientMessage(playerid, VERMELHO, "[ERRO] Vocк nгo estб autorizado a usar este comando.");
        return 1;
    }
    if(sscanf(params, "u", id))
    {
        SendClientMessage(playerid, CINZA, "USO: /ir [Nome do Jogador / ID]");
        return 1;
    }
    if(id == INVALID_PLAYER_ID)
    {
        SendClientMessage(playerid, VERMELHO, "[ERRO] Jogador OFFLINE.");
        return 1;
    }
    if(IsBlock[id] == true) //caso ele esteja com Block ativado.
    {
        SendClientMessage(playerid, VERMELHO, "Este jogador bloqueou o /ir nele.");
        return 1;
    }
    GetPlayerPos(id, P[0], P[1], P[2]);
    SetPlayerPos(playerid, P[0]+1, P[1], P[2]+0.5);
    SetPlayerInterior(playerid, GetPlayerInterior(id));
    SetPlayerVirtualWorld(playerid, GetPlayerVirtualWorld(id));
    GetPlayerName(id, str, MAX_PLAYER_NAME);
    format(str, 128, "[ADMIN] Vocк foi atй o jogador %s [ID %d].", str, id);
    SendClientMessage(playerid, AMARELO, str);
    GetPlayerName(playerid, str, MAX_PLAYER_NAME);
    format(str, 128, "[VPAdmin] O(a) admin %s [ID %d] veio atй vocк.", str, playerid);
    SendClientMessage(id, VERDE, str);
    return 1;
}
Reply
#3

Obrigado Willian. Mais tarde vou ir testar . + Rep jб.

Sу uma duvida. se um jogador estiver com o /blockir ..
O admin vai poder ir no jogador mesmo assim ?
Reply
#4

Nгo... Mais pelo que eu vi no seu comando sу admin pode usar .-.
Reply
#5

Sim.. mas eu ia liberar ele pros player . por isso o blockir haha.
maas tranks. acho que й sу eu fazer um outro /ir sу pra admin '-'
Reply
#6

Quote:
Originally Posted by CanTLoGin
Посмотреть сообщение
Sim.. mas eu ia liberar ele pros player . por isso o blockir haha.
maas tranks. acho que й sу eu fazer um outro /ir sу pra admin '-'
Oque vocк realmente quer fazer?
Reply
#7

Liberar /ir para os jogadores . se um jogador quizer bloquear para que outros players va atй ele .. ele usa /blockir .. e pra desblock /desblockir ..

Mas deixando os admin usar /ir mesmo se o player tiver bloqueado. \o/
Reply
#8

Tente isso
pawn Код:
CMD:ir(playerid, params[])
{
    new id, Float:P[3];
    if(sscanf(params, "u", id))
    {
        SendClientMessage(playerid, CINZA, "USO: /ir [Nome do Jogador / ID]");
        return 1;
    }
    if(id == INVALID_PLAYER_ID)
    {
        SendClientMessage(playerid, VERMELHO, "[ERRO] Jogador OFFLINE.");
        return 1;
    }
    if(Info[playerid][Admin] >= 1)
    {
        if(IsBlock[id] == true || IsBlock[id] == false) //caso ele esteja com Block ativado.
        {
            GetPlayerPos(id, P[0], P[1], P[2]);
            SetPlayerPos(playerid, P[0]+1, P[1], P[2]+0.5);
            SetPlayerInterior(playerid, GetPlayerInterior(id));
            SetPlayerVirtualWorld(playerid, GetPlayerVirtualWorld(id));
            GetPlayerName(id, str, MAX_PLAYER_NAME);
            format(str, 128, "[ADMIN] Vocк foi atй o jogador %s [ID %d].", str, id);
            SendClientMessage(playerid, AMARELO, str);
            GetPlayerName(playerid, str, MAX_PLAYER_NAME);
            format(str, 128, "[VPAdmin] O(a) admin %s [ID %d] veio atй vocк.", str, playerid);
            SendClientMessage(id, VERDE, str);
            return 1;
        }
    }
    if(IsBlock[id] == true)
    {
        SendClientMessage(playerid, -1, "Este jogador bloqueou os /ir ");
        return 1;
    }
    GetPlayerPos(id, P[0], P[1], P[2]);
    SetPlayerPos(playerid, P[0]+1, P[1]+1, P[2]);
    SetPlayerInterior(playerid, GetPlayerInterior(id));
    SetPlayerVirtualWorld(playerid, GetPlayerVirtualWorld(id));
    return 1;
}
Reply
#9

Willian. ele compilou.. mas nгo tenho ninguem pra ir testar cmg \o/..
Mais tarde eu testo e posto aqui se tiver alguns erros .. *-*
Obrigado desde jб !
Sу nгo dou Rep porque tб dando erro. oO'
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)