Jump to content

raynner

Members
  • Posts

    223
  • Joined

  • Last visited

Everything posted by raynner

  1. I would be very happy to do this my own f11 but unfortunately as I said I am not very experienced in this area of radar, hud's, maps .. But you gave me an idea..
  2. The question is how to access and replace them
  3. I already saw I tried but I did not like it, I did not like it ...
  4. Hello everyone, I am creating a rpg server and I would like to use the blip Id 42 to be able to mark the places of work but I would like to replace it with a new image so I was searching the forum and found something that helped me more n me I leave satisfied Client Sid function ReplaceBlipInTakeJob() for key,hud in ipairs(huds) do texShader = dxCreateShader ( "shader/shader.fx" ) createdHud = dxCreateTexture("img/hud/"..hud..".png") dxSetShaderValue(texShader,"gTexture",createdHud) engineApplyShaderToWorldTexture(texShader,tostring(hud)) end end addEvent("StartJobId",true) addEventHandler("StartJobId",root,ReplaceBlipInTakeJob) shader.fx texture gTexture; technique TexReplace { pass P0 { Texture[0] = gTexture; } } So my problem is that he even did replace the blip more only on the radar and not on the F11 map Anyone could help me with this I have no experience in radar or shaders and .fx
  5. raynner

    a function

    this should be one of the easiest to use try to use it local screenW,screenH = guiGetScreenSize() local resW, resH = 1280,720 -- resolution creating the dxDraw local x, y = (screenW/resW), (screenH/resH) -- just add. -- x*width, y*height ... dxDrawRectangle(x*303, y*158, x*579, y*27, tocolor(0, 255, 150, 255), false) ------ dxDrawText("Your Text", x*303, y*158, x*882, y*185, tocolor(255, 255, 255, 255), x*1.00, "default-bold", "center", "center", false, false, false, false, false)
  6. as I said review your script and see if this using "local" correctly .. EX: local banlist can be the error check .. and my eyes his mistake is where I spoke using account's function's in client sid
  7. Oh ok .. just gave you information from the MTA Wiki functions ..
  8. I know your error is related to line 5 and 10 and perhaps 6 ... good I'm pretty sure that your mistake is that ... try only proofread your script and use "local" has correctly places I n said more are still wrong as lobby_c.lua (client side) line 1 arenaban_s.lua (server side) line 1 function checkArenaBan(player, account, arena) account = nil value.. therefore "account" line 5 as well. -- error here. triggerServerEvent("checkArenaBan", _local, _local, getAccountNamePlayer(_local), getElementID(arena.Element)) -- try to create a variable to " getAccountNamePlayer(_local) " account = getAccountNamePlayer(_local) . -- and also arena = getElementID(arena.Element) -- use triggerServerEvent("checkArenaBan", _local, _local, account, arena) Another thing I could not help but notice is that you did something totally wrong in my eyes ... you are wearing triggerServerEvent() to call the function lobby_c.lua (client side) another serious error. GetAccountName() -- It can only be used on Server Sid use this will work better. getAccountName(getPlayerAccount(Player Here))
  9. Resolved will share if others will need ... function VerificHoraID4() h,m = getTime() if (h >= 0) and (h <= 9.59) then h = '0'..h..'' end if (m >= 0) and (m <= 9) then m = '0'..m..'' end hour = ''..h..'.'..m..'' if (tonumber(hour) >= 08.45) and (tonumber(hour) <= 11.10) then guiGridListSetItemText(GridListPizzaBoyLS, 6, 1, "7", false,false) guiGridListSetItemText(GridListPizzaBoyLS, 6, 2, "Banco Rodeo (LS)", false,false) guiGridListSetItemText(GridListPizzaBoyLS, 6, 4, "08:45 às 11:10", false,false) guiGridListSetItemText(GridListPizzaBoyLS, 6, 3, "Pizzaria De Los Santos", false,false) guiGridListSetItemText(GridListPizzaBoyLS, 6, 5, "100", false,false) -------------------------------------------------------------------------------------- guiGridListSetItemColor(GridListPizzaBoyLS, 6, 1, 0, 255, 0, 255, false, false) guiGridListSetItemColor(GridListPizzaBoyLS, 6, 2, 0, 255, 0, 255, false, false) guiGridListSetItemColor(GridListPizzaBoyLS, 6, 3, 0, 255, 0, 255, false, false) guiGridListSetItemColor(GridListPizzaBoyLS, 6, 4, 0, 255, 0, 255, false, false) guiGridListSetItemColor(GridListPizzaBoyLS, 6, 5, 0, 255, 0, 255, false, false) else guiGridListSetItemText(GridListPizzaBoyLS, 6, 1, "7", true,false) guiGridListSetItemText(GridListPizzaBoyLS, 6, 2, "Hospital Market (LS)", true,false) guiGridListSetItemText(GridListPizzaBoyLS, 6, 4, "08:45 às 11:10", true,false) guiGridListSetItemText(GridListPizzaBoyLS, 6, 3, "Pizzaria De Los Santos", true,false) guiGridListSetItemText(GridListPizzaBoyLS, 6, 5, "73", true,false) -------------------------------------------------------------------------------------- guiGridListSetItemColor(GridListPizzaBoyLS, 6, 1, 255, 255, 0, 255, false, false) guiGridListSetItemColor(GridListPizzaBoyLS, 6, 2, 255, 255, 0, 255, false, false) guiGridListSetItemColor(GridListPizzaBoyLS, 6, 3, 255, 255, 0, 255, false, false) guiGridListSetItemColor(GridListPizzaBoyLS, 6, 4, 255, 255, 0, 255, false, false) guiGridListSetItemColor(GridListPizzaBoyLS, 6, 5, 255, 255, 0, 255, false, false) end end setTimer(VerificHoraID4,50,0)
  10. I really have no idea if it will resolve but try to change that. -- remove this. addEvent("checkArenaBan", true) addEventHandler("checkArenaBan", getLocalPlayer(), function (returned) if returned == "true" then isPlayerBannedFromArena = "true" else isPlayerBannedFromArena = "false" end end) -- and use this addEvent("checkArenaBan", true) addEventHandler("checkArenaBan", getLocalPlayer(), function (returned) if returned == "true" then isPlayerBannedFromArena = true else isPlayerBannedFromArena = false end end) -- be sure to check this way now if isPlayerBannedFromArena == true then --.... Another error in your code is this. function checkArenaBan(player, account, arena) if fileExists("general/banlist.xml") == false then return false end local banlist = xmlLoadFile("general/banlist.xml") for i, m in ipairs(xmlNodeGetChildren(banlist)) do if xmlNodeGetAttribute(m, "account") == account and xmlNodeGetAttribute(m, "arena") == arena then xmlUnloadFile(banlist) local returned = "true" triggerClientEvent(player, "checkArenaBan", player, returned) else xmlUnloadFile(banlist) local returned = "false" triggerClientEvent(player, "checkArenaBan", player, returned) end end end addEvent("checkArenaBan", true) addEventHandler("checkArenaBan", getRootElement(), checkArenaBan) -- error. local returned = "true" or local returned = "false" -- you must remove the "local". -- right. returned = "true" and returned = "false" -- use this preference. returned = true and returned = false -- be sure to check this way now if returned == true then or if returned == false then --.. you must remove "local"..
  11. good finally you can create a script using. addCommandHandler("Command",functionNameHere) --.... kickPlayer() --Please note that this can only be used in serving sid You will need to give permission to your script in order to use the function kickPlayer. You can do this by simply adding in your admin group (resource.resourcename) or .. add it in the goal of your script meta.XML <aclrequest> <right name="function.function.kickPlayer" access="true" /> </aclrequest> use this command in cmd or manually do to give permission to your script. command. this will help to do what you want it will only tell something in the chat if you use outputChatBox .. or have any script that uses OnClientPlayerQuit justifying reason to kick. fontes: https://wiki.multitheftauto.com/wiki/KickPlayer https://wiki.multitheftauto.com/wiki/AddCommandHandler
  12. more tests done and this was what came closest to success having just as the failure tonumber starts counting from 1 and not the 0 that is with the lack of just 0 occurring error does anyone have a light? local h,m = getTime() local hour = ''..h..'.'..m..'' if (tonumber(hour) >= 8.45) and (tonumber(hour) <= 11.11) then guiGridListSetItemText(GridListPizzaBoyLS, 6, 1, "7", false,false) guiGridListSetItemText(GridListPizzaBoyLS, 6, 2, "Banco Rodeo (LS)", false,false) guiGridListSetItemText(GridListPizzaBoyLS, 6, 4, "08:45 às 11:10", false,false) guiGridListSetItemText(GridListPizzaBoyLS, 6, 3, "Pizzaria De Los Santos", false,false) guiGridListSetItemText(GridListPizzaBoyLS, 6, 5, "100", false,false) -------------------------------------------------------------------------------------- guiGridListSetItemColor(GridListPizzaBoyLS, 6, 1, 0, 255, 0, 255, false, false) guiGridListSetItemColor(GridListPizzaBoyLS, 6, 2, 0, 255, 0, 255, false, false) guiGridListSetItemColor(GridListPizzaBoyLS, 6, 3, 0, 255, 0, 255, false, false) guiGridListSetItemColor(GridListPizzaBoyLS, 6, 4, 0, 255, 0, 255, false, false) guiGridListSetItemColor(GridListPizzaBoyLS, 6, 5, 0, 255, 0, 255, false, false) end
  13. I did not understand very well what you wanna do :/
  14. I must admit that you thought too much using your code and still making several changes still had errors with delay by checking the 'm' in (45 or 30 etc ...) (if I do it this way when time and lower it n checks properly ..) I have to check the two together as hour: minute unseparated as hour and minute. I use "^" might work ... It has to be something like if (h.m >= 08.45) and (h.m <= 11.10) then more that says .. attempt to index local 'h' (a number value) you know any way to measure the entire time without separating them?
  15. Hello good friends I'm already more than 6 hours puzzling over this and tried in many ways and could not carry out the repair . For this reason I have come to ask for help from you, good is simple I'm doing a pizzaboy work for my rpg server ... and wanted some deliveries is without available in just a few hours .. see the code is easy to understand .. I will comment on the problems below. local screenW,screenH = guiGetScreenSize() local resW, resH = 1280,720 local x, y = (screenW/resW), (screenH/resH) --===================================================================[[Basicos]]===================================================================-- GridListPizzaBoyLS = guiCreateGridList(x*313, y*272, x*559, y*273, false) guiGridListAddColumn(GridListPizzaBoyLS, "ID", x*0.07) guiGridListAddColumn(GridListPizzaBoyLS, "Local", x*0.30) guiGridListAddColumn(GridListPizzaBoyLS, "Disponível em", x*0.28) guiGridListAddColumn(GridListPizzaBoyLS, "Disponibilidade das", x*0.20) guiGridListAddColumn(GridListPizzaBoyLS, "Lucro", x*0.09) guiGridListSetSortingEnabled(GridListPizzaBoyLS,false) guiSetVisible(GridListPizzaBoyLS,false) for i = 1, 30 do guiGridListAddRow(GridListPizzaBoyLS) end function VerificHourID1() -----------------------------------------------[[ 1 ]]----------------------------------------------- ----- ID 1 if (getTime() >= 00.00) and not (getTime() >= 02.00) then guiGridListSetItemText(GridListPizzaBoyLS, 0, 1, "1", false,false) guiGridListSetItemText(GridListPizzaBoyLS, 0, 2, "Pershing Square (DP) (LS)", false,false) guiGridListSetItemText(GridListPizzaBoyLS, 0, 4, "00:00 às 02:00", false,false) guiGridListSetItemText(GridListPizzaBoyLS, 0, 3, "Pizzaria De Los Santos", false,false) guiGridListSetItemText(GridListPizzaBoyLS, 0, 5, "60", false,false) -------------------------------------------------------------------------------------- guiGridListSetItemColor(GridListPizzaBoyLS, 0, 1, 0, 255, 0, 255, false, false) guiGridListSetItemColor(GridListPizzaBoyLS, 0, 2, 0, 255, 0, 255, false, false) guiGridListSetItemColor(GridListPizzaBoyLS, 0, 3, 0, 255, 0, 255, false, false) guiGridListSetItemColor(GridListPizzaBoyLS, 0, 4, 0, 255, 0, 255, false, false) guiGridListSetItemColor(GridListPizzaBoyLS, 0, 5, 0, 255, 0, 255, false, false) end if (getTime() >= 02.00) then guiGridListSetItemText(GridListPizzaBoyLS, 0, 1, "1", true,false) guiGridListSetItemText(GridListPizzaBoyLS, 0, 2, "Pershing Square (DP) (LS)", true,false) guiGridListSetItemText(GridListPizzaBoyLS, 0, 4, "00:00 às 02:00", true,false) guiGridListSetItemText(GridListPizzaBoyLS, 0, 3, "Pizzaria De Los Santos", true,false) guiGridListSetItemText(GridListPizzaBoyLS, 0, 5, "60", true,false) -------------------------------------------------------------------------------------- guiGridListSetItemColor(GridListPizzaBoyLS, 0, 1, 255, 255, 0, 255, false, false) guiGridListSetItemColor(GridListPizzaBoyLS, 0, 2, 255, 255, 0, 255, false, false) guiGridListSetItemColor(GridListPizzaBoyLS, 0, 3, 255, 255, 0, 255, false, false) guiGridListSetItemColor(GridListPizzaBoyLS, 0, 4, 255, 255, 0, 255, false, false) guiGridListSetItemColor(GridListPizzaBoyLS, 0, 5, 255, 255, 0, 255, false, false) end end addEventHandler("OnClientPreRender",root,VerificHourID1) --- function VerificHourID2() -----------------------------------------------[[ 2 ]]----------------------------------------------- if (getTime() >= 01.00) and not (getTime() >= 02.30) then guiGridListSetItemText(GridListPizzaBoyLS, 2, 1, "3", false,false) guiGridListSetItemText(GridListPizzaBoyLS, 2, 2, "Hospital Jefferson (LS", false,false) guiGridListSetItemText(GridListPizzaBoyLS, 2, 4, "01:00 às 02:30", false,false) guiGridListSetItemText(GridListPizzaBoyLS, 2, 3, "Pizzaria De Los Santos", false,false) guiGridListSetItemText(GridListPizzaBoyLS, 2, 5, "80", false,false) -------------------------------------------------------------------------------------- guiGridListSetItemColor(GridListPizzaBoyLS, 2, 1, 0, 255, 0, 255, false, false) guiGridListSetItemColor(GridListPizzaBoyLS, 2, 2, 0, 255, 0, 255, false, false) guiGridListSetItemColor(GridListPizzaBoyLS, 2, 3, 0, 255, 0, 255, false, false) guiGridListSetItemColor(GridListPizzaBoyLS, 2, 4, 0, 255, 0, 255, false, false) guiGridListSetItemColor(GridListPizzaBoyLS, 2, 5, 0, 255, 0, 255, false, false) elseif (getTime() >= 02.30) then guiGridListSetItemText(GridListPizzaBoyLS, 2, 1, "3", true,false) guiGridListSetItemText(GridListPizzaBoyLS, 2, 2, "Hospital Jefferson (LS)", true,false) guiGridListSetItemText(GridListPizzaBoyLS, 2, 4, "01:00 às 02:30", true,false) guiGridListSetItemText(GridListPizzaBoyLS, 2, 3, "Pizzaria De Los Santos", true,false) guiGridListSetItemText(GridListPizzaBoyLS, 2, 5, "80", true,false) -------------------------------------------------------------------------------------- guiGridListSetItemColor(GridListPizzaBoyLS, 2, 1, 255, 255, 0, 255, false, false) guiGridListSetItemColor(GridListPizzaBoyLS, 2, 2, 255, 255, 0, 255, false, false) guiGridListSetItemColor(GridListPizzaBoyLS, 2, 3, 255, 255, 0, 255, false, false) guiGridListSetItemColor(GridListPizzaBoyLS, 2, 4, 255, 255, 0, 255, false, false) guiGridListSetItemColor(GridListPizzaBoyLS, 2, 5, 255, 255, 0, 255, false, false) end end addEventHandler("OnClientPreRender",root,VerificHourID2) setTimer(VerificHourID2,50,0) Note: I know I should not use "onClientPreRender" GUI .. more as you may have noticed it also contains a SetTimer result of tests .. Well my problem this ID 1 item works perfectly but the other (when all are 10) do not work correctly, or they just do not create yellow and green just ... it was probably some my mistake (or why not reviewed and redid these lines more than 5 times), and the biggest mistake he demonstrates one hour of delay that is elseif (getTime ()> = 30.2) then then it is only yellow 03:00 ... Note: I tried to use tb onClientRender and SetTimer and had the same result.
  16. Oh ok thank man I will test it soon
  17. Hello everyone I currently have this function that develops, and some time and I wanted to make a change most do not know it as good is simple. local positions = { { 371, -2040, 8 }, { 2274, -1036, 52 }, { -2245, -1723, 482 }, { -155, -2889, 428 }, } function DisappearPlayer (NamePlayer, Admin) local azar = math.random ( #positions ) local veh = getPedOccupiedVehicle(NamePlayer) if (veh) then setElementPosition(veh, unpack ( positions [ azar ] ) ) else setElementPosition(NamePlayer, unpack ( positions [ azar ] ) ) end end addEvent("random",true) addEventHandler("random",getRootElement(),DisappearPlayer) This teleports the player into a random position map using a table of coordinates. Ok everything works perfectly. But I wanted it stores up the item from the table that has already been used and not used again until the last was used or the successor. Ex local positions = { { 1 }, { 2 }, { 3 }, { 4 }, } function DisappearPlayer (NamePlayer, Admin) local azar = math.random ( #positions ) local veh = getPedOccupiedVehicle(NamePlayer) if (veh) then setElementPosition(veh, unpack ( positions [ azar ] ) ) else setElementPosition(NamePlayer, unpack ( positions [ azar ] ) ) end end addEvent("random",true) addEventHandler("random",getRootElement(),DisappearPlayer) so that happens. 3,3,2,1,3,4,4 way I wanted it occurs. 3.1.2.4 or 3.2.3.1.3 in a way that the same n repeita then! Anyone know how to do?
  18. Oh OK thank you man more I talked to up already working perfectly still thank you: D
  19. Solved I was organizing the time the player would earn EXP for their level and I had an idea and just thinking about it, then I will share to help others function .....() if getElementData(source, "EXP") and getElementData(source, "LVL") then TotalNewEXP = (guiProgressBarGetProgress(XpBar)+ValuerEXP) if (TotalNewEXP >= 100) then GiveCorrectEXP = TotalNewEXP - 100 NEWXP = guiProgressBarSetProgress(XpBar,guiProgressBarGetProgress(XpBar) + ValuerEXP) setElementData(source, "EXP", NEWXP) else NEWXP = guiProgressBarSetProgress(XpBar,guiProgressBarGetProgress(XpBar) + ValuerEXP) setElementData(source, "EXP", NEWXP) end if guiProgressBarGetProgress(XpBar) ~= 100 then outputChatBox("#FFAA00||#FFFF00 #FFAA00||#00FF7B +"..ValuerEXP.." #FFFF00In #00FF7BEXP #FFFF00It was acquired by completing the mission. EXP Total#00FF7B "..guiProgressBarGetProgress(XpBar).."#FFFF00.",255,255,255,true) end if (guiProgressBarGetProgress(XpBar) == 100) then guiProgressBarSetProgress(XpBar, GiveCorrectEXP) guiProgressBarSetProgress(LevelBar,getElementData(source, "LVL")+1) LVL = guiProgressBarGetProgress(LevelBar) setElementData(source, "LVL", LVL) outputChatBox("#FFAA00||#FFFF00 #FFAA00||#FFFF00Your #00FF7BEXP #FFFF00We reached the maximum its level was raised to #00FF7B"..getElementData(source,"LVL").."#FFFF00.",255,255,255,true) end end end
  20. if getElementData(source, "EXP") and getElementData(source, "LVL") then ValuerEXP = 30 NEWXP = guiProgressBarSetProgress(XpBar,guiProgressBarGetProgress(XpBar) + ValuerEXP) ----- (guiProgressBarGetProgress(XpBar) = 80 + ValuerEXP = 30) = 110 end ---- if (guiProgressBarGetProgress(XpBar) == 100) then --- Here We have wasted 10 EXP ! :( --- ie the player has not received 30/30 Yes it is 20/30. guiProgressBarSetProgress(XpBar, 0) -- right is to take the leftovers in the case 10 guiProgressBarSetProgress(LevelBar,getElementData(source, "LVL")+1) end -- I wanted was to rescue this value in the case 10 and give her the inves set to 0
  21. esqueci de agradecer obrigado a todos <3
  22. Eu n entendi nada da explicação e n entendi ao certo oque você quer fazer no script o script eu entendi mais n consegui associar ele ao seu interesse !?
  23. Na verdade que quero evento n string .. quero eventos como onPlayerQuit etc.. mais quero um que verifique se o player wand "walk" corre " sprint " etc... eu estou criando um script de fome e queria que se o player caminha a fome diminua em uma certa velocidade e se correr de outra .
  24. I'm doing a script level system is almost ending but I got to a point where you really do not know how to do because I have a broad knowledge in Lua. Client. --Note Value EXP comes from Server Side in the original script ValuerEXP = 30 NEWXP = guiProgressBarSetProgress(XpBar,guiProgressBarGetProgress(XpBar) + ValuerEXP) Good to look at this and have one and are a good listener will soon notice that this is a serious mistake. good if ValuerEXP = 30 and suppose ProgressBar (XpBar) = 80 we would have a total value of 110 is therefore just ahead in the script I define it. if (guiProgressBarGetProgress(XpBar) == 100) then guiProgressBarSetProgress(XpBar, 0) guiProgressBarSetProgress(LevelBar,getElementData(source, "LVL")+1) end I wanted to have a way to get the total value divilo and pick up the spare and set this spare in the following function could anyone help me with this? the inves set to 0 somehow get the value of the spare take 110 if get the rest = 10 and definilo below the inves 0. because in this way that I am getting only 20 of 30 EXP promised. Help me
×
×
  • Create New...