[Tutorial] [TUT]Trancar/Destrancar Veiculos
#1

TRANCAR

pawn Code:
if (strcmp(cmdtext, "/OCOMANDOPARA TRANCAR", true)==0)
{
    if(IsPlayerInAnyVehicle(playerid))
    {
        new State=GetPlayerState(playerid);
        if(State!=PLAYER_STATE_DRIVER)
        {
            SendClientMessage(playerid,0xFF004040,"Vocк pode Trancar sу as portas como o motorista.");
            return 1;
        }
        new i;
        for(i=0;i<MAX_PLAYERS;i++)
        {
            if(i != playerid)
            {
                SetVehicleParamsForPlayer(GetPlayerVehicleID(playerid),i, 0, 1);
            }
        }
        SendClientMessage(playerid, 0x33AA33AA, "Veiculo Trancado");
        new Float:pX, Float:pY, Float:pZ;
        GetPlayerPos(playerid,pX,pY,pZ);
        PlayerPlaySound(playerid,1056,pX,pY,pZ);
    }
    else
    {
    SendClientMessage(playerid, 0xFF004040, "Voce Nao Esta Em Um veiculo);
    }
return 1;
DESTRANCAR O VEICULO
pawn Code:
if (strcmp(cmdtext, "/COMANDO PARA DESTRANCAR, true)==0)
{
    if(IsPlayerInAnyVehicle(playerid))
    {
        new State=GetPlayerState(playerid);
        if(State!=PLAYER_STATE_DRIVER)
        {
            SendClientMessage(playerid,0xFF004040,"
Vocк pode destrancar sу as portas como o motorista);
            return 1;
        }
        new i;
        for(i=0;i<MAX_PLAYERS;i++)
        {
            SetVehicleParamsForPlayer(GetPlayerVehicleID(playerid),i, 0, 0);
        }
        SendClientMessage(playerid, 0x33AA33AA, Veiculo Trancado!");
        new Float:pX, Float:pY, Float:pZ;
        GetPlayerPos(playerid,pX,pY,pZ);
        PlayerPlaySound(playerid,1057,pX,pY,pZ);
    }
    else
    {
    SendClientMessage(playerid, 0xFF004040, "
You're not in a vehicle!");
    }
return 1;
}
[b]Espero que esse tutorial seja utiu para quem esta atras.
Reply
#2

nen deu no meu gm D=
Reply
#3

Isso nгo й tutorial, tutorial й quando ensina a fazer esse ai й sу o comando pronto

OBS: Falta uma } depois do return no Trancar e tambйm no SendClientMessage do Trancar (Ultimo) falta uma "

OBS[2]: Falta uma " no /COMANDO PARA DESTRANCAR

OBS[3]: Tu nгo fez esse, pegou de algum lugar e traduziu mal atй

OBS[4]: O comando nгo funciona

OBS[5]: Para destrancar tem que ta no carro??

Desculpa mais й a verdade
Reply
#4

OK MAS TA POSTO
Reply
#5

Esse comando tб errado, no 0.3a vocк tem que trancar o carro quando o carro й carregado para o player..
pawn Code:
public OnVehicleStreamIn(vehicleid,forplayerid)
{
  return 1;
}
O que vocк pode fazer й trancar lб, criar uma vбriavel que diz "esse carro й para ser trancado", e ver o valor da variavel no public, se for = 1, trancar, se for = 0, faz nada.
Reply
#6

muito bom obrigado
Reply
#7

tem alguns erros mas o comando funciona sim !
й sу corrigir os errinhos que ele funfa
vlws veio
Reply
#8

Bom.. isso nгo й TUTORIAL, й CODE's.

No tutorial vocк explica passo-a-passo como fazer e por que fazer.
Reply
#9

PS: nгo funciona em gm thug
Reply
#10

Valeu aqui funfo direitinho, ate tem um errinhos mas e com ideias que temos mais ideias para fazer um tudo melhor.


Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)