-
Posts
1,283 -
Joined
-
Last visited
Everything posted by manve1
-
Actually it does, because u created the same function name and an event As midas said, functions aren't events. Functions must have different names because overwriting - unlike some languages that can differ functions by its parameters, any previous function declared with same name as the function being declared is overwritten. Events aren't the same as functions. Functions are something from Lua language itself, event names are just a string to name events - event system is from MTA:SA, it's not something from Lua itself. Hope you got it. I meant something like this, but im terrible at english language as its not my national language
-
Actually it does, because u created the same function name and an event
-
It isn't ... never call same function as an event. I mean the server script, i can't remember if i changed the client or not.
-
Copy code again, i think i found the problem.
-
CLIENT: addEventHandler("onClientResourceStart", resourceRoot, function() triggerServerEvent("bindClientKey", localPlayer ) end ) local chatActive = false addEventHandler( "onClientKey", root, function(key,pressed) setTimer( function() if pressed and key == "t" or "y" and chatActive == false then if isChatBoxInputActive() then chatActive = true elseif not isChatBoxInputActive() then chatActive = false local animBlock, animName = getPedAnimation(localPlayer) end return true end return false end, 50, 0 ) end ) SERVER: function realisticIC(keyPresser, key, keyState) if(keyState == "down") then setPedAnimation(keyPresser, "gangs", "prtial_gngtlkg", -1, true, false, true) elseif animBlock == "gangs" and animName == "prtial_gngtlkg" then setPedAnimation( source, false ) return true end end addEvent("bindClientKey", true) function bindClientKey_() if isKeyBound( source, "t" ) then unbindKey(source, "t", "down", realisticIC); bindKey(source, "t", "down", realisticIC) else bindKey(source, "t", "down", realisticIC) end end addEventHandler("bindClientKey", root, bindClientKey_) I think that this should work
-
i made it with a timer, still doesn't kill me function waterCheck(thePlayer) setTimer( function() if isElementInWater(thePlayer) then setElementHealth(source, 0) end end, 50, 0 ) end
-
I made this, but i didn't know what kinda event to use so i didn't use any, if you can, could u help me fix it? function waterCheck(thePlayer) if isElementInWater(thePlayer) then setElementHealth(source, 0) end end
-
How could i make a script like if the player hits water, he would be killed and re-spawned at certain position?
-
It would be easier to create that when the person of team spawns, he gets the weapons.
-
NO no, u don't understand me, i already get player names on the grid list, when i click on their names, i want a label to get changed to their serial e.g. "Serial: blahblah ...."
-
Yeh, it worked, but i didn't want it on the grid, oh well, i fixed it, but when i click on someone else not me, it returns false
-
I made a script ( it might make no sense ) and i can't figure out that when i click on the grid and on my or my mates name, serial stay's the same, could you possibly fix it? addEventHandler( 'onClientGUIClick', aGrid, function() local pRow = guiGridListGetSelectedItem( aGrid ) if (pRow and pRow ~= -1) then guiSetText ( aSerial, "Serial: " .. getPlayerSerial( localPlayer, pRow, 1 ) ) end end )
-
It is linked ... in the script u can see easily this line: exports.mapmanager:getRunningGamemodeMap() which has map manager in it
-
That's good for the map buying thing, not for the rest
-
Thats not true there are many people our there that want to help servers. Prove it. Btw, where did I miss a comma? You forgot tons of them. Anderl, there are few people out in the world scripting free ( like me, only just to learn quicker )
-
https://wiki.multitheftauto.com/wiki/Scripting_Introduction Learn Basics ... https://wiki.multitheftauto.com/wiki/SetElementPosition Read the client side ...
-
Do i put the coords where it says button? you put name of button where it say's "BUTTON" and replace "--code" to code you want it to be
-
I'm currently want to make a ban function so an admin could ban a player using a button, but the problem is it doesn't work, i get no error or anything like that. CLIENT: addEvent('retriveBan', true) addEventHandler('onClientGUIClick', aBanOk, function(theClient) addEventHandler('retriveBan', getRootElement(), function() getBanSerial = getPlayerSerial( localPlayer ) triggerServerEvent( 'banThePlayer', localPlayer ) end ) SERVER: addEvent('banThePlayer', true) addEventHandler('banThePlayer', getRootElement(), function() addBan( nil, nil, getBanSerial, source, reasonBan ) triggerClientEvent('retriveBan', source ) end ) NOTE: I'm making this so i could turn off the orginal MTA admin panel
-
I think this should work: function testing() if getPlayerTeam( getTeamFromName( 'Medic' ) then guiSetVisible( window, true ) else guiSetVisible( window, false ) --Note: you need to change few pieces like in the "GuiSetVisible" the window
-
Another way is in the new admin panel there is a function already made to set the FPS higher.
-
It would work, lots of Race DM servers scripted this, so yeh ... you can
