Jump to content

IMariukas

Members
  • Posts

    15
  • Joined

  • Last visited

Details

  • Location
    Lithuania

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

IMariukas's Achievements

Square

Square (6/54)

0

Reputation

  1. It's good that you make tutorials so more people could learn Lua faster, good job Walid.
  2. Looks neat man, by the way where did you get that minimap?
  3. Dammn saw this video couple days ago before this thread, good job.
  4. Proud to see somoene putting a lot of effort for a gamemode. Btw, Cheers.
  5. http://www.mtadayz.com/2013/10/guardian-dog.html
  6. Hm, I saw in one script that it used client rather than player or something else, now I understand why and gonna remember this .Thanks TAPL.
  7. Hey so I wanted to do a script that when you write in the editbox something like "nissanskyline-fan" and click "Play" button it would setPlayerName, but I am having one problem that I don't know how to solve it. Client side: GUICharacter = { Name = {} } GUIEditor = { button = {}, window = {}, memo = {} } addEventHandler("onClientResourceStart", resourceRoot, function() GUIEditor.window[1] = guiCreateWindow(356, 233, 648, 303, "Character switch", false) guiWindowSetSizable(GUIEditor.window[1], false) GUICharacter.Name[1] = guiCreateEdit(40, 67, 236, 36, "Lastname_Firstname", false, GUIEditor.window[1]) GUIEditor.button[1] = guiCreateButton(284, 67, 70, 36, "Play", false, GUIEditor.window[1]) guiSetProperty(GUIEditor.button[1], "NormalTextColour", "FFAAAAAA") GUIEditor.memo[1] = guiCreateMemo(378, 51, 254, 212, "The character switch is just a regular one to play.If you want to change your character name just change it in the edit box.", false, GUIEditor.window[1]) guiMemoSetReadOnly(GUIEditor.memo[1], true) addEventHandler("onClientGUIClick",GUIEditor.button[1],characterButtons) end ) addEventHandler("onClientRender", root, function() dxDrawLine(721, 268, 721, 514, tocolor(255, 255, 255, 255), 1, true) end ) function characterButtons (button, state, thePlayer, ...) if button == "left" and state == "up" then local cname = guiGetText(GUICharacter.Name[1]) outputChatBox ("Your character name was changed to: " ..cname, getRootElement(), 244, 164, 96) triggerServerEvent ("change:character:name",getRootElement(), cname) end end Server side: - I am having an error here! addEvent("change:character:name",true) addEventHandler("change:character:name",root,function(thePlayer, cname) setPlayerName ( thePlayer, cname ) end ) ERROR - WARNING: ped\character_switch_server.lua:3: Bad argument @ 'setPlayerName' [Epected elemet at argument 1, got string 'Firstname_Lastname' ]
  8. Does somebody gonna help me please?
  9. Actually I wanted to use createVehicle in client-side one, but I can't because the car spawns and it's freezed and you can't enter the car.So I needed to write createVehicle function in server-side.About my script, well example: I want to make that paintjob2 that only "elegyshark" would have custom paintjob that you select on F1 paintjob the paintjob2.
  10. Hi, so I wanted to make a script that there spawns a car and only that car has the custom paintjob, unless I spawn more cars and let them spawn with paintjobs. Here's my client code- function triggerelegy() triggerServerEvent(source, "elegy-spawn", source) end addEventHandler("onResourceStart", root, function(thePlayer, theVehicle) if getElementModel(elegyshark) then local shader, tec = dxCreateShader ( "texreplace.fx" ) local tex = dxCreateTexture ( "textures/elegy.png") engineApplyShaderToWorldTexture ( shader, "elegy2body256", elegyshark ) engineApplyShaderToWorldTexture ( shader, "elegy2body256lod", elegyshark ) dxSetShaderValue ( shader, "gTexture", tex ) end end ) And server side script- elegyshark = createVehicle ( 562, 2485.1001, -1539.5, 23.6) setVehiclePaintjob ( elegyshark, 2 ) addEvent("elegy-spawn", true) addEventHandler("elegy-spawn", getRootElement(), responce) The car spawns but there is no custom paintjob on it and no ERROR shows in debugscript 3.What's the problem?
  11. Eh guys i don't need those if and then tutorials i already readed some in lua and tested on lua demo and then i tried on mta lua
  12. So what to write ??because i don't know what other to write with those "If" functions
  13. I wanted to make a simple test script where you write buym4 and if you have enough money it gives you weapon and writes on chat box and if you don't have enough money it only writes that you don't have enough money.
  14. Can somoene explain what's the problem? local player = getLocalPlayer function buyweapon (player,command) takePlayerMoney ( player, 2000 ) if true then outputChatBox ( "#00FF00Congratulations You Buyed M4 for 2000!", getRootElement(), 255, 255, 255, true ) giveWeapon ( player, 31, 200 ) end else if false then outputChatBox ( "#00FF00You Don't Have Enough Money!", getRootElement(), 255, 255, 255, true ) end addCommandHandler ( "buym4", buyweapon )
×
×
  • Create New...