[Ajuda] Velocimetro
#1

Bom queria saber se posso editar um velocimetro dentro das certas calback:

PHP код:
forward OnPlayerEnterVehicle(playeridvehicleidispassenger);
forward OnPlayerExitVehicle(playeridvehicleid); 
No entervehicle, colocar pra aparecer as text's e setstring's..

Tem como??
Reply
#2

Sim, pode usar tambйm a callback: OnPlayerStateChange.
Reply
#3

Ae seria usando, PLAYER_STATE_DRIVER?
Reply
#4

Quote:
Originally Posted by LuisFerreira
Посмотреть сообщение
Ae seria usando, PLAYER_STATE_DRIVER?
Exato.
PHP код:
    if(newstate == PLAYER_STATE_DRIVER)
    {
       
//
    
}
    if(
newstate == PLAYER_STATE_ONFOOT)
   {
    
//
   

Reply
#5

Aproveitando o topico, como eu verifico se o trailer esta atrelado ao caminhao?

PHP код:
    if(IsTrailerAttachedToVehicle(vehicleid))
    {
        new 
tid GetVehicleTrailer(vehicleid);
        if(
GetVehicleModel(tid) > 0)
        {
            
format(TrailerNome50"~y~%s"VehicleName[GetVehicleModel(tid)-400]);
            
PlayerTextDrawSetString(playeridVelo[16], TrailerNome);
            
PlayerTextDrawShow(playeridVelo[16]);
            if(
GetPVarInt(playerid"mostrar_trailer") == 0)
            {
                
PlayerTextDrawSetPreviewModel(playeridVelo[11], GetVehicleModel(tid));
                
PlayerTextDrawSetPreviewVehCol(playeridVelo[11], AVehicleData[tid][Color1], AVehicleData[tid][Color2]);
                
PlayerTextDrawShow(playeridVelo[11]);
                
SetPVarInt(playerid"mostrar_trailer"1);
            }
        }
    } 
Assim nгo funcionou..
Reply
#6

PHP код:
if( IsTrailerAttachedToVehicleGetPlayerVehicleIDplayerid )) )
    {
        new 
tid GetVehicleTrailer(vehicleid);
        if(
GetVehicleModel(tid) > 0)
        {
            
format(TrailerNome50"~y~%s"VehicleName[GetVehicleModel(tid)-400]);
            
PlayerTextDrawSetString(playeridVelo[16], TrailerNome);
            
PlayerTextDrawShow(playeridVelo[16]);
            if(
GetPVarInt(playerid"mostrar_trailer") == 0)
            {
                
PlayerTextDrawSetPreviewModel(playeridVelo[11], GetVehicleModel(tid));
                
PlayerTextDrawSetPreviewVehCol(playeridVelo[11], AVehicleData[tid][Color1], AVehicleData[tid][Color2]);
                
PlayerTextDrawShow(playeridVelo[11]);
                
SetPVarInt(playerid"mostrar_trailer"1);
            }
        }
    } 
Reply
#7

Nгo deu amigo..
Reply
#8

Faz assim entгo...

PHP код:
        if( !IsTrailerAttachedToVehicleGetPlayerVehicleIDplayerid )) )
        {
            
SendClientMessageplayeridCOLOR_ERRO"[ x ] Seu caminhгo nгo estб com carga." );
            return 
1;
        }
        new 
tid GetVehicleTrailerGetPlayerVehicleIDplayerid );
        if(
GetVehicleModel(tid) > 0)
        {
            
format(TrailerNome50"~y~%s"VehicleName[GetVehicleModel(tid)-400]);
            
PlayerTextDrawSetString(playeridVelo[16], TrailerNome);
            
PlayerTextDrawShow(playeridVelo[16]);
            if(
GetPVarInt(playerid"mostrar_trailer") == 0)
            {
                
PlayerTextDrawSetPreviewModel(playeridVelo[11], GetVehicleModel(tid));
                
PlayerTextDrawSetPreviewVehCol(playeridVelo[11], AVehicleData[tid][Color1], AVehicleData[tid][Color2]);
                
PlayerTextDrawShow(playeridVelo[11]);
                
SetPVarInt(playerid"mostrar_trailer"1);
            }
        }
    } 
@Edit
Cуdigo att.
Reply
#9

Agora bugou e nгo aparece nada do velocimetro..
Reply
#10

Testa ae...

PHP код:
if( IsTrailerAttachedToVehicleGetPlayerVehicleIDplayerid )))
    {
        new 
tid GetVehicleTrailerplayerid );
        if( 
GetVehicleModeltid ) > 0)
        {
            
formatTrailerNome50"~y~%s"VehicleNameGetVehicleModeltid )-400]);
            
PlayerTextDrawSetStringplayeridVelo16 ], TrailerNome );
            
PlayerTextDrawShowplayeridVelo16 ] );
            if( 
GetPVarIntplayerid"mostrar_trailer" ) == )
            {
                
PlayerTextDrawSetPreviewModelplayeridVelo11 ], GetVehicleModeltid ));
                
PlayerTextDrawSetPreviewVehColplayeridVelo11 ], AVehicleDatatid ][ Color1 ], AVehicleDatatid ][ Color2 ] );
                
PlayerTextDrawShowplayeridVelo11 ] );
                
SetPVarIntplayerid"mostrar_trailer");
            }
        }
    } 
Nгo tф entendendo muito bem, vocк quer pфr velocimetro em uma carga ?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)