Jump to content

Clydian

Members
  • Posts

    48
  • Joined

  • Last visited

Everything posted by Clydian

  1. Use a table, for loop and setTimer to make this local cameraPos = { [1] = {0, 0, 0, 2, 2, 2} [2] = {2, 2, 2, 0, 0, 0} } cameraTimerPosition = 0 for _, position in ipairs(cameraPos) do cameraTimerPosition = cameraTimerPosition + 10000 setTimer(moveCamera, cameraTimerPosition, 1, position) end function moveCamera(position) local x, y, z, lx, ly, lz = getCameraMatrix() smoothMoveCamera(x, y, z, lx, ly, lz, position[1], position[2], position[3], position[4], position[5], position[6], 1000) end Cheers lad. Cookie to you
  2. I set the Timer to 50 but it didnt change nothing. Where do you want me to put "onClientResourceStart"? EDIT: i set it to 5000 and it works. So thats fixed. Thanks. And theres another thing, basicly when the camera moves to that x2,y2,z2, can i somehow make that the camera moves somewhere else?
  3. im sorry, but i have no idea what that means.
  4. But why douesnt this work? local sm = {} sm.moov = 0 sm.object1,sm.object2 = nil,nil local function removeCamHandler() if(sm.moov == 1)then sm.moov = 0 end end local function camRender() if (sm.moov == 1) then local x1,y1,z1 = getElementPosition(sm.object1) local x2,y2,z2 = getElementPosition(sm.object2) setCameraMatrix(x1,y1,z1,x2,y2,z2) end end addEventHandler("onClientPreRender",root,camRender) function smoothMoveCamera(x1,y1,z1,x1t,y1t,z1t,x2,y2,z2,x2t,y2t,z2t,time) if(sm.moov == 1)then return false end sm.object1 = createObject(1337,x1,y1,z1) sm.object2 = createObject(1337,x1t,y1t,z1t) setElementAlpha(sm.object1,0) setElementAlpha(sm.object2,0) setObjectScale(sm.object1,0.01) setObjectScale(sm.object2,0.01) moveObject(sm.object1,time,x2,y2,z2,0,0,0,"InOutQuad") moveObject(sm.object2,time,x2t,y2t,z2t,0,0,0,"InOutQuad") sm.moov = 1 setTimer(removeCamHandler,time,1) setTimer(destroyElement,time,1,sm.object1) setTimer(destroyElement,time,1,sm.object2) return true end fadeCamera ( false, 0, 0,0,0 ) smoothMoveCamera (1715.978515625, -1732.900390625, 19.510538101196, 1750.73046875, -1732.919921875, 15.30633354187, 1814.8818359375, -1732.6376953125, 28.479869842529, 1750.73046875, -1732.919921875, 15.30633354187, 1) setTimer(function () fadeCamera ( true, 1, 0,0,0 ) end, 1000, 1)
  5. So i have a simple login, theres a picture in background. I want to change the picture, to a flying camera effect around Los Santos. How do i do that? I can just make it look at one position. fadeCamera ( false, 0, 0,0,0 ) setCameraMatrix (1217.103515625, -1307.1328125, 52.016986846924, 1131.939453125, -1352.66796875, 49.851699829102) setTimer(function () fadeCamera ( true, 1, 0,0,0 ) end, 1000, 1) This make the camera near LSPD and looks at a fountain. I want the camera to rotate around the fountain.
  6. Big thanks to you man, Will take a look at all those things. And one more, should i make an mysql database for the server, or its not needed at all?
  7. Hello everyone, so i want to lear the MTA scripting for a while now. All i've been doing is edit scripts so far. So i thought, maybe i should try to make something easy. So i had an idea. an someone point me thr right way, to start make a script, where i can buy a property, the property gives player money each five minutes. Then the player can sell it, or if player quits, it sells automaticly. I thought it would be fun making it. Any idead where to start? I Also would like to make armor pickups randomly around San Andreas.
  8. Still the same.. Like. i dont een know
  9. Nothing in debugscript Thats the full code Cords are correct
  10. The basic thing still wont work. The ped is not showing
  11. local L0_0 L0_0 = createPed L0_0 = L0_0(280, 1560.900390625, -1680.2060546875, 64.498291015625) setPedRotation(L0_0, 0) setElementFrozen(L0_0, true) setElementDimension(L0_0, 3) setElementInterior(L0_0, 22) setElementData(L0_0, "talk", 1, false) setElementData(L0_0, "name", "SGT J. McDonald", false) function popuppdPedMenu() local L0_1, L1_2, L2_3, L3_4, L4_5, L5_6 L0_1 = getElementData L1_2 = getLocalPlayer L1_2 = L1_2() L2_3 = "exclusiveGUI" L0_1 = L0_1(L1_2, L2_3) if L0_1 then return end L0_1 = _UPVALUE0_ if not L0_1 then L0_1 = 200 L1_2 = 150 L2_3 = guiGetScreenSize L3_4 = L2_3() L4_5 = L2_3 / 2 L5_6 = L0_1 / 2 L4_5 = L4_5 - L5_6 L5_6 = L3_4 / 2 L5_6 = L5_6 - L1_2 / 2 _UPVALUE0_ = guiCreateWindow(L4_5, L5_6, L0_1, L1_2, "How can we help you?", false) bPhotos = guiCreateButton(0.05, 0.2, 0.87, 0.2, "I want to report a crime.", true, _UPVALUE0_) addEventHandler("onClientGUIClick", bPhotos, helpButtonFunction, false) bAdvert = guiCreateButton(0.05, 0.5, 0.87, 0.2, "I want to speak to an Officer.", true, _UPVALUE0_) addEventHandler("onClientGUIClick", bAdvert, appointmentButtonFunction, false) bSomethingElse = guiCreateButton(0.05, 0.8, 0.87, 0.2, "I'm fine, thanks.", true, _UPVALUE0_) addEventHandler("onClientGUIClick", bSomethingElse, otherButtonFunction, false) triggerServerEvent("pd:ped:start", getLocalPlayer(), getElementData(_UPVALUE1_, "name")) showCursor(true) end end addEvent("pd:popupPedMenu", true) addEventHandler("pd:popupPedMenu", getRootElement(), popuppdPedMenu) function closepdPedMenu() destroyElement(_UPVALUE0_) _UPVALUE0_ = nil showCursor(false) end function helpButtonFunction() closepdPedMenu() triggerServerEvent("pd:ped:help", getLocalPlayer(), getElementData(_UPVALUE0_, "name")) end function appointmentButtonFunction() closepdPedMenu() triggerServerEvent("pd:ped:appointment", getLocalPlayer(), getElementData(_UPVALUE0_, "name")) end function otherButtonFunction() closepdPedMenu() end
  12. So i have a problem, i cant connect to ANY server. its shors that theres some sort of problem witch connecting.. When i enter, it starts downloading, and then it shows that i cant connect. i have fresh GTA SA, no modded, and firewall is off..
  13. same error as it showed before
  14. acually just tested it and still wont work
  15. Thank you very much, and i will try to change it, see how it works
  16. Because of the small and capital letters function setLevel(playerS,cmd,name,amount) local player = getPlayerFromName(PlayerS) Didnt fix it
  17. function setLevel(playerS,cmd,name,amount) local player = getPlayerFromName(PlayerS) local account = getPlayerAccount(playerS) local accName = getAccountName(account) if isObjectInACLGroup("user."..accName,aclGetGroup("Admin")) then if getElementType(player) == "player" and tonumber(amount) then setElementData(player,"Level",getElementData(player,"Level") + amount) outputChatBox("Your level was increased by "..getPlayerName(playerS).." ("..amount.."%)",player,0,255,0) outputChatBox(getPlayerName(player).."'s level was increased.",playerS,0,255,0) else outputChatBox("Failed to give because the player/amount was wrong.",playerS,255,255,0) end end end addCommandHandler("setLevel",setLevel,false,false) any ideas why it wont work? DebugScript3 says" WARNING" DG_Levels/server.lua"70" Bad argument @ 'getPlayerFromName' [Expected string at argument 1, got nil]
  18. Still dont know why not money when picking it up, but in respawn time i putted -1 now they dont respawn.. but whats the money not collectiong problem?
  19. function deadDropsMoney ( totalammo, killer, killerweapon, bodypart ) x, y, z = getElementPosition ( source ) local moneyonhand=createPickup ( x, y, z, 3, 1212, 10000) local deadmoney = getPlayerMoney(source) setElementData(moneyonhand,"Amount",deadmoney) takePlayerMoney(source,deadmoney) end addEventHandler ( "onPlayerWasted", getRootElement(), deadDropsMoney ) Something is not working. So when a player dies, he drops the pickup, bet when you walk on pickup (money's pickup) it dissapears, but money is not given to the pickup's collector. And the money keeps respawning, i donw want it to respawn. Someone knows whats the problem?
  20. and how should i make the enevnt handler?
  21. local aPickup = createPickup ( -49.7573, -269.5133, 6.6331, 3, 1273, 0, 0 ) function showPropertyInfo ( player ) outputChatBox ( "| Īpašums: 'Alus & Co.' |", player ) outputChatBox ( "| Cena: 150000 | 5min ienākums: 5000 | Pārdošanas cena: 60000 |", player ) outputChatBox ( "| Lai iegādātos šo īpašumu, rakstiet: /buyproperty. Lai pārdotu /sellproperty |", player ) end addEventHandler ( "onPickupHit", aPickup, showPropertyInfo ) function whenBuyProperty(player, commandName) local money = getPlayerMoney(player) if (money > 150000) then outputChatBox("You have succesfully bought an interior!", player) end end So basicly i want to make two commands. /buyproperty /sellproperty How can i make that when player types /buyproperty it shows if it has enought money, on not that much money?
  22. Clydian

    Need Help

    What are called thos green houses?
  23. Clydian

    Need Help

    saw it, not what im looking for.. and i want to learn the scripting.. so wanna try to make it myself Then start with something basic and easy https://wiki.multitheftauto.com/wiki/Sc ... troduction Been there, Done that. I know the basics, i know already how to edit a lot of scripts just wanna know where to start. What Event or Function to use.
×
×
  • Create New...