Jump to content

Castillo

Retired Staff
  • Posts

    21,935
  • Joined

  • Last visited

  • Days Won

    6

Everything posted by Castillo

  1. addEventHandler ( "onPlayerChat", root, function ( input ) local gang = exports [ '[ROG]Groups' ]:getPlayerGang ( source ) local r, g, b = getPlayerNametagColor ( source ) if ( gang ~= "None" ) then outputChatBox ( getPlayerName ( source ) .." [".. gang .."]: #FFFFFF".. input, r, g, b, true ) cancelEvent ( ) end end ) Try that.
  2. No, that has nothing to do with what I said.
  3. We don't accept requests here, but you can learn and make it yourself. Function you need: redirectPlayer Event handler: onPlayerChat
  4. local peds = { } function camera ( ) for ped,veh in pairs(peds)do local x, y, z = getElementPosition(veh) setCameraMatrix(x+8, y+10, z+4, x, y, z) end end function cameraStarts(ped) setPedControlState(ped,"accelerate",true) setTimer(function() setPedControlState(ped,"accelerate",false) end,600,1) pVeh = getPedOccupiedVehicle(ped) if not peds[ped] then peds[ped] = pVeh end addEventHandler("onClientRender",root,camera) addEventHandler("onClientRender",getRootElement(),stunt) end addEvent( "onCameraStart", true ) addEventHandler( "onCameraStart",root, cameraStarts ) function stunt ( ) local x, y = guiGetScreenSize ( ) for _, veh in pairs ( peds ) do if ( veh ) then local x, y, z = getElementPosition ( veh ) local px, py, pz = x + 5, y + 10, z + 2 local distance = getDistanceBetweenPoints3D ( x, y, z, px, py, pz ) if ( distance <= 150 ) then local sx, sy = getScreenFromWorldPosition ( x, y, z + 0.55, 0.06 ) if ( sx ) then local scale = 1 / ( 0.3 * ( distance / 150 ) ) dxDrawRectangle ( sx - 100, sy - 105, 200, 70, tocolor ( 0, 0, 0, 200 ) ) dxDrawText ( "#000000Fabioxps", sx, sy - 70, sx, sy - 30, tocolor ( 255, 255, 255, 255 ), math.min ( 0.4 * ( 20 / distance ) * 1.4, 4 ), "default-bold", "center", "bottom", false, false, false, true ) end end end end end
  5. Personally, I use notepad++, but it depends on the person.
  6. Create a table, when a player uses that command, insert the player element as index in the table, inside the loop to send the chat message, check if he player is in that table.
  7. Post the code where you create the vehicle.
  8. You can? I didn't know about that.
  9. You want it to appear on a specific vehicle and not in the local player's vehicle?
  10. Topic moved to resources section.
  11. Castillo

    help

    The value is what you want it to be, you can set it to true.
  12. Use onClientPlayerWasted to hide it when die.
  13. local sx, sy = guiGetScreenSize ( ) local image = guiCreateStaticImage(0,0,sx,sy,"image.png",false) guiSetVisible ( image, false ) addEventHandler ( "onClientPlayerDamage", localPlayer, function ( ) local health = getElementHealth ( source ) outputChatBox ( "Your health is: ".. math.floor ( health ) .."%" ) if ( health <= 10 ) then guiSetVisible ( image, true ) end end ) Try that.
  14. gifs aren't supported either, but you can use either this useful function I made: https://wiki.multitheftauto.com/wiki/DxDrawGifImage Or this sprite library: viewtopic.php?f=108&t=49179&p=484981
  15. You can create a colshape, and when they enter, you can kill them, or teleport them somewhere around.
  16. You set your health how? because it won't trigger that even for when you set your health by setElementHealth.
  17. local image = guiCreateStaticImage(0,0,300,100,"image.png",false) guiSetVisible ( image, false ) addEventHandler ( "onClientPlayerDamage", localPlayer, function ( ) local health = getElementHealth ( source ) outputChatBox ( "Your health is: ".. math.floor ( health ) .."%" ) if ( health <= 10 ) then guiSetVisible ( image, true ) end end ) Try that and see what it outputs to chat.
  18. But the script already does that, it renders it over the vehicle.
  19. else if guiGetVisible(image) then That should be: elseif guiGetVisible(image) then
  20. I don't understand what do you mean by "stay", the rectangle will draw on the position above the vehicle.
×
×
  • Create New...