[Ajuda] Driver-By
#1

Bom pessoal, to usando o FS de Driver-By abaixo, o problema й que quando o player й preso ele consegue usar qualquer comando normalmente, permitindo-o assim sair da prisгo .

pawn Код:
#include <a_samp>

new Nome[128],
    String[128];
new bool:Preso[128];
forward JogadorPreso(killerid);

public OnPlayerConnect(playerid)
{
    Preso[playerid] = true;
    return 1;
}

public OnPlayerDisconnect(playerid, reason)
{
    Preso[playerid] = true;
    return 1;
}

public OnPlayerDeath(playerid, killerid, reason)
{
    if(GetPlayerState(killerid) == PLAYER_STATE_DRIVER)
    {
        GetPlayerName(playerid, Nome, sizeof(Nome));
        format(String, sizeof(String), "[AVISO] %s cometeu Drive-By [PUNIDO COM: 1 Minuto na solitaria].");
        SendClientMessageToAll(0xFF0000AA, String);
        GivePlayerMoney(killerid, -3500);
        SetPlayerPos(killerid, 197.6661, 173.8179, 1003.0233);
        SetPlayerInterior(killerid, 3);
        SetTimerEx("JogadorPreso", 60000, 0, "i", killerid);
    }
    return 1;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp("/oimundo", cmdtext, true, 10) == 0)
    {
        if(Preso[playerid] == false)
        {
            SendClientMessage(playerid, -1, "Falha ao usar o comando. Motivo: Preso");
        }
        else
        {
            SendClientMessage(playerid, -1, "Oi Mundo!");
        }
        return 1;
    }
    return 0;
}

public JogadorPreso(killerid)
{
        new Nome[MAX_PLAYER_NAME];
    GetPlayerName(killerid, Nome, sizeof(Nome));
    SetPlayerInterior(killerid, 0);
    SpawnPlayer(killerid);
    Preso[killerid] = true;
    GameTextForPlayer(killerid, "~g~Liberado~n~   ~w~Pense no que fez", 6000, 1);
    return 1;
}
Reply


Messages In This Thread
[Ajuda] Driver-By - by sanalex - 27.04.2012, 12:09
Re: [Ajuda] Driver-By - by Delete_ - 27.04.2012, 12:15
Re: [Ajuda] Driver-By - by sanalex - 27.04.2012, 12:19
Re: [Ajuda] Driver-By - by blacktrindade - 27.04.2012, 12:22
Re: [Ajuda] Driver-By - by sanalex - 27.04.2012, 12:28
Re: [Ajuda] Driver-By - by dPlaYer_ - 27.04.2012, 12:33
Re: [Ajuda] Driver-By - by blacktrindade - 27.04.2012, 12:35
Re: [Ajuda] Driver-By - by sanalex - 27.04.2012, 12:36
Re: [Ajuda] Driver-By - by blacktrindade - 27.04.2012, 12:38
Re: [Ajuda] Driver-By - by WeenSoares_ - 27.04.2012, 12:48

Forum Jump:


Users browsing this thread: 1 Guest(s)