-
Posts
6,097 -
Joined
-
Last visited
-
Days Won
218
Everything posted by IIYAMA
-
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.
-
-- not sure when a player leavesthe server, the onMarkerLeave will be triggered. local inside = {} function MarkerHit( hitElement, matchingDimension ) if getElementType( hitElement, ) == "player" then table.insert (inside,{hitElement,source}) end end addEventHandler( "onMarkerHit", myMarker, MarkerHit ) function markerLeave( leaveElement, matchingDimension ) if getElementType( leaveElement, ) == "player" then for i, v in ipairs( inside ) do if v[2] == leaveElement then table.remove( inside, i ) --v[1]) player end end end end addEventHandler( "onMarkerLeave", myMarker, markerLeave ) --#inside this shows you how many people are inside -- source is the marker. -- btw not sure if it works 100%, I made it in a hurry.... The structure of this table will look like this: local inside = { {player,marker}, --<<< {player,marker}, {player,marker}, {player,marker} } v = inside[1] -- take the first position <<< player,marker = unpack (v) -- or player = v[1] marker = v[2]
-
Then you also have to put the table in pairs. for i, v in ipairs( robbing ) do givePlayerMoney (v, 20000) end
-
Thx @TAPL Omg I failed....... -_-" Updated x3.
-
-- client .. local lastTickRob = 0 function rob () local tick = getTickCount () local myTick = (tick-lastTickRob) if 10000 < myTick then lastTickRob = tick givePlayerMoney( 2000 ) else outputChatBox(" You have to wait" .. math.ceil((10000-myTick)/1000) .. " secondes before you can rob the shop again.") end addCommandHandler( "rob", rob )
-
The English version wasn't meant for you, but for others. If you prefer that I speak English to you, it is ok.
-
I don't speak very well English, but I still can script. NL:Ik spreek niet echt goed Engels, maar ik kan nog scripten. The best thing you can do is watch the samples on wikimta, scripting isn't very hard but it cost lots of time to learn the rulez of it. NL: Het beste wat je kan doen is anderen voorbeelden bekijken op wikimta, scripten is niet zo moeilijk alleen het kost veel tijd om de regels er van te leren. https://wiki.multitheftauto.com If you start with scripting, there will be a moment when you see that you can build almost everything. The one big question still remains, "what is the best way". NL: Als je begind met scripten, dan zal er een moment komen dat je in gaat zien dat je alles kan bouwen wat je maar wilt. De vraag die overblijft, "wat is de beste mannier(zonder lagg)".
-
ah, a smooth tool. thank you,
-
oh lol, I always make that kind of mistakes. -_-"
-
Texture will be next to each other?
-
@jenteboy10: I don't see much dutch people on the scripting section, Met vriendelijke groet IIYAMA
-
Sample: --id="WUZIBET" destroyElement (GetElementByID(WUZIBET)) -- destroyElement (GetElementByID(WUZIBET,5)) -- or with index. https://wiki.multitheftauto.com/wiki/GetElementByID https://wiki.multitheftauto.com/wiki/DestroyElement
-
https://wiki.multitheftauto.com/wiki/EngineLoadTXD WIKIMTA engineLoadTXD ( "......txd", filter) What is filtering?
-
CLIENT function setWeaponFire (key, keyState) if keyState == "down" then setControlState(getLocalPlayer(), "fire", true ) elseif keyState == "up" then setControlState(getLocalPlayer(), "fire", false ) end end addEventHandler ( "onClientResourceStart", resourceRoot, function () bindKey ("mouse1", "both",setWeaponFire) bindKey ("lctrl", "both",setWeaponFire) toggleControl ("fire", false ) end) OR server ( not recommended when high ping) function setWeaponFire (key, keyState) if keyState == "down" then setControlState(source, "fire", true ) elseif keyState == "up" then setControlState(source, "fire", false ) end addEventHandler ( "onResourceStart", resourceRoot, function () for _, player in pairs ( getElementsByType 'player' ) do bindKey (player,"mouse1", "both",setWeaponFire) bindKey (player,"lctrl", "both",setWeaponFire) toggleControl ( player, "fire", false ) end end) addEventHandler ( "onPlayerJoin", getRootElement( ), function () bindKey (source,"mouse1", "both",setWeaponFire) bindKey (source,"lctrl", "both",setWeaponFire) toggleControl ( source, "fire", false ) end)
-
Well there is something called: http://mta.dzek.eu/mmove/ Not sure if it works.
-
lol this is the problem: local object = createElement("flag") Some how this object does not have user data.... but when I trigger this, nothing will happen, not even "you can't trigger a nil value" yes, I found it out 2 secondes before you posted. thx any way
