-
Posts
6,063 -
Joined
-
Last visited
-
Days Won
208
Everything posted by IIYAMA
-
Ah you are talking about the player element. The player element can't be destroy, See wiki: The best way is using: setElementPosition() to a position which can't be reached.
-
Yes some things and learn from those changes. and if it isn't working as you want, you should explain better.
-
We all are giving the same answers except with more/other details. It is only a bit sadly, that I get performance lessons for tables, but ok I haven't seen that big-o page which is interesting.
-
@ myonlake Of course it may takes longer when there are more items in it. I have tested the differences a year ago and still it elementdata takes 1000 t/m 10000 times longer. Also I didn't said that elementdata was wrong, I only said: "When you use it for all things", it will lagg the connection. If you are familiar with the server mini-mission server, it's syncs are partly destroyed by it. So it isn't true it can't lagg.
-
A LOT, addEventHandler("onPlayerWasted", root, function () local player = source local account = getPlayerAccount (player) if not isGuestAccount ( account) then local rankss = (getAccountData(account, "Race Loses") or 0)+1 if rankss >= 0 then if (rankss <= 4) then if getElementData(player,"Rank") ~= "R1" then setElementData(player,"Rank","R1") end elseif (rankss <= 10) then if getElementData(player,"Rank") ~= "R2" then setElementData(player,"Rank","R2") end elseif (rankss <= 249) then if getElementData(player,"Rank") ~= "R3" then setElementData(player,"Rank","R3") end elseif (rankss <= 499) then if getElementData(player,"Rank") ~= "R4" then setElementData(player,"Rank","R4") end end end setAccountData(account,"Race Loses",rankss) end end)
-
I only read that the resource has been taken by some player when he gets on the top of a vehicle? Are you talking about a car window or about a gui window? Is this google translator?
-
AFAIK it has been designed to share efficient data/score between clients. When you use it for all things it will lagg the server and I know you are going to use it for everything, it is simply a starter habbit. I will recommend you to stay with those tables, because they are the most powerful/fasted/optimised scripting way. Simply because they are part of lua, when other things are just extended functions from mta. Next to saving in tables, your code can be shorter(writing less code) for the same result.
-
Why not up date the rank at the moment you are losing/winning? Okay! Can you show an example ? Write the same code as at your first post, only at the place were the score get set. No example needed...
-
Create/destroy, objects on clientside. And you have simply no limit, except you want 200,000 objects in a range of 300 units. As CrystalMV said: http://wiki.sa-mp.com/wiki/Limits Objects: 1000 MTA: It is 65535 elements which are also represents vehicles/players/peds/ markers etc.
-
Why not up date the rank at the moment you are losing/winning?
-
Scripten voor roleplay servers is niet leuk meer wegens het aantal gamemode leaks. Sorry.
-
@manve1 or why don't call the lua variables(tables) instead... instead of those memory eaters. Loading every time a xml list of 1000+ players.... Sql and mysql for permanent saving. Tables for temporary. The rest have differed functionary's. XML: Saving settings for scripts serverside, saving cookies clientside. Elementdata: Usefull for sharing score with other players and server.
-
You really think mta let you do that?
-
and how do you want to do it then? -_-" You can't expect it to change doors from a vehicle that is inside your head.
-
local updateRatio = function (Scrolled) local position = guiScrollBarGetScrollPosition(Scrolled) local door = getElementData(Scrolled, "Type") local vehicle = getPedOccupiedVehicle ( localPlayer )-- get it's vehicle if vehicle and door and position then -- check if all the data is there. triggerServerEvent ("openDoorOrClose",vehicle,door, position) -- start sending. end end addEventHandler("onClientGUIScroll", root, updateRatio)
-
it seems the variable vehicle is not defined. How do you get this vehicle in the first place? (the vehicle that you want to change)
-
URL isn't a sound element. I am not sure if streamed data contains that kind of information. But you can always try. table = getSoundMetaTags ( element sound ) local sound =playSound ("URL") local table = getSoundMetaTags (sound )
-
local repairTime = (1000 - health)* 120 if repairTime >= 50 then -- timers can't start with time lower then 50 ms repairTimer[veh] = setTimer(fixVehicleDayZ, repairTime, 1, veh, source) setPedAnimation(source, "SCRATCHING", "sclng_r", repairTime, true, false)-- doing an animation for the required time else fixVehicleDayZ(veh, source) end addEvent("repairVehicle", true) addEventHandler("repairVehicle", getRootElement(), repairVehicle) function fixVehicleDayZ(veh, player) if isElement(veh) and isElement(player) then -- important to prevent errors. (players can leave during the game and vehicles can be destroyed during the game. Which will cause errors when you put delays(timers) between functions. removeElementData(veh,"repairer") -- better then set to nil removeElementData(player,"repairingvehicle") For the second part: The variables: siting and lying are globals which means that all players that execute this script are using them, which will cause problems since they share them. The function: function setVisibility() value = 0 end Has never been called and should not be there in the first place.
-
Hmmmzzz. really hard question, I never tried to disable the chatbox. Can't you cancel the messages at the moment the input is disabled?
-
and why not? Show your code.
-
Wiki isn't always clear, (programmers language) Client = Your pc. ( client scripts will be send to your pc and your pc will execute them) Server = Will only be executed on the server(hoster) and won't be downloaded by: you, myonlake and me. And yes, follow the links of myonlake. If you don't understand it, you can always discus that here.
-
setTimer( guiProgressBarSetProgress, 5000, 1,GUIEditor.progressbar,lol+10 ) setTimer( guiProgressBarSetProgress, 10000, 1,GUIEditor.progressbar,lol+20 ) setTimer( guiProgressBarSetProgress, 15000, 1,GUIEditor.progressbar,lol+30 ) setTimer( guiProgressBarSetProgress, 20000, 1,GUIEditor.progressbar,lol+40 ) setTimer( guiProgressBarSetProgress, 25000, 1,GUIEditor.progressbar,lol+50 ) setTimer( guiProgressBarSetProgress, 30000, 1,GUIEditor.progressbar,lol+60 ) setTimer( guiProgressBarSetProgress, 35000, 1,GUIEditor.progressbar,lol+70 ) setTimer( guiProgressBarSetProgress, 40000, 1,GUIEditor.progressbar,lol+80 ) setTimer( guiProgressBarSetProgress, 45000, 1,GUIEditor.progressbar,lol+90 ) setTimer( guiProgressBarSetProgress, 50000, 1,GUIEditor.progressbar,lol+100 ) How many timers are you going to set? Jesus! You have no idea how many lagg that will cause, when you write every script like that. Or do you ? setTimer(function() lol = lol+10 guiProgressBarSetProgress(GUIEditor.progressbar,lol) end,5000, 10)
-
You can stop an animation with: setPedAnimation (source,false) But as far as I know, when you set another animation it will overwrite the other one. Is that what you mean? Because your question is very unclear, to everybody.
-
local allowedDoors = {[0]=true,[1]=true,[2]=true,[3]=true,[4]=true,[5]=true} local openDoor = function (door, position) outputChatBox(tostring(door) .. " " .. tostring(position)) -- debugging........ door,position = tonumber(door), tonumber(position) if isElement(source) and door and position and allowedDoors[door] then if position>=0 and position<=100 then setVehicleDoorOpenRatio(source, door, position/100, 1000) end elseif isElement(client) then outputChatBox("something went wrong",client) end end addEvent("openDoorOrClose", true) addEventHandler("openDoorOrClose", root, openDoor) How did you call it? If this doesn't output anything, then you are calling it wrong, if it does then you know what you are doing wrong with delivering the data. It should look like this: triggerServerEvent ("openDoorOrClose",vehicle,door, position) Also see line 4, that is the best way how you can debug your script. Use the tostring() function to prevent errors during the debugging. Know what kind of data is flowing through your system with: type() function. variable = true outputChatBox(tostring(variable)) -- true outputChatBox(type(variable))-- boolean (true or false) and pls no sad looking smilies, you can't expect code starts working at ones.