-
Posts
1,102 -
Joined
Everything posted by Enargy,
-
https://forum.multitheftauto.com/viewforum.php?f=177
-
Primero. 'getLocalPlayer' debe llevar los parentesis, ó usar localPlayer, que es la definicion de getLocalPlayer() Segundo. usa outputs para saber si la función es ejecutada.
-
delet client-side script and try with this: dawnlodetext1 = " Welcome to GRAGHAX Gaming Server" --- the text up dawnlodetext2 = " Please be patience until download finish" --- the text in medium dawnlodetext3 = "Enjoy and have fun" --- the text under dis = textCreateDisplay() screentext = textCreateTextItem(dawnlodetext1,0.2,0.2,"medium",255,0,0,255,3) textDisplayAddText(dis,screentext) dis1 = textCreateDisplay() screentext1 = textCreateTextItem(dawnlodetext2,0.3,0.4,"medium",0,255,0,255,3) textDisplayAddText(dis1,screentext1) dis2 = textCreateDisplay() screentext2 = textCreateTextItem(dawnlodetext3,0.4,0.6,"medium",255,255,0,255,3) textDisplayAddText(dis2,screentext2) addEventHandler("onResourceStart",resourceRoot, function () for i,p in ipairs(getElementsByType("player")) do textDisplayAddObserver(dis,p) textDisplayAddObserver(dis1,p) textDisplayAddObserver(dis2,p) end end ) addEventHandler("onPlayerJoin",root, function () fadeCamera(source, true, 5) setCameraMatrix(source, 1468.8785400391, -919.25317382813, 100.153465271, 1468.388671875, -918.42474365234, 99.881813049316) textDisplayAddObserver(dis,source) textDisplayAddObserver(dis1,source) textDisplayAddObserver(dis2,source) end ) addEventHandler("onPlayerLogin",root, function () textDisplayRemoveObserver(dis,source) textDisplayRemoveObserver(dis1,source) textDisplayRemoveObserver(dis2,source) end )
-
@TAPL thank you, and others for your attention. it works perfectly.
-
Hi guys, I'm working on a point system but when do the work of rendering the following emerges: local screenW, screenH = guiGetScreenSize() local x, y = (screenW/1024), (screenH/768) local size = 1.50 --- the size of the text font addEventHandler("onClientRender", root, function() local playerCoins = getPlayerCoins(getLocalPlayer()) dxDrawText("C"..gPlayerCoins(playerCoins), x*795, y*170, x*973, 198, tocolor(0, 0, 0, 255), size, "pricedown", "left", "top", false, false, false, false, false) dxDrawText("C"..gPlayerCoins(playerCoins), x*795, y*166, x*973, 198, tocolor(0, 0, 0, 255), size, "pricedown", "left", "top", false, false, false, false, false) dxDrawText("C"..gPlayerCoins(playerCoins), x*800, y*166, x*973, 196, tocolor(0, 0, 0, 255), size, "pricedown", "left", "top", false, false, false, false, false) dxDrawText("C"..gPlayerCoins(playerCoins), x*795, y*171, x*971, 198, tocolor(0, 0, 0, 255), size, "pricedown", "left", "top", false, false, false, false, false) dxDrawText("C"..gPlayerCoins(playerCoins), x*800, y*171, x*971, 198, tocolor(0, 0, 0, 255), size, "pricedown", "left", "top", false, false, false, false, false) dxDrawText("C"..gPlayerCoins(playerCoins), x*796, y*168, x*971, 196, tocolor(0, 0, 0, 255), size, "pricedown", "left", "top", false, false, false, false, false) dxDrawText("C"..gPlayerCoins(playerCoins), x*797, y*169, x*972, 197, tocolor(100, 100, 255, 200), size, "pricedown", "left", "top", false, false, false, false, false) end) the script works totally fine but when a player has a higher or lower resolution than the acquiree as text size varies with different ones. I was thinking of doing the calculations using the font size of the text but I have no idea how to calculate the size of the font for all resolutions. ty.
-
https://wiki.multitheftauto.com/wiki/DxDrawText
-
perhaps multiplying the values if a player level up in that case you would have to create a new function which case presents the calculation -- if you are interested getElementData setElementData getAccountData setAccountData
-
I need to know how this ordered the gui.
-
you can post the rest of the code please?
-
you forgot addEvent("Close", true)
-
try this: function SpawnPlayer(thePlayer,skin,r,g,b) local theCurrentAccount = getPlayerAccount(thePlayer) local accountData = getAccountData (theCurrentAccount, "funmodev2-money") if (accountData) then local playerSkin = getAccountData (theCurrentAccount, "funmodev2-skin") local playerHealth = getAccountData (theCurrentAccount, "funmodev2-health") local playerArmor = getAccountData (theCurrentAccount, "funmodev2-armor") local playerR = getAccountData (theCurrentAccount, "funmodev2-R") local playerG = getAccountData (theCurrentAccount, "funmodev2-G") local playerB = getAccountData (theCurrentAccount, "funmodev2-B") local playerB = getAccountData (theCurrentAccount, "funmodev2-B") local playerX = getAccountData (theCurrentAccount, "funmodev2-x") local playerY = getAccountData (theCurrentAccount, "funmodev2-y") local playerZ = getAccountData (theCurrentAccount, "funmodev2-z") local playerInt = getAccountData (theCurrentAccount, "funmodev2-int") local playerDim = getAccountData (theCurrentAccount, "funmodev2-dim") local playerWanted = getAccountData (theCurrentAccount, "funmodev2-wantedlevel") local playerWeaponID0 = getAccountData (theCurrentAccount, "funmodev2-weaponID0") local playerWeaponID1 = getAccountData (theCurrentAccount, "funmodev2-weaponID1") local playerWeaponID2 = getAccountData (theCurrentAccount, "funmodev2-weaponID2") local playerWeaponID3 = getAccountData (theCurrentAccount, "funmodev2-weaponID3") local playerWeaponID4 = getAccountData (theCurrentAccount, "funmodev2-weaponID4") local playerWeaponID5 = getAccountData (theCurrentAccount, "funmodev2-weaponID5") local playerWeaponID6 = getAccountData (theCurrentAccount, "funmodev2-weaponID6") local playerWeaponID7 = getAccountData (theCurrentAccount, "funmodev2-weaponID7") local playerWeaponID8 = getAccountData (theCurrentAccount, "funmodev2-weaponID8") local playerWeaponID9 = getAccountData (theCurrentAccount, "funmodev2-weaponID9") local playerWeaponID10 = getAccountData (theCurrentAccount, "funmodev2-weaponID10") local playerWeaponID11 = getAccountData (theCurrentAccount, "funmodev2-weaponID11") local playerWeaponID12 = getAccountData (theCurrentAccount, "funmodev2-weaponID12") local playerWeaponAmmo0 = getAccountData (theCurrentAccount, "funmodev2-weaponAmmo0") local playerWeaponAmmo1 = getAccountData (theCurrentAccount, "funmodev2-weaponAmmo1") local playerWeaponAmmo2 = getAccountData (theCurrentAccount, "funmodev2-weaponAmmo2") local playerWeaponAmmo3 = getAccountData (theCurrentAccount, "funmodev2-weaponAmmo3") local playerWeaponAmmo4 = getAccountData (theCurrentAccount, "funmodev2-weaponAmmo4") local playerWeaponAmmo5 = getAccountData (theCurrentAccount, "funmodev2-weaponAmmo5") local playerWeaponAmmo6 = getAccountData (theCurrentAccount, "funmodev2-weaponAmmo6") local playerWeaponAmmo7 = getAccountData (theCurrentAccount, "funmodev2-weaponAmmo7") local playerWeaponAmmo8 = getAccountData (theCurrentAccount, "funmodev2-weaponAmmo8") local playerWeaponAmmo9 = getAccountData (theCurrentAccount, "funmodev2-weaponAmmo9") local playerWeaponAmmo10 = getAccountData (theCurrentAccount, "funmodev2-weaponAmmo10") local playerWeaponAmmo11 = getAccountData (theCurrentAccount, "funmodev2-weaponAmmo11") local playerWeaponAmmo12 = getAccountData (theCurrentAccount, "funmodev2-weaponAmmo12") spawnPlayer ( thePlayer, playerX, playerY, playerZ + 2, 90.0, skin ,playerInt, playerDim ) giveWeapon(source, playerWeaponID0, playerWeaponAmmo0, true) giveWeapon(source, playerWeaponID1, playerWeaponAmmo1, false) giveWeapon(source, playerWeaponID2, playerWeaponAmmo2, false) giveWeapon(source, playerWeaponID3, playerWeaponAmmo3, false) giveWeapon(source, playerWeaponID4, playerWeaponAmmo4, false) giveWeapon(source, playerWeaponID5, playerWeaponAmmo5, false) giveWeapon(source, playerWeaponID6, playerWeaponAmmo6, false) giveWeapon(source, playerWeaponID7, playerWeaponAmmo7, false) giveWeapon(source, playerWeaponID8, playerWeaponAmmo8, false) giveWeapon(source, playerWeaponID9, playerWeaponAmmo9, false) giveWeapon(source, playerWeaponID10, playerWeaponAmmo10, false) giveWeapon(source, playerWeaponID11, playerWeaponAmmo11, false) giveWeapon(source, playerWeaponID12, playerWeaponAmmo12, false) else spawnPlayer(source,1459.64014,-1643.40723, 438.94131,90.0,skin,0,0) giveWeapon(source,46,1,true) setCameraTarget (source, source) setPlayerMoney(source,2500) end setCameraTarget (source, source) setPlayerMoney(source,accountData) playerSkin[source] = {skin,r,g,b} setElementData(source,"Score",0) setPlayerNametagShowing ( source, false) end addEvent( "onClientWantsToSpawn", true ) addEventHandler( "onClientWantsToSpawn", getRootElement(), SpawnPlayer ) and sorry but I'm not testing the codes that I'm suggesting. I do not currently meet in my pc
-
I think you should add another SpawnPlayer function between line 3 and line 4. function SpawnPlayer(thePlayer,skin,r,g,b) local theCurrentAccount = getPlayerAccount(thePlayer) local accountData = getAccountData (theCurrentAccount, "funmodev2-money") spawnPlayer ( thePlayer, float_x, float_y, float_z, float_rot, skin_model, interior, dimension ) --- here you put some custom values if (accountData) then local playerSkin = getAccountData (theCurrentAccount, "funmodev2-skin") local playerHealth = getAccountData (theCurrentAccount, "funmodev2-health") local playerArmor = getAccountData (theCurrentAccount, "funmodev2-armor") local playerR = getAccountData (theCurrentAccount, "funmodev2-R") local playerG = getAccountData (theCurrentAccount, "funmodev2-G") local playerB = getAccountData (theCurrentAccount, "funmodev2-B") local playerB = getAccountData (theCurrentAccount, "funmodev2-B") local playerX = getAccountData (theCurrentAccount, "funmodev2-x") local playerY = getAccountData (theCurrentAccount, "funmodev2-y") local playerZ = getAccountData (theCurrentAccount, "funmodev2-z") if not (playerX or playerY or playerZ) then spawnPlayer(source,1459.64014,-1643.40723, 438.94131,90.0,skin,0,0) giveWeapon(source,46,1,true) setCameraTarget (source, source) setPlayerMoney(source,2500) return end local playerInt = getAccountData (theCurrentAccount, "funmodev2-int") local playerDim = getAccountData (theCurrentAccount, "funmodev2-dim") local playerWanted = getAccountData (theCurrentAccount, "funmodev2-wantedlevel") local playerWeaponID0 = getAccountData (theCurrentAccount, "funmodev2-weaponID0") local playerWeaponID1 = getAccountData (theCurrentAccount, "funmodev2-weaponID1") local playerWeaponID2 = getAccountData (theCurrentAccount, "funmodev2-weaponID2") local playerWeaponID3 = getAccountData (theCurrentAccount, "funmodev2-weaponID3") local playerWeaponID4 = getAccountData (theCurrentAccount, "funmodev2-weaponID4") local playerWeaponID5 = getAccountData (theCurrentAccount, "funmodev2-weaponID5") local playerWeaponID6 = getAccountData (theCurrentAccount, "funmodev2-weaponID6") local playerWeaponID7 = getAccountData (theCurrentAccount, "funmodev2-weaponID7") local playerWeaponID8 = getAccountData (theCurrentAccount, "funmodev2-weaponID8") local playerWeaponID9 = getAccountData (theCurrentAccount, "funmodev2-weaponID9") local playerWeaponID10 = getAccountData (theCurrentAccount, "funmodev2-weaponID10") local playerWeaponID11 = getAccountData (theCurrentAccount, "funmodev2-weaponID11") local playerWeaponID12 = getAccountData (theCurrentAccount, "funmodev2-weaponID12") local playerWeaponAmmo0 = getAccountData (theCurrentAccount, "funmodev2-weaponAmmo0") local playerWeaponAmmo1 = getAccountData (theCurrentAccount, "funmodev2-weaponAmmo1") local playerWeaponAmmo2 = getAccountData (theCurrentAccount, "funmodev2-weaponAmmo2") local playerWeaponAmmo3 = getAccountData (theCurrentAccount, "funmodev2-weaponAmmo3") local playerWeaponAmmo4 = getAccountData (theCurrentAccount, "funmodev2-weaponAmmo4") local playerWeaponAmmo5 = getAccountData (theCurrentAccount, "funmodev2-weaponAmmo5") local playerWeaponAmmo6 = getAccountData (theCurrentAccount, "funmodev2-weaponAmmo6") local playerWeaponAmmo7 = getAccountData (theCurrentAccount, "funmodev2-weaponAmmo7") local playerWeaponAmmo8 = getAccountData (theCurrentAccount, "funmodev2-weaponAmmo8") local playerWeaponAmmo9 = getAccountData (theCurrentAccount, "funmodev2-weaponAmmo9") local playerWeaponAmmo10 = getAccountData (theCurrentAccount, "funmodev2-weaponAmmo10") local playerWeaponAmmo11 = getAccountData (theCurrentAccount, "funmodev2-weaponAmmo11") local playerWeaponAmmo12 = getAccountData (theCurrentAccount, "funmodev2-weaponAmmo12") spawnPlayer ( thePlayer, playerX, playerY, playerZ + 2, 90.0, skin ,playerInt, playerDim ) giveWeapon(source, playerWeaponID0, playerWeaponAmmo0, true) giveWeapon(source, playerWeaponID1, playerWeaponAmmo1, false) giveWeapon(source, playerWeaponID2, playerWeaponAmmo2, false) giveWeapon(source, playerWeaponID3, playerWeaponAmmo3, false) giveWeapon(source, playerWeaponID4, playerWeaponAmmo4, false) giveWeapon(source, playerWeaponID5, playerWeaponAmmo5, false) giveWeapon(source, playerWeaponID6, playerWeaponAmmo6, false) giveWeapon(source, playerWeaponID7, playerWeaponAmmo7, false) giveWeapon(source, playerWeaponID8, playerWeaponAmmo8, false) giveWeapon(source, playerWeaponID9, playerWeaponAmmo9, false) giveWeapon(source, playerWeaponID10, playerWeaponAmmo10, false) giveWeapon(source, playerWeaponID11, playerWeaponAmmo11, false) giveWeapon(source, playerWeaponID12, playerWeaponAmmo12, false) end setCameraTarget (source, source) setPlayerMoney(source,accountData) playerSkin[source] = {skin,r,g,b} setElementData(source,"Score",0) setPlayerNametagShowing ( source, false) end addEvent( "onClientWantsToSpawn", true ) addEventHandler( "onClientWantsToSpawn", getRootElement(), SpawnPlayer )
-
Why not create a table to define skin?
-
replace line 7 for this: WindowKidnapperComputer = guiCreateWindow(rx/2 - 444, ry/2 - 275, sW,sH,"TEXT EXAMPLE",false)
-
addEventHandler("onPlayerQuit",root, function () local playerAccount = getPlayerAccount ( source ) if ( playerAccount ) and not isGuestAccount ( playerAccount ) then -- here your code using setAccountData & setElementData end end )
-
function killP(hitElement) if (getElementType(hitElement)=="ped") then destroyElement(hitElement) elseif (getElementType(hitElement)=="player") then local playerTeam = getPlayerTeam ( hitElement ) local teamName = ( playerTeam and getTeamName ( playerTeam ) or "" ) if not ( teamName == "LV MAFIA")then killPed(hitElement) --outputChatBox("You're not part of LV MAFIA Clan", hitElement) end end end addEventHandler("onColShapeHit", safeZone, killP)
-
you are using this in a render function?
-
you can multiply 4.25 by a value greater than 100, for example 4.25 * 100 = 425. the question is to play with the numbers. can you post the code where exactly the value 4.25 is defined?
-
convert 4.25 in whole number? I cant understand you very well.
-
you can also use createMarker ( float x, float y, float z, "cylinder" float size, 0, 0, 0, 255 ) -- change the alpha value to 0 to be invisible You can use the addEventHandler as input to the element. addEventHandler("onMarkerHit", marker, FUNCTION_NAME) -- server or if isElementWithinMarker ( element , marker ) then -- if the element is within the marker --- FUNCTIONS end
-
You can also with fileDelete.
-
No need to add several times 'addEvent' when you apply a custom event.
-
addEvent Allows you to enter a custom event which work exactly the same ways that the wiki.