SA-MP Forums Archive
[Ajuda] Verificar Pos dos pneus? - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: Non-English (https://sampforum.blast.hk/forumdisplay.php?fid=9)
+--- Forum: Languages (https://sampforum.blast.hk/forumdisplay.php?fid=33)
+---- Forum: Português/Portuguese (https://sampforum.blast.hk/forumdisplay.php?fid=34)
+---- Thread: [Ajuda] Verificar Pos dos pneus? (/showthread.php?tid=665328)



Verificar Pos dos pneus? - Syxh0wN - 30.03.2019

Alguem poderia me dizer qual a funзгo que identifica se o player estб perto do pneu do carro ou nгo ?


Re: Verificar Pos dos pneus? - MultiKill - 31.03.2019

Utilize a funзгo GetVehicleModelInfo para pegar as informaзхes do offset do pneu do veнculo.

Depois de pegar o offset sу usar a include 3DTryg para pegar as coordenadas, exemplo do criado da include de como fazer:

Quote:
Originally Posted by AbyssMorgan
Посмотреть сообщение
//edit:

http://i.imgur.com/nxqBRUQ.png

PHP код:
CMD:petrolcap(playerid){ 
    new 
vid GetPlayerVehicleID(playerid), 
        
Float:xFloat:yFloat:zFloat:rxFloat:rz
        
Float:vxFloat:vyFloat:vzFloat:angle;
     
    
GetVehiclePos(vid,vx,vy,vz); 
    
GetVehicleZAngle(vid,angle); 
    
GetVehicleModelInfo(GetVehicleModel(vid),VEHICLE_MODEL_INFO_PETROLCAP,x,y,z); 
    if(
GetRotationFor2Point3D(0.0,0.0,0.0,x,y,z,rx,rz)){ 
        new 
Float:dist VectorSize(x,y,z) + 1.0
        
GetPointInFront3D(vx,vy,vz,rx,CompRotationFloat(angle+rz),dist,x,y,z);
        
SetPlayerCheckpoint(playerid,x,y,z,3.0); 
    } else { 
        
//doesn't have petrolcap (0.0,0.0,0.0) 
    

    return 
1

3DTryg:
https://sampforum.blast.hk/showthread.php?tid=591010



Re: Verificar Pos dos pneus? - Syxh0wN - 31.03.2019

vlw, vou estudar essa inc