[AJUDA] Trancar veнculos
#1

Olб

seguinte..

eu gostaria de reservar veнculos pra profissхes. Atй aн tudo bem... mas eu gostaria de trancб-los para quem NГO for da profissгo.
Por ex taxista, ele pode destrancar o taxi e entrar.

Me disseram q usa aquele SetVehicleParamsForPlayer. Mas nгo consegui х.o

vlw ai
Reply
#2

coloque isto no seu comando de trancar,
pawn Код:
SetVehicleParamsForPlayer(carid,playerid,0,1);
para destrancar use isto:

pawn Код:
SetVehicleParamsForPlayer(carid,playerid,0,0);
exemplo:

pawn Код:
//
// no topo do gm:
#define MAX_VEHICLES2 2000
new CarroTrancado[MAX_VEHICLES2] = 0;
public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp("/trancar", cmdtext, true, 10) == 0)
    {
        if(CarroTrancado[GetPlayerVehicleID(playerid)] == 0)
        {
            if(/* Sua Variavel Aqui... */)
            {
                SetVehicleParamsForPlayer(GetPlayerVehicleID(playerid),playerid,0,1);//trancou a porta do carro.
                return 1;
            }
            else
            {
                SendClientMessage(playerid, COLOR_GREEN, "Vocк nгo й da org X");
            }
        }
        else
        {
            SendClientMessage(playerid, Cor, "Este carro jб esta trancado Oo!");
        }
        return 1;
    }
    if (strcmp("/destrancar", cmdtext, true, 10) == 0)
    {
        if(CarroTrancado[GetPlayerVehicleID(playerid)] == 1)
        {
            if(/* Sua Variavel Aqui... */)
            {
                SetVehicleParamsForPlayer(GetPlayerVehicleID(playerid),playerid,0,0);//destrancou a porta do carro.
                return 1;
            }
            else
            {
                SendClientMessage(playerid, COLOR_GREEN, "Vocк nгo й da org X");
            }
        }
        else
        {
            SendClientMessage(playerid, Cor, "Este carro nгo esta trancado Oo!");
        }
        return 1;
    }
    return 0;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)