Jump to content

pa3ck

Members
  • Posts

    1,141
  • Joined

  • Last visited

  • Days Won

    7

Everything posted by pa3ck

  1. function sigarette ( thePlayer, commandName ) local x, y, z = getElementPosition ( thePlayer ) local sigarette = createObject ( 1485, 0, 0, 0 ) attachElements ( sigarette, thePlayer, 0.05, 0, 0.7, 0, 45, 118 ) toggleControl ( thePlayer, "jump", false ) toggleControl ( thePlayer, "sprint", false ) toggleControl ( thePlayer, "walk", false ) toggleControl ( thePlayer, "forwads", false ) toggleControl ( thePlayer, "backwards", false ) toggleControl ( thePlayer, "left", false ) toggleControl ( thePlayer, "right", false ) toggleControl ( thePlayer, "aim_weapon", false ) toggleControl ( thePlayer, "fire", false ) toggleControl ( thePlayer, "enter_exit", false ) setPedAnimation ( thePlayer, "SMOKING", "M_smkstnd_loop") faded = false setTimer(function() faded = not faded fadeCamera(thePlayer, faded, 1, 255, 0, 0) end, 1000, 9) setTimer( function () destroyElement ( sigarette ) toggleControl ( thePlayer, "jump", true ) toggleControl ( thePlayer, "sprint", true ) toggleControl ( thePlayer, "walk", true ) toggleControl ( thePlayer, "forwads", true ) toggleControl ( thePlayer, "backwards", true ) toggleControl ( thePlayer, "left", true ) toggleControl ( thePlayer, "right", true ) toggleControl ( thePlayer, "aim_weapon", true ) toggleControl ( thePlayer, "fire", true ) toggleControl ( thePlayer, "enter_exit", true ) setPedAnimation(thePlayer,false) end, 9000, 1) end addCommandHandler ( "smoke", sigarette )
  2. pa3ck

    Spawn GUI

    GUIEditor = { button = {}, window = {}, edit = {} } addEventHandler("onClientResourceStart", resourceRoot, function() GUIEditor.window[1] = guiCreateWindow(5, 122, 1366, 498, "Backup Server - Spawn System", false) guiSetVisible( GUIEditor_window[1], false ) guiWindowSetSizable(GUIEditor.window[1], false) GUIEditor.button[1] = guiCreateButton(54, 96, 558, 137, "Military", false, GUIEditor.window[1]) guiSetProperty(GUIEditor.button[1], "NormalTextColour", "FF00FE06") GUIEditor.button[2] = guiCreateButton(749, 96, 558, 137, "Resistance", false, GUIEditor.window[1]) guiSetProperty(GUIEditor.button[2], "NormalTextColour", "FFFE0000") GUIEditor.edit[1] = guiCreateEdit(45, 265, 567, 223, "Players spawned in the Military Class must protect the people of SA from the Zombie Infection.", false, GUIEditor.window[1]) GUIEditor.edit[2] = guiCreateEdit(744, 260, 567, 223, "Players spawned in the Resistance Class must destroy the Military Troops, and take control of SA.", false, GUIEditor.window[1]) addEventHandler("onClientGUIClick", root, function() if source == GUIEditor.button[1] then triggerServerEvent("Military", source) guiSetVisible(GUIEditor_window[1], false) showCursor(false) elseif source == GUIEditor.button[2] then triggerServerEvent("Resistance", source) guiSetVisible(GUIEditor_window[1], false) showCursor(false) end end) end ) addEvent("setSpawnVisible",true) addEventHandler("setSpawnVisible",root, function () guiSetVisible( GUIEditor_window[1], true ) setTimer( function () showCursor( true ) end, 1000,1) end ) Did not test it tho.
  3. I'm not sure, if there is a native MTA function for flashing screen, but I'd either use timers or getTickCount with onClientRender
  4. Move the timer inside the function. I've corrected your code: function sigarette ( thePlayer, commandName ) local x, y, z = getElementPosition ( thePlayer ) local sigarette = createObject ( 1485, 0, 0, 0 ) attachElements ( sigarette, thePlayer, 0.05, 0, 0.7, 0, 45, 118 ) local faded = false if faded then fadeCamera ( thePlayer, true ) else fadeCamera ( thePlayer, false, 1, 250, 0, 0 ) end faded = not faded toggleControl ( thePlayer, "jump", false ) toggleControl ( thePlayer, "sprint", false ) toggleControl ( thePlayer, "walk", false ) toggleControl ( thePlayer, "forwads", false ) toggleControl ( thePlayer, "backwards", false ) toggleControl ( thePlayer, "left", false ) toggleControl ( thePlayer, "right", false ) toggleControl ( thePlayer, "aim_weapon", false ) toggleControl ( thePlayer, "fire", false ) toggleControl ( thePlayer, "enter_exit", false ) setPedAnimation ( thePlayer, "SMOKING", "M_smkstnd_loop") setTimer( function () destroyElement ( sigarette ) -- The is no 'stopObject' - well actually there is, but it cancels the movement of the object, its not used for deleting an object fadeCamera(thePlayer, true) -- I've added this. toggleControl ( thePlayer, "jump", true ) toggleControl ( thePlayer, "sprint", true ) toggleControl ( thePlayer, "walk", true ) toggleControl ( thePlayer, "forwads", true ) toggleControl ( thePlayer, "backwards", true ) toggleControl ( thePlayer, "left", true ) toggleControl ( thePlayer, "right", true ) toggleControl ( thePlayer, "aim_weapon", true ) toggleControl ( thePlayer, "fire", true ) toggleControl ( thePlayer, "enter_exit", true ) setPedAnimation(thePlayer,false) end , 9000, 1) end addCommandHandler ( "smoke", sigarette ) Also, I recommend you to use bone attach ( https://community.multitheftauto.com/index.php?p= ... ls&id=2540 ), instead of attaching it to the ped itself.
  5. Change setPedAnimation ( source, "SMOKING", "M_smkstnd_loop") To setPedAnimation ( thePlayer, "SMOKING", "M_smkstnd_loop") Do the same with the fadeCamera.
  6. pa3ck

    Head Rotation

    Mkaay, so it's not an easy thing, is it? Thanks anyways.
  7. pa3ck

    Head Rotation

    Ah, you are hunting for free scripts... I know because I already fixed it and shared it with the poster. So yes a bit late, Could you give us some instructions on which functions are needed?
  8. pa3ck

    Spawn Marker

    onMarkerHit Wiki says: "The source of this event is the marker that got hit by the element." You are trying to set the markers team and spawn it. You defined "hitElement", so use it instead of source. Like so: setPlayerTeam (hitElement, resisteam)
  9. pa3ck

    DxDraw

    Because of the if (LV >= 0) then -- this condition will always be true and the if statement will automatically break itself as soon as it gets to this line Use if (LV == 0) then -- etc, etc, etc...
  10. You have GUI, which is client side, you have spawnPlayer which is server side. 'onClientResourceStart' is client side as well. https://wiki.multitheftauto.com/wiki/Cli ... _Functions https://wiki.multitheftauto.com/wiki/Ser ... _Functions You might want to look at this: https://wiki.multitheftauto.com/wiki/Scr ... troduction
  11. pa3ck

    SQL question

    You'll need 'ALTER TABLE' http://dev.mysql.com/doc/refman/5.1/en/alter-table.html OR http://www.w3schools.com/sql/sql_alter.asp ( ALTER TABLE table_name RENAME COLUMN old_name to new_name )
  12. pa3ck

    Weird thing

    Oh, sorry, did not see this part: setTimer ( function() guiSetText ( GUIEditor.clockHoursLabel, ""..hours..":") guiSetText ( GUIEditor.clockMinutesLabel, " "..minutes.."") end, 50, 0 ) You will need to get the 'new' time every time you execute the timer: setTimer ( function() local time = getRealTime() local minute = time.minute local hours = time.hour guiSetText ( GUIEditor.clockHoursLabel, ""..hours..":") guiSetText ( GUIEditor.clockMinutesLabel, " "..minutes.."") end, 50, 0 ) (Just in case you still don't know where the problem was)
  13. pa3ck

    Weird thing

    month - months since January (0-11) year - years since 1900 ( so time.year + 1900 ) ( getRealTime) Also, you will need to use onClientRender or setTimer to update the time.
  14. There are a good number of objects that you can not delete in the default MTA editor. What I used to use is the SAMP editor, its more accurate and you can delete all of the objects. You'll find the SAMP editor here: http://forum.sa-mp.com/showthread.php?t=282801 (SA:MP editor has some objects that are in SAMP ONLY, so you wont be able to use it in MTA, just in case you want to create some maps in it.)
  15. The thing is, that I want to create 3-4 "screenSource" things on the screen... If I could set my camera target to 3-4 places at the same time, I'd do that you know..
  16. Hi there. I saw the DxCreateScreenSource function, which is a really great function, but is there any way to see other players screen?
  17. Okay, got it, thank you guys.
  18. Hi there, I want to make 2 more chat boxes, one for the right hand side and one goes to the bottom of the screen. What functions / events will I need? The hardest part is that, when a new chat line comes up, the first one should disappear... Just like in the default chat box. What would be the easiest way?
  19. pa3ck

    Help

    dxDrawText 'onClientRender' setTimer removeEventHandler
  20. You are trying to get the rotation of a number. addEventHandler("onElementModelChange", root, function (oldModel,newModel) if newModel == 425 and getElementType(source) == "vehicle" then --425 = hunter local rotX, rotY, rotZ = getElementRotation(source) -- get the local client's vehicle rotation setElementRotation(source,rotX,rotY+10, rotZ) end end)
  21. pa3ck

    SQL Help

    No problem at all : D
  22. pa3ck

    SQL Help

    executeSQLQuery("CREATE TABLE IF NOT EXISTS RolTest (Account TEXT, RolEdit TEXT)") You were missing the ")".
  23. pa3ck

    Need SQL help

    dbExec(connection,"UPDATE character SET name = ? WHERE id = ?", getPlayerName(source), accountID) accountID is the account, which you want to update
  24. pa3ck

    MySQL problem

    Love you man, you helped me a lot, appreciated!
×
×
  • Create New...