-
Posts
1,058 -
Joined
-
Last visited
-
Days Won
1
Everything posted by Saml1er
-
I thought of adding it but I thought maybe the client downloads it and is auto saved. : D Anyway I'm on mobile now so to make it work correctly use fileCreate.
-
Client side fetchRemote ( "www.TheDirectLinkToDFFoRtxdFILE.com/blahblah/file.txd", ReturnVal, "", false ) -- lets try downloading txd file from a direct link function ReturnVal( returnedDATA, errno ) if errno == 0 then _MyTxd = engineLoadTXD (returnedDATA) engineImportTXD ( _MyTxd, 1564 ) -- make sure you replace 1564 with the value you want else outputChatBox ("OMG DOWNLOADING FAILED DUE TO: "..errno) end end Not tested. If it doesn't work then please try /debugscript 3 and tell me what does it outputs.
-
I'd suggest you to unload the file after the at after end because you sometimes it might take time to load the file and you'll face errors ( I'm saying this because I myself have experienced this. ) function rozpoczynaMisje (pickupid) local pliczek = xmlLoadFile("quests/misje.xml") if pliczek then local zapisz = xmlFindChild(pliczek, "pickup"..tostring(pickupid)) local kto_da = xmlFindChild(zapisz, "imie") local pickupek = xmlFindChild(zapisz, "pickupid") local ktodaje = xmlNodeGetValue(kto_da) else outputDebugString("[ERROR] Couldn't open 'quests/misje.xml'") end xmlUnloadFile(pliczek) -- unloading it after you're completely done with xml functions because you never know what happens. end
-
Actually you can Really? I've never even tested it but if thats true then why do we even use exports?
-
Well idk but maybe try this: for _,v in ipairs (getElementsByType("object") do if isPedInVehicle ( localPlayer ) then local veh = getPedOccupiedVehicle ( localPlayer ) setElementCollidableWith (veh, v, true ) -- enable the collision else setElementCollidableWith (localPlayer, v, true ) end end
-
Check out this: http://blog.doh.ms/2008/02/12/adding-te ... -with-php/ Its really helpful. It won't even take you 5 mins you make it if you know php basics. I'm not an expert tho but I know some basics like we use $ before variables ( can be underscores as well but not numbers ) and we use brackets for every if statement and ";" symbol after every function. Well you see you can use MysQL to save data from MTA and you can access the same data from your website and voila you can render the text using real time. I want to help you with this but like I said I'm not an expert so I'll need to make a lot of tests for that and since I don't have time for that but anyway Good Luck.
-
Use --- [/code] --- ------- [code=lua] ----script-----
-
Are you calling the function? local models = {[2175]=true, [2190]=true,[2009]=true,[2008]=true,[11631]=true,[2198]=true,[2172]=true,[2193]=true,[2165]=true,[1998]=true,[1999]=true} function pcText(model) -- what does this model do? local objects = getElementsByType("object") for _, object in ipairs(objects) do if (models[getElementModel(object)]) then setElementData(object, "message", "Computer") end end end pcText()
-
Replace your code with mine and tell me what does it debugs. function bindRankInfo(player) local accountPlayer = getPlayerAccount(player) local rank = getAccountData(accountPlayer, "Rank") if (rank) then else setAccountData(accountPlayer, "Rank", "Novice") end local deliveries = getAccountData(accountPlayer, "deliveries") if (deliveries) then else setAccountData(accountPlayer, "deliveries", "0") end local team = getPlayerTeam(player) local teamName = getTeamName(team) if ( teamName == "Freight") then if triggerClientEvent(player,"rankShow", player, tostring(deliveries), tostring( rank) ) then outputDebugString(' Event rankShow has been triggered with data: '..tostring(deliveries)..', '..tostring(rank)) end end end function binding() bindKey(source,"F5", "up", bindRankInfo) end addEventHandler("onPlayerJoin", getRootElement(), binding) outputDebugString('Server side: Code Loaded!') client: function jobRankInfo(arg1, arg2) outputDebugString('Client side: Data has been sent from server to client side!') guiSetVisible(GUIEditor.window[2], not guiGetVisible(GUIEditor.window[2])) guiSetText(GUIEditor.label[1], "Your Current Deliveries are :-".. arg1 .." You Rank:-".. arg2) guiSetInputEnabled(not guiGetInputEnabled) showCursor ( not isCursorShowing ()) end addEvent("rankShow", true) addEventHandler("rankShow", getRootElement(), jobRankInfo) outputDebugString('Client side: Code Loaded!') If still this doesn't work then go to your server and login ( you must be an admin ) and type /debugscript 3
-
Server side to client side : triggerClientEvent(player,"rankShow", player, deliveries, rank) Client to server side: triggerServerEvent("rankShow", localPlayer, arg1,arg2,arg3,...)
-
local str = "SW_GMC_HD_SMTH" local str2 = string.gsub (str, "_", "," ) -- replacing underscores with comma -----[[ I'm not sure if gsub works like this since I rarely used this function ]]---- local str3 = split(str2,string.byte(",")) -- splitting it and inserting it into table for _,v in ipairs (str3) do print (v) -- > SW --> GMC --> HD --> SMTH end Not tested.
-
This is not a bug. This is how lua works. When you download lua program for windows. We make resource in its root folder just like in mta and the main purpose for a resource is that the data doesn't mess up together.
-
TriggerEvent functions works inside a resource. You can't trigger events in other resources so for this purpose we use exports or this call function.
-
https://wiki.multitheftauto.com/wiki/Call
-
I'm 100 % sure this is a total scam and even if you have it then the script might be bugged and since its not yours then why are you even selling it? I think this is leaked.
-
With what? Just copy this: addEventHandler("onPlayerLogin",root,function(_,curAcc) local team = getAccountData(curAcc,"team") setPlayerTeam(source,getTeamFromName ( team )) if tostring(team) == "Team1" then skin = 100 elseif tostring(team) == "Team2" then skin = 101 elseif tostring(team) == "Team3" then skin = 102 elseif tostring(team) == "Team4" then skin = 103 end outputChatBox (team) spawnPlayer(source,0,0,0+ 0.5,0, skin) end )
-
But its not a requirement.
-
And what if someone writes "HelloWorld!10" then tonumber won't work in such case so it will give him error when he is using createVehicle.
-
_yoBox = guiCreateEdit( 0.3, 0.1, 0.4, 0.1, "10", true ) local VehID = tonumber ( guiGetText ( _yoBox ) ) -- <-- < -- tonumber () will try to convert the string into a number if type (VehID) == "number" then outputChatBox ( VehID ) --<--<--< This will output the vehicle ID end
-
Many scripters receive donations who have their own servers. Nice try.
-
How much will you pay for a whole gamemode?
-
I never said you can do it without maths. :]
-
createProjectile You don't only needs math for this but in fact you must be quite skilled to make something like that. I'm not saying one can't script it but let me remind you its not that easy because the rockets can also hit buildings but not sure if you can use setElementPosition but I don't think that will work but I personally like myonlake idea, I'll try if I can make something like this.
