-
Posts
253 -
Joined
-
Last visited
Everything posted by Miika
-
The timer works, but the boat begins to vibrate, but does not turn function commandX(thePlayer) vehicle = getPedOccupiedVehicle ( thePlayer ) rotX, rotY, rotZ = getElementRotation(vehicle) if (getVehicleType(vehicle) == "Boat") then setTimer (timerA, 1000, 1) else outputChatBox("You don't have a boat!", thePlayer, 255, 255, 0, true) end end addCommandHandler("sink", commandX) function timerA( thePlayer ) setElementRotation(vehicle, 0, 0, rotZ+0.1) setTimer (timerB, 50, 1) end function timerB( thePlayer ) setElementRotation(vehicle, 0, 0, rotZ+0.1) setTimer (timerA, 50, 1) end
-
It is serverside script
-
I start coding the boat sinking script. First i want add rotation. But I have problem. WANRNING: restart/restart.lua:9: Bad argument @ 'getPedOccupiedVehicle' [Expected ped at argument, 1 got nil] Code: function commandX(thePlayer) vehicle = getPedOccupiedVehicle ( thePlayer ) if (getVehicleType(vehicle) == "Boat") then setTimer (timerA, 1000, 1) else outputChatBox("You don't have a boat!", thePlayer, 255, 255, 0, true) end end addCommandHandler("sink", commandX) function timerA() theVehicle = getPedOccupiedVehicle ( source ) if theVehicle then local rotX, rotY, rotZ = getElementRotation( theVehicle ) local posX, posY, posZ = getElementPosition( theVehicle ) setElementRotation(theVehicle, 0, 0, rotZ+0.01) setTimer (timerB, 1, 1) else return end end function timerB( thePlayer ) theBoat = getPedOccupiedVehicle ( source ) if theVehicle then local rotX, rotY, rotZ = getElementRotation( theBoat ) local posX, posY, posZ = getElementPosition( theBoat ) setElementRotation(theBoat, 0, 0, rotZ+0.01) setTimer (timerA, 1, 1) else return end end
-
Hi! Is possible to create element for all coordinates? I know how to spawn for random locations but I don't need it. local locationtest = { {2422.3,-2261.6,16}, {1758.9,-2767.9,1.7}, {2493.3,-951.8,82.25}, {815.7,-1108.2,25.8}, {390.9,-2054.3,13.8}, {-719.05,-1938.8,8.35}, {-625.7,-2249.5,23.05}, {-1812.3,-168.5,18.2}, {-2659.5,1528.05,54.79}, {-1733.76,194.75,3.6}, {-2535.5,40.15,8.5}, {-1804.85,558.45,35.15}, {-752.6,-131.6,65.8}, } function locationSpawn() element = createPickup( #locationtest [all][1], #locationtest [all][2], #locationtest [all][3], 3, 1550 ) -- It spawns one pickup. Why? -- bl = createBlipAttachedTo(element ,37) end addEventHandler("onResourceStart", resourceRoot,createBag)
-
Hi. there is a lot of errors which need to be corrected. the biggest error (red) is the color. [server] function saveCommand(thePlayer) local playeraccount = getPlayerAccount ( thePlayer ) if ( playeraccount ) and not isGuestAccount ( playeraccount ) then if (isObjectInACLGroup ("user."..getAccountName(getPlayerAccount(thePlayer)),aclGetGroup("Admin"))) then for i, vehicle in pairs (getElementsByType("vehicle")) do local px, py, pz = getElementPosition(vehicle) local rx, ry, rz = getElementRotation(vehicle) local color1, color2, color3 = getVehicleColor(vehicle) local model = getElementModel(vehicle) local health = getElementHealth (vehicle) local upgrades = getVehicleUpgrades(vehicle) local paintjob = getVehiclePaintjob(vehicle) setAccountData ( playeraccount, "vipcar.position", tostring(px)..","..tostring(py)..","..tostring(pz) ) setAccountData ( playeraccount, "vipcar.rotation", tostring(rx)..","..tostring(ry)..","..tostring(rz) ) setAccountData ( playeraccount, "vipcar.color", tostring(color1)..","..tostring(color2)..","..tostring(color3) ) setAccountData ( playeraccount, "vipcar.model", model) setAccountData ( playeraccount, "vipcar.health", health) setAccountData ( playeraccount, "vipcar.tableupgrades", tableUpgrades) setAccountData ( playeraccount, "vipcar.upgrades", upgrades) setAccountData ( playeraccount, "vipcar.paintjob", paintjob) outputChatBox("* VIP-CAR: Car saved to your account!", thePlayer, 0, 255, 0, true) end else outputChatBox("* VIP-CAR: You don't have permissions to save your vehicle!", thePlayer, 255, 0, 0, true) return end end end addCommandHandler("save", saveCommand) function onPlayerLogin (_, playeraccount ) if (isObjectInACLGroup ("user."..getAccountName(getPlayerAccount(_)),aclGetGroup("Admin"))) then if ( playeraccount ) then local position = getAccountData ( playeraccount, "vipcar.position" ) if ( position ) then local p = split(position, ",") end local rotation = getAccountData ( playeraccount, "vipcar.rotation" ) if ( rotation ) then local r = split(rotation, ",") end local color = getAccountData ( playeraccount, "vipcar.color" ) if ( color ) then local c = split(color, ",") end local model = getAccountData ( playeraccount, "vipcar.model" ) local health = getAccountData ( playeraccount, "vipcar.health" ) local tableUpgrades = getAccountData ( playeraccount, "vipcar.tableUpgrades" ) local upgrades = getAccountData ( playeraccount, "vipcar.upgrades" ) local paintjob = getAccountData ( playeraccount, "vipcar.paintjob" ) if ( model ) then local vehicle = createVehicle( model, p[1], p[2], p[3], r[1], r[2], r[3] ) end setElementHealth ( vehicle, health ) setVehicleColor ( vehicle, c[1], c[2], c[3] ) if ( paintjob ) then setVehiclePaintjob( vehicle, paintjob ) end local upgrades = split( upgrades, 44 ) for index, upgrade in pairs (upgrades) do addVehicleUpgrade( vehicle, upgrade ) end outputChatBox("* VIP-CAR: Car loaded from your account!", source, 0, 255, 0, true) end end end addCommandHandler("load", onPlayerLogin)
-
Hi! My motd script doesn't work. ERROR: Loading script failed: info-window\client.lua:7: ') expected (to close '(' at line 6) near '=' [Client] function drawText() local sWidth,sHeight = guiGetScreenSize() dxDrawRectangle(sWidth*0.1427525622254758,sHeight*0.9557291666666667,sWidth*0.6991215226939971,sHeight*0.04296875,tocolor(0,0,0,150),false) dxDrawText(Texto,sWidth*0.328696925329429,sHeight*0.9661458333333333,sWidth*0.664714494875549,sHeight*0.9895833333333333,tocolor(0,255,0,255),0.6,"bankgothic","center","top",false,false,false) setTimer( Texto = "Muista pitää hauskaa!" if Texto == "Muista pitää hauskaa!" then Texto = "Donaamalla Miikalle 10e psc, saat modet." elseif Texto == "Donaamalla Miikalle 10e psc, saat modet." then Texto = "Lisää infoa Miikalta." elseif Texto == "Lisää infoa Miikalta." then Texto = "Kutsu toki kaverisikin pelaamaan!" elseif Texto == "Kutsu toki kaverisikin pelaamaan!" then Texto = "Älähän kinua rankkia :3" elseif Texto == "Älähän kinua rankkia :3" then Texto = "Muista pitää hauskaa!" end, 10000, 0) end function doText(command, ...) if command == "motdon" then text = table.concat({...}," ") addEventHandler("onClientRender", getRootElement(), drawText) elseif command == "motdoff" then removeEventHandler("onClientRender", getRootElement(), drawText) -- this time we use removeEventHandler end end addCommandHandler("motdon", doText) addCommandHandler("motdoff", doText) What is the problem?
-
Can someone tell me how to install the wheel pack to mta? I don't find any good tutorial.
-
I find the problem, but thx for helping!
-
My script not working, there is problem: WANRNING: restart/restart.lua:9: Bad argument @ 'addCommandHandler' [Expected function argument, 2 got nil] [server] function restartCommand(source, command) if (isObjectInACLGroup ("user."..getAccountName(getPlayerAccount(source)),aclGetGroup("Admin"))) then outputChatBox("00FF00[server]FF0000 Restart 10min kuluttua!",getRootElement(),255,0,255,true) setTimer ( step2, 300000, 1) else outputChatBox("You don't have permission to restart server!",source,255,0,0) return end end addCommandHandler("Restartti", getRootElement(), restartCommand) function step2() outputChatBox("00FF00[server]FF0000 Restart 5min kuluttua!",getRootElement(),255,0,255,true) setTimer ( step3, 240000, 1) end function step3() outputChatBox("00FF00[server]FF0000 Restart 1min kuluttua!",getRootElement(),255,0,255,true) setTimer ( step4, 30000, 1) end function step4() outputChatBox("00FF00[server]FF0000 Restart 30sec kuluttua!",getRootElement(),255,0,255,true) setTimer ( step5, 20000, 1) end function step5() outputChatBox("00FF00[server]FF0000 Restart 10sec kuluttua!",getRootElement(),255,0,255,true) setTimer ( step6, 5000, 1) end function step6() outputChatBox("00FF00[server]FF0000 Restart 5sec kuluttua!",getRootElement(),255,0,255,true) setTimer ( step7, 5000, 1) end function step7() outputChatBox("00FF00[server]FF0000 Restart NYT!",getRootElement(),255,0,255,true) shutdown (reason or "Restart") end
-
thx
-
My weapon shop panel not working. There is error with takePlayerMoney giveWeapon. [server] function giveMinigun(minigunPlayer) giveWeapon ( minigunPlayer, 38, 5000 ) takePlayerMoney ( minigunPlayer, 15000 ) end addEvent ( "giveMinigun", true ) addEventHandler ( "giveMinigun", resourceRoot, giveMinigun )
-
I use onClientWeaponFire but it doesn't work. I can kill people with minigun function noDeagle() local weaponID = getElementModel(source) if weaponID == 38 then cancelEvent() end end addEventHandler("onClientWeaponFire", getRootElement(), noDeagle)
-
My "SaveNameColor" script not working. it does not save color. [server] function onPlayerQuit ( ) local playeraccount = getPlayerAccount ( source ) if ( playeraccount ) and not isGuestAccount ( playeraccount ) then local r, g, b = getPlayerNametagColor ( source ) setAccountData ( playeraccount, "name.color", r, g, b ) end end function onPlayerLogin (_, playeraccount ) if ( playeraccount ) then local namecolor = getAccountData ( playeraccount, "name.color" ) if ( namecolor ) then setPlayerNametagColor ( source, namecolor ) end end end addEventHandler ( "onPlayerQuit", getRootElement ( ), onPlayerQuit ) addEventHandler ( "onPlayerLogin", getRootElement ( ), onPlayerLogin )
-
I know one server with this, but it is no longer online.
-
I want that other weapons are available free of charge
-
But I want add minigun to shop ($50 000)
-
Hi. We all hate minigun noobs, so I would like to take minigunuin in off. It is possible?
-
I have problem with getTeamName. I am criminal but it says: You need to be criminal [server] function createRob() Marker = createMarker ( 252.3,-54.6,0.9, "cylinder", 1, 255, 255, 0, 170 ) setElementCollisionsEnabled( Marker, false ) bl = createBlipAttachedTo(Marker,49) outputChatBox( "Alkon ryöstö on saatavilla. Ryöstä se viinakuvakkeen luota.", root, 0, 255, 0 ) end addEventHandler("onResourceStart", resourceRoot,createRob) addEventHandler("onMarkerLeave",root, function ( player ) if ( source ~= Marker ) then return end if ( isPedInVehicle( player ) ) then return end if ( getTeamName == "Criminal" ) then destroyElement( Marker ) destroyElement( bl ) randomMoney = math.random ( 5000, 20000 ) randomWanted = math.random ( 1, 6 ) givePlayerMoney(player,randomMoney) setPlayerWantedLevel ( player, randomWanted ) robPlayer = getPlayerName(player) outputChatBox("#ffffff[#00ff00ALARM!#ffffff] #c48027" .. robPlayer .. " #ff0000ryösti alkon, sai #00ff00" .. tostring(randomMoney) .."$ #ff0000ja #00ff00" .. tostring(randomWanted) .. "#ff0000 tähteä.",root,0,255,0,true) setTimer( createRob, 600000, 1 ) else outputChatBox("You need to be criminal!", player, 255, 255, 0) end end )
-
My fadeCamera bindkey not working. WANRNING: teams/teams.lua:32: Bad argument @ 'bindKey' [Expected player at argument, 1 got nil] [server] function fadeBind(thePlayer) if ( getCameraTarget == true ) then fadeCamera(thePlayer, false, 1) else fadeCamera(thePlayer, true, 1) end end bindKey(thePlayer, "f12", "down", fadeBind)
-
Police not working, it not se player team. function setPolice(policePlayer) police = getPlayerName(policePlayer) setPlayerSkin(policePlayer, 280) giveWeapon(policePlayer, 3) setPedWeaponSlot (policePlayer, 1) setElementPosition (policePlayer, -1626, 675, 7.1875) setPlayerTeam(policePlayer, PoliceTeam) outputChatBox("" .. police .. " on nyt Poliisi!", getRootElement(), 255, 255, 0) end addCommandHandler("police", setPolice) StaffTeam = createTeam ("Staff", 105,0,91 ) ArmyTeam = createTeam ("Army", 12,105,0 ) FBITeam = createTeam ("FBI", 91,0,209 ) SwatTeam = createTeam ("SWAT", 15,0,112 ) PoliceTeam = createTeam ("Police", 29,0,217 ) CrimnalTeam = createTeam ("Criminal", 255,0,0 ) EmergencyTeam = createTeam ("Emergency", 0,242,255 ) CivilliansTeam = createTeam ("Civilians", 255,255,0 ) FreeroamTeam = createTeam ("Freeroam", 17,112,0 ) UnemployedTeam = createTeam ("Unemployed", 209,209,209 )
-
It works perfectly! Thank you tapl!