[Ajuda] ShowPlayerDialog ao entrar em um determinado veiculo
#1

Entгo Galera, estou com uma duvida de como fazer que quando o player entre em um determinado veiculo
automaticamente Abrir um Dialog para o mesmo

Exemplo;
fiz esse comando mais mesmo assim ele nгo funcionou

Code:
PHP код:
    SetVehicleParamsEx(vidVEHICLE_PARAMS_OFFlualarporcappormaob);
    
ShowPlayerDialog(playeridCOMPRARV2DIALOG_STYLE_LIST,"Este veiculo estб a venda ! Deseja Comprar-lo?","""Comprar","Cancelar");
    
format(stringsizeof(string)," | Concessionбria | Este veiculo estб a venda ! Preзo: %d R$, use /comprarveiculo"dini_Int(string,"Preco"));
    
SendClientMessage(playeridAmarelostring); 
Queria saber por nгo aparece o Dialog e os erros que eu cometi no code ...
Reply
#2

Use https://sampwiki.blast.hk/wiki/OnPlayerEnterVehicle para actionar uma aзao quando o jogador entrar num veiculo. E com "vehicleid", para dar aзoes differentes para cada veiculo.

pawn Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
    if (vehicleid == NomeDaVariableDoVeiculo)
    {
          SetVehicleParamsEx(vid, VEHICLE_PARAMS_OFF, lu, alar, por, cap, porma, ob);
          ShowPlayerDialog(playerid, COMPRARV2, DIALOG_STYLE_LIST,"Este veiculo estб a venda ! Deseja Comprar-lo?","", "Comprar","Cancelar");
          format(string, sizeof(string)," | Concessionбria | Este veiculo estб a venda ! Preзo: %d R$, use /comprarveiculo", dini_Int(string,"Preco"));
          SendClientMessage(playerid, Amarelo, string);
    }
    return 1;
}
Reply
#3

Coloca nesta public desse jeito

PHP код:
public OnPlayerStateChange(playeridnewstateoldstate)
{
    if( 
newstate == PLAYER_STATE_DRIVER)
    {
        
/* Coloque as funзхes aqui */
    
}
    return 
1;

Reply
#4

PHP код:
public OnPlayerStateChange(playeridnewstateoldstate)
{
    if(
oldstate == PLAYER_STATE_ONFOOT && newstate == PLAYER_STATE_DRIVER
    {
        
SetVehicleParamsEx(vidVEHICLE_PARAMS_OFFlualarporcappormaob); 
        
ShowPlayerDialog(playeridCOMPRARV2DIALOG_STYLE_LIST,"Este veiculo estб a venda ! Deseja Comprar-lo?","""Comprar","Cancelar"); 
        
format(stringsizeof(string)," | Concessionбria | Este veiculo estб a venda ! Preзo: %d R$, use /comprarveiculo"dini_Int(string,"Preco")); 
        
SendClientMessage(playeridAmarelostring);
    }
    return 
1;

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)