Jump to content

bandi94

Members
  • Posts

    1,037
  • Joined

  • Last visited

Everything posted by bandi94

  1. bandi94

    DxDraw

    The "if / elseif" is again a bit wrong. elseif ( LV == 50 )then --- this will be executed if LV is nil , if LV is nil , you will compare nil with a number = error. Secound you can avoid this case when LV it will be nil. Also that the "if ( LV > 0 )" will handle every rank bk all LV's are bigger that 0 , so that LV == 50 will be never checked. addEventHandler ( 'onPlayerLogin', root, function( _, account ) local LV = tonumber( getAccountData( account, 'LV' ) or 0 ); if (LV >= 50 ) then setElementData ( source, 'Rankimage', ':Class/Rank/rank_50.png' ); elseif ( LV > 0 )then setElementData ( source, 'Rankimage', ':Class/Rank/rank_'..LV..'.png' ); else setElementData ( source, 'Rankimage', ':Class/Rank/rank_0.png' ); end end );
  2. Well , the error say's removeEventHandler. This line is a table selection and not "removeEventHandler" function. Are you shure this is line 281 ? And this is "LoginForm_Client.lua" ?
  3. Ok , thx. Well i made it how you tell , and i have a habit to make all variables "local" , i use global only when it is absolutely necessary. And the mapLoader is a standalone resource. So if there will be some mess up (very poor chances) it will mess only the client's map , what can be solved with a reconnect.
  4. Ohhh I have not seen that , thx again for the help
  5. And how can i filter what i need , and what i don't need ?
  6. Nope , then how can i loop copy them , bk i don't found anything about it on google.
  7. Working like a charm. setmetatable(sandbox_table, {__index = _G}) THX for the help.
  8. Well , it's working , in time i will need to add more functions from LUA function's. If anybody need something like this , here are all the client side functions and some LUA functions
  9. I read the wiki. But i will need to define all MTA/LUA functions , prity much work here to. sandbox_table.getLocalPlayer = getLocalPlayer sandbox_table.guiGetScreenSize = guiGetScreenSize ........ Well i will copy the client side function from Wiki , and make a batch script to make the jobb ( translate it as : sandbox_table.function = function ) And lett see if it will work.
  10. Well i dont have any other option to use , I must use loadString (custom maploader). After some small bug's i get it working very well. I just found out that a big part of FUN(shooter) map's , have an ugly check on start: if check == "done" return end well first load works , but secound time loadString keeps in the memory check == "done" from the first time , so secound time the script is not started bk of this check. I realy dont wanna check all maps 1 by 1 to find this checks and remove them. Is there any way to refres the variables to nil ( variables created/runed by LoadString ) ??????
  11. You need the start Y poz, then draw player name , then increase Y by the used font Height*1.5 , then draw the next player , and again increase Y and ...
  12. for i,player in pairs(getElementsByType("player")) do dxDraw(getPlayerName(player), ......) end
  13. Yep you were right , the "nil" was the problem , i just removed it and now it's working , THX
  14. Well it should , but that function will return all the timers , i need only timers from loadString and not other one's. I will try it without the nil line's
  15. I need to warp all timers created by loadString , to can kill them if it need to be. but it's not working like if i use: "setTimer(setVehicleFrozen,1000,1,vehicle,true)" i will get : Bad argument: @setVhecileFrozen. My best guest is that the function is not send to "func" as a pointer to the real function. local g_Timers = {} _setTimer = setTimer setTimer = function (func, a, b, c, d, e, f , g, h) if not c then c = nil end if not d then d = nil end if not e then e = nil end if not f then f = nil end if not g then g = nil end if not h then h = nil end local timer = _setTimer(func, a, b, c, d, e , f, g, h) if timer then g_Timers[#g_Timers+1] = timer return timer end end
  16. I made a custom map loader. Everything work's great until tuday I loaded a map , where normaly is an invisible way/road , but I I fell down (map was loaded by my loader). So i opened the .map file to check it out and i found something that I do not understand , if anybody made a loader like this or he knows better the .map file's , could tell me what are they and how they are loaded by defalut, THX And there is any wiki page , about .map file ???? where i can check every "option" of object's , i found a new thing : state="hidden" - i think this will make the object invisible , it would be great if somewhere i could check every thing that a .map can have as option. <controlPoint id="controlPoint (2)" powerLeft="80" dimension="0" powerRight="80" interior="0" posX="3853.599609375" posY="-1421.7998046875" posZ="10.199999809265" relativePosition="0,0,0" relativeRotation="0,0,-89.999992370605" representObject="object (vgncarshade1) (1)" rotX="0" rotY="0" rotZ="0"></controlPoint> , and a bunch of object's insde it. <track id="track (1)" objectNumber="80" controlPointLeft="controlPoint (2)" controlPointRight="controlPoint (3)" posX="0" posY="0" posZ="0" rotX="0" rotY="0" rotZ="0"> <object id="object (vgncarshade1) (3)" doublesided="false" model="3458" interior="0" dimension="0" posX="3857.5606053576" posY="-1421.8036329638" posZ="10.216789582423" rotX="0.48378672318565" rotY="0.014584549445561" rotZ="-90.10940267613"></object> <object id="object (vgncarshade1) (4)" doublesided="false" model="3458" interior="0" dimension="0" posX="3861.5730573265" posY="-1421.8149475623" posZ="10.267508722757" rotX="0.96291816776135" rotY="0.029891821549645" rotZ="-90.21248297119"></object> </track>
  17. bandi94

    Car locking

    Dirver's seat is 0. And yes that would work.
  18. CLIENT SIDE function isDeathmatchTeam () local gTeam = getPlayerTeam (localPlayer) local dmTeam = getTeamFromName("Deathmatch Arena") if ( gTeam and dmTeam ) then if ( gTeam == dmTeam ) then showPlayerHudComponent ( "ammo", true ) showPlayerHudComponent ( "weapon", true ) showPlayerHudComponent ( "radar", false ) else showPlayerHudComponent ( "ammo", false) showPlayerHudComponent ( "weapon", false ) showPlayerHudComponent ( "radar", true ) end end end addEventHandler("OnClientResourceStart", getRootElement(), isDeathmatchTeam)
  19. bandi94

    DxDraw

    Well , it's kinda funny the if/elseif make no sens. "if (LV >= 0) then" this "if" will be executed every time, why ? LV = 0 is LV == 0 (0==0) LV = 5 it's LV > 0 (5>0) LV=50 it's LV>0 ( 50 > 0) , so any of elseif will be never checked. to make it work you need to start from the back : if (LV >= 50) .... elseif (LV>= 45) ..... elseif (LV>=40) ..... Any way why using the bunch of if/else if , you could simply use : if (LV>=0 and LV <=50 ) setElementData ( source, "Rankicon", ":Class\\Rank\\rank_"..LV..".png" ) end
  20. That is not just a Lobby script , that is a race-multi gamemode scripted from 0. It's prity hard and take's much time , i am working on one to , finaly tuday i will open it for players and let's see how it work's , bk it is a big system with many bug's. I worked on it for almost 3 months and even now it's not a perfect system bk some bug's. So i don't think somebody will do it for you , if yes it will cost you about 300$. There are some users selling this Multi-modes for fev $ but they are stealed non working / full bugged scripts.
  21. Use Notepad++ 's "search in files" function. It will search for any word in all the .lua files in the selected folder and in subfolders
  22. bandi94

    Race Cam.

    Huh nobody ? I am realy going mad about this problem. I am searching for a fix day by day , and nothing .... I can't find anything in race that would fix this for race gamemode. And other problem i noticed is that when you are on a WallRide loop the camera will make a creazy 180 degree turn.
  23. That is a Custom made radar. Well it's pure math . Getting your Position and the other player's position , make some math on them and you will have the screen X,Y pos for every player , then you can check if player has hunter draw a hunter image if not draw a car image ...
  24. In 3D world / plan is Pitch / Yaw / Roll. They are the 3 axis rotation. Pitch = Y rot , Yaw = Z rot , Roll = X rot. In MTA for a better understanding they call'd them X,Y,Z rot , but in game coding they are call'd Pitch / Yaw / Roll and most of the time they are used on the Camera , Pitch / Yaw is look up-down , left-right , and Roll is used to tilt the camera in MTA one exemple would be the "drunk camera" where it get shake'd. And even now i can't imagine where you wanna use them.
×
×
  • Create New...