-
Posts
6,086 -
Joined
-
Last visited
-
Days Won
215
Everything posted by IIYAMA
-
now you got both
-
lol scripts or functions O_o
-
These are functions, did you ever made your functions local? (like the sample from a both)
-
"The only question that I have been asking my self, are local functions faster .?.?.?." then just a trigger,
-
NOT tested..... local myFunctions = {} -- store the functions myFunctions[1]= function (player)--CreateX if player then outputChatBox(getPlayerName(player) .. ", executed: CreateX") else outputChatBox("CreateX") end end myFunctions[2]= function (player)--CreateY if player then outputChatBox(getPlayerName(player) .. ", executed: CreateY") else outputChatBox("CreateY") end end myFunctions[3]= function (player)--CreateZ if player then outputChatBox(getPlayerName(player) .. ", executed: CreateZ") else outputChatBox("CreateZ") end end addEventHandler("onResourceStart",resourceRoot, function () local number = math.random(1,#myFunctions) -- a random number from 1 t/m the amount of functions in the table. myFunctions[number]() end) addEventHandler("onPlayerDamage",root, -- random event....... function () myFunctions[math.random(1,#myFunctions) ](source) -- compressed. end)
-
0? is 0 wanted stars? If you want that to check then yes. (elseif) if theWL == 0 then elseif theWL == 1 then -- if [b]not[/b] theWL == 0 then ---------> elseif theWL == 1 then end
-
if theWL == 1 then elseif theWL == 2 then elseif theWL == 3 then elseif theWL == 4 then elseif theWL == 5 then elseif theWL == 6 then end
-
if the theWL is higher then 6 then the source(player) will be set 6 times to another locations. + 6 timers running onPlayerDamage. I don't know what the use of that is. if theWL == 1 then This script also is going to overhead your mysql lite data base.(account data) Better to store it in the ram and update it in amount of time. (you are using the event onPlayerDamage)
-
ok, vanavond.
-
Ze kunnen wel open zijn. Maar mensen moeten wel binnen de poorten range joinen. @ wesleywillems17 Het hoeft niet in een brief formaat (indeling van je vorige bericht) maar mag wel.
-
dubbel op, hoeft ook weer niet. Ik heb hier al antwoord opgegeven.
-
De bovenste poort kan je beter dicht laten en anders moet je zeker een wachtwoord op je server zetten. Plaatjes zijn onleesbaar. Mensen moeten connecten met het ip dat je van (http://www.mijnip.nl) krijgt. Probeer maar te testen en het is aan te raden om niet je ip hier zo maar op een forum neer te zetten.
-
pls /debugscript 3 "object[source]" table does exist?
-
XML maybe for client data, but not for server data.
-
Well maybe you should mind the differences. -- why make a loop at clientside? You can't check other players their packetlossTotal at client side. for player, i in pairs --etc. -- server getNetworkStats(player) -- or player is nill for the server network. -- client getNetworkStats() - HD 7970 - CPU Type QuadCore Intel Core i7, 3700 MHz (37 x 100) (hyperthreading) - Module Name Corsair CML32GX3M4A1600C10 8 GB X 4 I am not laggy at all. Gta san is for that system a pathetic game. I am only play it, because I can modify it. But some people are playing at very weak pc's(especially laptops) . A little bit script performance would be welcome. I already told you that I use getTickCount()! I even use table(tickcount) timers to manage respawn from the players.
-
pls copie correctly. addEventHandler ( "onPlayerQuit", root, function (quiteType)--onPlayerQuit local playeraccount = getPlayerAccount(source) if not isGuestAccount ( playeraccount) then setAccountData(playeraccount,"number",exports.bone_attach:getElementBoneAttachmentDetails(object[source]) ) end end) addEventHandler ( "onPlayerLogin", root, function ()--onPlayerLogin local playeraccount = getPlayerAccount(source) local playermoney = exports.bone_attach:isElementAttachedToBone(object[source]) local number = getAccountData(playeraccount,"number") if playermoney then end end)
-
All players have an account, even the ones that did not login. but only people that aren't logged in do have a GuestAccount. (not login) if not isGuestAccount ( account ) then -- check if the player is logged in.
-
Try this: addEventHandler("onClientPreRender",root, function () local element= getPedContactElement ( localPlayer ) if element and getElementType(element)== "vehicle" and getControlState ("fire") then setControlState ( "fire", false) end end)
-
yep. https://wiki.multitheftauto.com/wiki/Ge ... actElement
-
Well there is something new: ( I haven't tried it yet) https://wiki.multitheftauto.com/wiki/SetObjectMass Maybe it helps, I don't think it will work with objects that can't be moved. You also can try: https://wiki.multitheftauto.com/wiki/MoveObject
-
-- Only check your self. addEventHandler("onClientPlayerDamage", getLocalPlayer(), myFunction) addEventHandler("onClientPlayerDamage", localPlayer, myFunction) -- the same. localPlayer = getLocalPlayer() --Yes getLocalPlayer()/localPlayer is only client. -- Check every single player. addEventHandler("onClientPlayerDamage", getRootElement(), myFunction) addEventHandler("onClientPlayerDamage", root, myFunction) -- the same. root = getRootElement()
-
You forgot the rotation. spawnPlayer(source,x,y,z+.5,0,tonumber(skin),0) spawnPlayer (thePlayer, x, y, z, rotation, skinID,interior ) Try this: function saveStats() local account = getPlayerAccount(source) if not isGuestAccount (account ) then local Skin = getElementModel(source) setAccountData (account,"CMG2.skin",tostring(Skin) ) local x,y,z = getElementPosition(source) setAccountData ( account, "CMG2.Xpos", x ) setAccountData ( account, "CMG2.Ypos", y ) setAccountData ( account, "CMG2.Zpos", z ) end end addEventHandler("onPlayerLogout",root,saveStats) addEventHandler("onPlayerQuit",root,saveStats) addEventHandler("onPlayerLogin",root, function ()--loadStats local account = getPlayerAccount(source) local skin = getAccountData (account,"CMG2.skin" ) local x,y,z = getAccountData ( account, "CMG2.Xpos" ),getAccountData ( account, "CMG2.Ypos" ),getAccountData ( account, "CMG2.Zpos" ) if x and y and z then spawnPlayer(source,x,y,z + 0.5,0,tonumber(skin) or 0,0) setCameraTarget(source) fadeCamera(source,true,2.5) else --spawnPlayer(source,0,0,999999) --setCameraTarget(source) --fadeCamera(source,true,2.5) end end)
-
I did test it, and yes. It disappears. I also checked if it had something to do with the ped. (with runcode) But no it isn't because of the ped, it is probably because after you scaled the object it got bugged. It have something to do with the distance from your camera to the object. But also the direction of the camera. and no you can't fix it, it is a gta san bug or maybe mta object scale bug. I will recommend you to remove your script from the forum. (else little kids will go play with it) Sorry that it can't be fixed. (I deleted the script from my pc)
-
You have this problem with all objects? ( not much wrong with the code, only not really build on performance ) Some other things I did noticed about your code. -- you said server side. addEventHandler("onClientResourceStart", getRootElement(),--onResourceStart function () setInteriorSoundsEnabled(false) end ); -- you only have to index this one time: (local value is faster than re-index global tables for every single thing.) local myObject = object[source] -- try to use "elseif" if a > 1 then -- if elseif a < 1 then -- if not "if a > 1 then", then check again. end