[Pedido] Sistema ANTI-DB por menu
#1

Queria um sistema anti-db que quando um cara comete db em outro,
aparece um menu na tela da vнtima perguntando: DB foi proposital? com os botхes Sim e Nгo
Caso, a vнtima clique em Sim, fecha o menu e o cara й preso automaticamente por 25 minutos.
Isso й possнvel de se fazer?
Reply
#2

Quote:
Originally Posted by smithz0r
Посмотреть сообщение
Isso й possнvel de se fazer?
Claro que tem.
espero ter ajudado
Reply
#3

'-' comentou isso pra ganhar posts >_>
Eu to pedindo uma ajuda no sistema, e foi uma pergunta retуrica ._.
Reply
#4

Quote:
Originally Posted by smithz0r
Посмотреть сообщение
'-' comentou isso pra ganhar posts >_>
Eu to pedindo uma ajuda no sistema, e foi uma pergunta retуrica ._.
sim, sempre que eu comento em ganho 1 Post. impressionante.
Nгo seja preguiзoso cara...
com esse #Code vocк faz ele.

pawn Код:
new Id,
    bool:DB[MAX_PLAYERS] = false;

public OnPlayerSelectedMenuRow(playerid, row)
{
    return 1;
}

public OnPlayerExitedMenu(playerid)
{
    return 1;
}
Reply
#5

Eu tbm quero esse sistema "
Reply
#6

Quote:
Originally Posted by smithz0r
Посмотреть сообщение
'-' comentou isso pra ganhar posts >_>
Eu to pedindo uma ajuda no sistema, e foi uma pergunta retуrica ._.
kkkkkkkkkk, liga nгo. O Toddynho й meio louco. Jб fiz um sistema parecido e vou te ajudar com isso.

Tente fazer vocк mesmo, se nгo conseguir vocк volta aqui.
Vocк precisarб estudar principalmente:

ShowPlayerDialog
https://sampforum.blast.hk/showthread.php?tid=119297
https://sampforum.blast.hk/showthread.php?tid=287721
https://sampforum.blast.hk/showthread.php?tid=109610
https://sampwiki.blast.hk/wiki/How_to_Create_a_Dialog

SetTimerEx
https://sampwiki.blast.hk/wiki/SetTimerEx

OnPlayerDeath
https://sampwiki.blast.hk/wiki/OnPlayerDeath
Reply
#7

Tб, mas como prende uma pessoa quando clica em Sim? Qual a funзгo ou algo do tipo?
Nгo sei muito mexer com isso, entгo nгo sei a funзгo.
Reply
#8

pawn Код:
/*----------------------------------------------------------------------------------------------------
-------------------------------Feito por Aninhaah/HumildadeForever------------------------------------
--------------------------------------Nгo retire os crйditos------------------------------------------
DESCRIЗГO:
Esse pequeno script tem a funзгo de perguntar a alguem que morreu de DB, se foi proposital ou nгo. Se for
o assassino vai preso.

OBS: ALTERAR COORDENADAS, INTERIORES E VIRTUAL WORLDS
*/


#include <a_samp>

#define DialogDB 510

#define TEMPO_PRISAO 25 //Tempo em minutos

#define COORD_PRISAO_X 2052.2548
#define COORD_PRISAO_Y 6535.4196
#define COORD_PRISAO_Z 5296.4578

#define INT_PRISAO 0
#define VW_PRISAO 0

#define COORD_LIBERTO_X 5576.5874
#define COORD_LIBERTO_Y 5695.4816
#define COORD_LIBERTO_Z 5819.4792

#define INT_LIBERTO 0
#define VW_LIBERTO 0

public OnPlayerDeath(playerid, killerid, reason)
{
    if(IsPlayerInAnyVehicle(killerid))
    {
        SetPVarInt(playerid, "Assassino", killerid);
        new str[80], nomej[MAX_PLAYER_NAME];
        GetPlayerName(killerid, nomej, sizeof(nomej));
        format(str, sizeof(str),"%s te matou com DB.\n\nFoi proposital?", nomej);
        ShowPlayerDialog(playerid, DialogDB, DIALOG_STYLE_MSGBOX,"Vitima de DB", str, "Sim","Nao");
    }
    return 1;
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(dialogid == DialogDB)
    {
        if(response)
        {
            new matador = GetPVarInt(playerid, "Assassino"), str[110], nomej[MAX_PLAYER_NAME];
            GetPlayerName(matador, nomej, sizeof(nomej));
            format(str, sizeof(str),"Vocк disse que %s te matou de proposito e ele foi preso por %d minutos.", nomej, TEMPO_PRISAO);
            SendClientMessage(playerid, -1, str);
            GetPlayerName(playerid, nomej, sizeof(nomej));
            format(str, sizeof(str),"Vocк estб preso por matar %s com DB.", nomej);
            SendClientMessage(matador, -1, str);
            SetPlayerPos(matador, COORD_PRISAO_X, COORD_PRISAO_Y, COORD_PRISAO_Z);
            SetPlayerInterior(matador, INT_PRISAO);
            SetPlayerVirtualWorld(matador, VW_PRISAO);
            SetTimerEx("LiberarMatador", TEMPO_PRISAO*60000, false, "d", matador);
            DeletePVar(playerid, "Assassino");
        }
        else if(!response) return SendClientMessage(playerid, -1, "Ok, nгo foi proposital.");
        return 1;
    }
    return 1;
}
forward LiberarMatador(playerid);
public LiberarMatador(playerid)
{
    SetPlayerPos(playerid, COORD_LIBERTO_X, COORD_LIBERTO_Y, COORD_LIBERTO_Z);
    SetPlayerInterior(playerid, INT_LIBERTO);
    SetPlayerVirtualWorld(playerid, VW_LIBERTO);
    SendClientMessage(playerid, -1, "Vocк estб liberto, nгo cometa mais DB.");
    return 1;
}

Teste ai, e se houver algum bug, me avise.
Reply
#9

u.u obrigado tava me matando aqui.
--edit
To com uns problemas nas posiзхes, eu coloco a da Бrea 69 e nгo vai pra lб
Reply
#10

Quote:
Originally Posted by smithz0r
Посмотреть сообщение
u.u obrigado tava me matando aqui.
--edit
To com uns problemas nas posiзхes, eu coloco a da Бrea 69 e nгo vai pra lб
Vai estar assim:
AddPlayerClass(23,1234.4545, 4562.5778, 5468.8756, ...);

Verde = Skin
Azul = Coordenada X
Vermelho = Coordenada Y
Rosa = Coordenada Z

Certifique-se de estar colocando a coordenada certa e no lugar certo.
OBS: Coordenada usada foi um exemplo, nem sei onde vai parar...
Reply


Forum Jump:


Users browsing this thread: 5 Guest(s)