-
Posts
6,062 -
Joined
-
Last visited
-
Days Won
208
Everything posted by IIYAMA
-
airplanes_weapon\server.lua:58 Aborting; infinite running script in airplanes_weapons but it will go on for ever.
-
But it will still skip some data?
-
I have a problem with removing data from a table. When I use table.remove the table will automatic change. Sample: local A = createObject(...,...,...,..) local B = createObject(...,...,...,..) local myTable = {A,2,8,B} for i, v in ipairs (myTable) do if not isElement( vehicle ) then table.remove(myTable,i) end end When I do this: -- {A,2,8,B} -- First loop A won't be removed because it is an element. Next 2 is a number so will be removed. (i=2)* 8 will be at location [2] because of table.remove(myTable,i=2)*. But 8 since is there.... he won't remove Index during table.remove What is the best way to solve this?
-
Well I am very interesting in weapon syncs so, yes I did try. I tried the easy way, the way without all those special lines for locating the sniper. --client addEventHandler ( "onClientRender", root, function () if getControlState ("aim_weapon" ) then if getPedWeapon (getLocalPlayer ())== 34 then setControlState ( "zoom_out", true )--zoom_in.... -_-" setControlState ( "aim_weapon", true) end end end) but it worked out very strang, I am not sure if the same happens to you. First I added zoom_in, but some how this script zoomed out... so I used zoom_out instead... and this ..... script started to zoom in for me. wtf! ------------------ but a harder way: --server setWeaponProperty(34,"pro","flags",0x000008) --client addEventHandler ( "onClientRender", root, function () local player = getLocalPlayer () if getPedWeapon (player)== 34 then if getControlState ("aim_weapon" ) then local xs, ys, zs = getPedWeaponMuzzlePosition ( player ) local xe, ye, ze = getPedTargetEnd(player) --getPedRotation(player) setCameraMatrix ( xs, ys, zs, xe, ye, ze) setControlState ( "aim_weapon", true) dxDrawLine3D ( xs, ys, zs, xe, ye, ze, tocolor(255,0,0,255), 1, false, 1 ) elseif getCameraTarget (player)~= player then setCameraTarget ( player ) end end end) ------------- --server setWeaponProperty(34,"pro","flags",0x000008) --client addEventHandler ( "onClientRender", root, function () local player = getLocalPlayer () if getPedWeapon (player)== 34 then if getControlState ("aim_weapon" ) then --if getControlState ("fire" ) then local xs, ys, zs = getPedWeaponMuzzlePosition ( player ) local xe, ye, ze = getPedTargetEnd(player) --getPedRotation(player) --setCameraMatrix ( xs, ys, zs, xe, ye, ze) -- setControlState ( "aim_weapon", true) dxDrawLine3D ( xs, ys, zs, xe, ye, ze, tocolor(255,0,0,255), 1, false, 1 ) -- elseif getCameraTarget (player)~= player then --setCameraTarget ( player ) -- end local x, y, z, lx, ly, lz = getCameraMatrix() if x and y and lx and ly then local zc = findRotation(x,y,lx,ly) setElementRotation(player,0,0,zc) end end end end) -- source wiki mta >> function findRotation(x1,y1,x2,y2) local t = -math.deg(math.atan2(x2-x1,y2-y1)) if t < 0 then t = t + 360 end; return t; end --<< It does not work even 40%, many bugs etc. -_-" If you really wanna have this you have to ask your pcp mates, they seems to have good scripters. You are from the bomb da base server right?
-
@Billy Zou ik ook niet weet bij jou, "geen locatie". Deze vond ik ook al geniaal toen ik mijn nieuwen pc in elkaar had gezet.
-
ok, skipper nice sample @tosfera local loan = givePlayerMoney(hitPlayer, money) -- money = an int triggerClientEvent(source, "errorMsg", root, "Well done! I'll give you: $".. tostring(money)) -- now its a string But why should it need to be a string? A word or letter can already be a number. tonumber(loss) -- loss is already a number.
-
Source: http://www.lua.org Give me a sample, because I have never put something in to a "string" I think.
-
What can you do with tonumber? Because I have never needed it before.
-
Maybe one more byte looping through the script
-
When you leave GTA san, there will be some bugs, this is just one of them. and more: (as far I know those aren't fixed or not able to be fixed) - Pickups become invisible. (not custom pickups from race, those are objects not real pickups) - Water creation don't work there. etc. This bug can't be fixed. I use my own version of server syncs thx to Phat Looser, so I don't have problems with this bug.
-
but pairs is better when you don't need that number?
-
Will it give lagg when I use ipairs instead of pairs at moments, I don't need to know the location of the source? short:(lagg?) I have a table but I don't need the iteration number, while using ipairs.
-
So it is possible to know the camera position from other players without using server side?
-
Possible to make, but I can promise you it isn't 20 line's of code. everything is possible :3
-
addEventHandler( "onResourceStart", resourceRoot, function ( ) setWeaponProperty(34, "pro", "weapon_range", 300) setWeaponProperty(34, "pro", "target_range", 300) setWeaponProperty(34, "poor", "weapon_range", 300) setWeaponProperty(34, "poor", "target_range", 300) setWeaponProperty(34, "std", "weapon_range", 300) setWeaponProperty(34, "std", "target_range", 300) end) .....................................................................................................................................................................................................................................................................................................................................................................,,,,, Note: sniper is already "300" max.
-
triggerServerEvent("setT", getLocalPlayer()) -- 2 arguments = correct trigger, source, thePlayer) @X~|Mr.ALM damn you was 1 second before me....
-
I have also never used it before, but I saw some functions on wikimta: https://wiki.multitheftauto.com/wiki/Ser ... _Functions
-
https://wiki.multitheftauto.com/wiki/ToggleControl https://wiki.multitheftauto.com/wiki/CreateWeapon Note client side and no syncs: But if you know a little about communication between server and client it is possible to put it a little synchronize.... Good luck, it cost me a few days to attach weapons to a hunter. I am not sure if you can get the exact turret position of a SWAT thank. I get a strange rotation... not position -_-" https://wiki.multitheftauto.com/wiki/Get ... etPosition wrong named....
-
ah begreep het verkeerd
-
Als de poster niet terug reageert.... denken mensen dat het nog steeds actief is, omdat het probleem nog niet opgelost is. Klinkt dat logisch? en ja ik had de datum kunnen bekijken.... daar heb je wel gelijk in.
-
ah bedankt / thx
-
Well how do I set up this? Must the .lua client file that should be read in the meta? Must this "Client Lua file:" also be in the file that should be read? Do I need one client file for reading and the other for the script that should be loaded in the memory? @ Postby Ransom on Tue Feb 08, 2011 4:44 am (page 1) Server Lua file: function RecieveScriptFromServer () local file = fileOpen ( 'CLIENTSIDE.lua', true )--This opens the script containing the clientside script inside the resource if file then local packets = {} local counter = 1 while not fileIsEOF(file) do packets[counter] = fileRead(file, 30000)--65535 byte send limit per trigger counter = counter + 1 end fileClose(file) triggerClientEvent ( "onRequestClientFiles", root, packets) else outputConsole("Client files are missing serverside!") end end addEvent( "onRecieveScriptFromServer", true ) addEventHandler( "onRecieveScriptFromServer", root, RecieveScriptFromServer ) Client Lua file: triggerServerEvent ( "onRecieveScriptFromServer", getLocalPlayer() ) function RequestClientFiles (clientCode) append = "" for k,v in ipairs(clientCode) do append = append..v end loadstring(append)() end addEvent( "onRequestClientFiles", true ) addEventHandler( "onRequestClientFiles", root, RequestClientFiles )
-
CCW is it still possible that players are able to cheat?
-
-- client local lastTickRob = 0 function rob () local tick = getTickCount () local myTick = (tick-lastTickRob) if 10000 < myTick then lastTickRob = tick triggerServerEvent ( "giveMoneyRob", getLocalPlayer() ) else outputChatBox(" You have to wait " .. math.ceil((10000-myTick)/1000) .. " secondes before you can rob the shop again.") end end addCommandHandler( "rob", rob ) --server addEvent( "giveMoneyRob", true ) addEventHandler( "giveMoneyRob", getRootElement(), function () if isElement(source) and not isPedDead ( source ) then givePlayerMoney(source, 2000 ) end end) Well he can build it him self, I don't know anything about rpg and role-play servers any way. But thank you for let me solve the problem. test it and it works.