Jump to content

Gravestone

Members
  • Posts

    467
  • Joined

  • Last visited

  • Days Won

    2

Everything posted by Gravestone

  1. Do you only want to insert the player new name in the table or insert this full sentence?
  2. There is no 'if' statement for 'else' at line 4. Try this: function giveWeaponsOnSpawn0 ( ) if getPlayerMoney(source) >= 20 then giveWeapon ( source, 31, 3000 ) -- Gives the M4 weapon with 200 ammo takePlayerMoney ( source, 20 ) else outputChatBox("You do not have enough money.", source, 255, 0, 0, false) end end addEvent( "giveweaponm4", true ) addEventHandler( "giveweaponm4", root, giveWeaponsOnSpawn0 )
  3. 1366 x 768 is my resolution. You can put your own resolution and just try the code.
  4. Please post your topic in your respected language's section.
  5. Well then the table is not returning the marker element. Try getElementByID maybe.
  6. Yes it would be. I thought you have similar checkpoint size for every map. You can try something else then.
  7. Well I don't think so you can achieve the checkpoint(marker) element anyway and then getMarkerSize. However, you can just subtract a specific number from the distance. By viewing the above photo, you can try -15.
  8. I guess yeah, it's in meters. It shows 20 because you're really 20 GTA meters away from the checkpoint. The position of the checkpoint is right in the center of it. Due to it's scale being enlarged, I thought that there was some problem too.
  9. No, you have to use RGB values.
  10. You can not change the default MTA debugscript's colors but you can create your own debug system using dxDrawText. Oh and btw there's an MTA function which lets you output custom debug messages with custom colors. If that's what you need then visit outputDebugString.
  11. Sorry for being late to edit the post. Anyways, if you're using the default race gamemode then this code will do the job: local sx_, sy_ = guiGetScreenSize ( ) local sx, sy = sx_/1440, sy_/900 function distanceFromPlayerToCheckpoint(player, i) g_Checkpoints = getAll("checkpoint") local checkpoint = g_Checkpoints[getElementData(player, "race.checkpoint")] if checkpoint == nil then return false end local x, y, z = getElementPosition(player) return getDistanceBetweenPoints3D(x, y, z, unpack(checkpoint.position)) end function getAll(name) local result = {} for i,element in ipairs(getElementsByType(name)) do result[i] = {} result[i].id = getElementID(element) or i local position = { tonumber(getElementData(element,"posX")), tonumber(getElementData(element,"posY")), tonumber(getElementData(element,"posZ")) } result[i].position = position; end return result end function draw() dxDrawText(tostring(distanceFromPlayerToCheckpoint(localPlayer)), sx_ * 1.5200, sy_ * 0.9843, sx_ * 0.2172, sy_ * 1.0167, tocolor(0, 0, 0, 255), 0.55*sy, "bankgothic", "center", "top", false, false, false, false, false) end addEventHandler("onClientRender", root, draw)
  12. Neither 'player' nor 'i' is defined in the 'draw' function.
  13. Try using this simple calculation to resize/fit the window to every resolution. local width, height = guiGetScreenSize() local sx, sy = width/1366, height/768 local window = guiCreateWindow(sx*10, sy*280, sx*200, sy*200, "Test", false) And yeah, you'll have to do the same for elements attached to that window. The positioning of the elements are automatic for every resolution but the sizing isn't. Hence, you'll have to use something similar again: guiCreateButton(20, 20, sx*50, sy*50, "Button", false, window)
  14. There is no 'countdown' function. I guess the timer is not being achieved client side correctly or it can't be, because of which the value is returning false.
  15. We help people with their problems, not find errors in their codes and fix them.
  16. Gravestone

    Namtags

    Go throw the drawing function again. Look which 'end' is ending which function.
  17. The wiki says: colorCoded: Set to true to enable embedded #FFFFFF color codes. Note: clip and wordBreak are forced false if this is set. I guess you'll have to do it without color codes in order to make your notification system work properly.
  18. If you want to draw the owner and vehicle's name on the vehicle, use dxDrawText and getScreenFromWorldPosition.
  19. Can you post the code which displays '4BB221CA8B037BE7FDF3A8FC0DE1A994' serial when you join? I don't think that it's an MTA bug since getPlayerSerial should return the correct serial at both places.
×
×
  • Create New...