[PEDIDO]sistema de /painel
#7

Ta ai, acabei de fazer:

PHP код:
public OnGameModeInit()
{
    for(new 
0MAX_VEHICLES++)
    {
        
SetVehicleParamsEx(c0000000);
    }
    return 
1;
}
public 
OnPlayerStateChange(playeridnewstateoldstate)
{
    if(
newstate == 2)
    {
        new 
enginelightsalarmdoorsbonnetbootobjective;
        
GetVehicleParamsEx(GetPlayerVehicleID(playerid), enginelightsalarmdoorsbonnetbootobjective);
        if(
engine == 0) return SendClientMessage(playerid, -1"Para ligar o veiculo digite /painel e selecione a primeira opзгo.");
    }
    return 
1;
}
public 
OnPlayerCommandText(playeridcmdtext[])
{
    if(
strcmp(cmdtext"/painel"true) == 0)
    {
        if(
GetPlayerState(playerid) != 2) return SendClientMessage(playerid, -1"Vocк nгo dirigindo nenhum veiculo.");
        new 
veiculo GetVehicleModel(GetPlayerVehicleID(playerid));
        if(
Aviao(veiculo) || Trem(veiculo) || Heli(veiculo) || Barco(veiculo) || Bicicleta(veiculo) || Moto(veiculo)) return SendClientMessage(playerid, -1"Vocк nгo pode usar o painel neste veiculo.");
        
ShowPlayerDialog(playerid495DIALOG_STYLE_LIST"Painel do Veiculo:""Ligar/Desligar Veiculo\nLigar/Desligar Farуis\nLigar/Desligar Alarme\nAbrir/Fechar Capo\nAbrir/Fechar Porta-Malas""Selecionar""Cancelar");
        return 
1;
    }
    return 
0;
}
public 
OnDialogResponse(playeriddialogidresponselistiteminputtext[])
{
    if(
dialogid == 495)
    {
        if(
response == 1)
        {
            if(
listitem == 0)
            {
                new 
enginelightsalarmdoorsbonnetbootobjective;
                
GetVehicleParamsEx(GetPlayerVehicleID(playerid), enginelightsalarmdoorsbonnetbootobjective);
                if(
engine == 0)
                {
                    
SetVehicleParamsEx(GetPlayerVehicleID(playerid), 1lightsalarmdoorsbonnetbootobjective);
                    
SendClientMessage(playerid, -1"Vocк ligou o motor.");
                }
                else
                {
                    
SetVehicleParamsEx(GetPlayerVehicleID(playerid), 0lightsalarmdoorsbonnetbootobjective);
                    
SendClientMessage(playerid, -1"Vocк desligou o motor.");
                }
            }
            else if(
listitem == 1)
            {
                new 
enginelightsalarmdoorsbonnetbootobjective;
                
GetVehicleParamsEx(GetPlayerVehicleID(playerid), enginelightsalarmdoorsbonnetbootobjective);
                if(
lights == 0)
                {
                    
SetVehicleParamsEx(GetPlayerVehicleID(playerid), engine1alarmdoorsbonnetbootobjective);
                    
SendClientMessage(playerid, -1"Vocк ligou os farуis.");
                }
                else
                {
                    
SetVehicleParamsEx(GetPlayerVehicleID(playerid), engine0alarmdoorsbonnetbootobjective);
                    
SendClientMessage(playerid, -1"Vocк desligou os farуis.");
                }
            }
            else if(
listitem == 2)
            {
                new 
enginelightsalarmdoorsbonnetbootobjective;
                
GetVehicleParamsEx(GetPlayerVehicleID(playerid), enginelightsalarmdoorsbonnetbootobjective);
                if(
alarm == 0)
                {
                    
SetVehicleParamsEx(GetPlayerVehicleID(playerid), enginelights1doorsbonnetbootobjective);
                    
SendClientMessage(playerid, -1"Vocк ligou o alarme.");
                }
                else
                {
                    
SetVehicleParamsEx(GetPlayerVehicleID(playerid), enginelights0doorsbonnetbootobjective);
                    
SendClientMessage(playerid, -1"Vocк desligou o alarme.");
                }
            }
            else if(
listitem == 3)
            {
                new 
enginelightsalarmdoorsbonnetbootobjective;
                
GetVehicleParamsEx(GetPlayerVehicleID(playerid), enginelightsalarmdoorsbonnetbootobjective);
                if(
bonnet == 0)
                {
                    
SetVehicleParamsEx(GetPlayerVehicleID(playerid), enginelightsalarmdoors1bootobjective);
                    
SendClientMessage(playerid, -1"Vocк abriu o porta-malas.");
                }
                else
                {
                    
SetVehicleParamsEx(GetPlayerVehicleID(playerid), enginelightsalarmdoors0bootobjective);
                    
SendClientMessage(playerid, -1"Vocк fechou o porta-malas.");
                }
            }
            else if(
listitem == 4)
            {
                new 
enginelightsalarmdoorsbonnetbootobjective;
                
GetVehicleParamsEx(GetPlayerVehicleID(playerid), enginelightsalarmdoorsbonnetbootobjective);
                if(
boot == 0)
                {
                    
SetVehicleParamsEx(GetPlayerVehicleID(playerid), enginelightsalarmdoorsbonnet1objective);
                    
SendClientMessage(playerid, -1"Vocк abriu o capф.");
                }
                else
                {
                    
SetVehicleParamsEx(GetPlayerVehicleID(playerid), enginelightsalarmdoorsbonnet0objective);
                    
SendClientMessage(playerid, -1"Vocк fechou o capф.");
                }
            }
        }
    }
    return 
1;
}
stock Aviao(veiculo//FEITO POR SHADOWW5
{
    if(
veiculo == 460 || veiculo == 476 || veiculo == 511 || veiculo == 512 || veiculo == 513 || veiculo == 519 || veiculo == 520 || veiculo == 553 || veiculo == 577 || veiculo == 592 || veiculo == 593)
    {
        return 
1;
    }
    return 
0;
}
stock Heli(veiculo//FEITO POR SHADOWW5
{
    if(
veiculo == 417 || veiculo == 425 || veiculo == 447 || veiculo == 469 || veiculo == 487 || veiculo == 488 || veiculo == 497 || veiculo == 548 || veiculo == 563)
    {
        return 
1;
    }
    return 
0;
}
stock Barco(veiculo//FEITO POR SHADOWW5
{
    if(
veiculo == 430 || veiculo == 446 || veiculo == 452 || veiculo == 453 || veiculo == 454 || veiculo == 472 || veiculo == 484 || veiculo == 493 || veiculo == 595)
    {
        return 
1;
    }
    return 
0;
}
stock Bicicleta(veiculo//FEITO POR SHADOWW5
{
    if(
veiculo == 481 || veiculo == 509 || veiculo == 510)
    {
        return 
1;
    }
    return 
0;
}
stock Trem(veiculo//FEITO POR SHADOWW5
{
    if(
veiculo == 449 || veiculo == 537 || veiculo == 538 || veiculo == 570)
    {
        return 
1;
    }
    return 
0;
}
stock Moto(veiculo//FEITO POR SHADOWW5
{
    if(
veiculo == 448 || veiculo == 461 || veiculo == 462 || veiculo == 463 || veiculo == 468 || veiculo == 521 || veiculo == 522 || veiculo == 523 || veiculo == 581 || veiculo == 586)
    {
        return 
1;
    }
    return 
0;

Pastebin.com: http://pastebin.com/raw.php?i=GCx4d0L8
Reply


Messages In This Thread
[PEDIDO]sistema de /painel - by Thii - 19.06.2011, 22:45
Re: [PEDIDO]sistema de /painel - by Dr_Pawno - 19.06.2011, 22:49
Re: [PEDIDO]sistema de /painel - by Chefгo - 19.06.2011, 22:51
Re: [PEDIDO]sistema de /painel - by Erickini - 19.06.2011, 22:51
Re: [PEDIDO]sistema de /painel - by Thii - 19.06.2011, 23:06
Re: [PEDIDO]sistema de /painel - by Erickini - 19.06.2011, 23:27
Re: [PEDIDO]sistema de /painel - by Shadoww5 - 19.06.2011, 23:35
Re: [PEDIDO]sistema de /painel - by Ricop522 - 19.06.2011, 23:45
Re: [PEDIDO]sistema de /painel - by Shadoww5 - 20.06.2011, 00:19
Re: [PEDIDO]sistema de /painel - by Erickini - 20.06.2011, 01:14

Forum Jump:


Users browsing this thread: 3 Guest(s)