
HeK
Members-
Posts
185 -
Joined
-
Last visited
Everything posted by HeK
-
Hey guys, i have this 3D Speaker script and it's working perfectly, it plays a radio. Now the problem is the distance, players can only listen to it when they are really close to the speaker, how do i change that? --local url = "rackcity.mp3" local url = "http://www.181.fm/winamp.pls?station=181-power&style=mp3&description=Power%20181%20(Top%2040)&file=181-power.pls" function playTheSound(x, y, z, vehicle) sound = playSound3D(url, x, y, z) if (isElement(vehicle)) then attachElements(sound, vehicle) end end addEvent("playTheSound", true) addEventHandler("playTheSound", root, playTheSound) function stopTheSound(x, y, z) stopSound(sound) end addEvent("stopTheSound", true) addEventHandler("stopTheSound", root, stopTheSound) -- 181 FM: [url=http://www.181.fm/winamp.pls?station=181-power&style=mp3&description=Power%20181%20(Top%2040]http://www.181.fm/winamp.pls?station=18 ... 0(Top%2040[/url])&file=181-power.pls -- The Hitz channel: [url=http://www.in.com/music/radio/977-the-hitz-channel-15.html]http://www.in.com/music/radio/977-the-h ... el-15.html[/url]
-
I tried it and it didn't work, the model is still there. CODE: addEventHandler ("onClientResourceStart", resourceRoot, function() removeWorldModel(16613, 10, -346.671875, 1595.078125, 79.6640625) --object removeWorldModel(16614, 10, -346.671875, 1595.078125, 79.6640625) --LOD end) META:
-
I changed radius to 100, and still doesn't work, what am i doing wrong? Script is running, but the object is there.
-
addEventHandler ("onResourceStart", getRootElement (), function() removeWorldModel(16613, 10, -346.671875, 1595.078125, 79.6640625) --object removeWorldModel(16614, 10, -346.671875, 1595.078125, 79.6640625) --LOD end) It doesn't remove the object in the map.
-
Hey guys, i'm having some problems with my gate script, first it's not only players that can open it, i have a zombie server and zombies can open it too. Then, the other problem is the colShape, i don't know how to correctly create a colShape around the gate without messing it up. gate = createObject ( 980, -303, 1507.5, 76.699996948242, 0, 0, 0 ) col = createColRectangle ( -303, 1507.5, 5.50, 10 ) function hit ( ) moveObject ( gate, 1500, -314.29998779297, 1507.5, 76.699996948242 ) end addEventHandler ( "onColShapeHit", col, hit ) function leave ( ) moveObject ( gate, 1500, -303, 1507.5, 76.699996948242 ) end addEventHandler ( "onColShapeLeave", col, leave )
-
Hey guys, i need help on this script, i dont know what's wrong. When i do the command it gives a Bad argument on "getPlayerAccount", "getAccountName". function createAdminTeamOnStart () AdminTeam = createTeam ( "Staff", 250, 250, 250 ) end addEventHandler("onResourceStart", resourceRoot, createAdminTeamOnStart) function setAdminTeam() if isObjectInACLGroup("user."..getAccountName(getPlayerAccount(source)), aclGetGroup("Admin")) then setPlayerTeam(source, AdminTeam) setElementModel(source, 217) end end addCommandHandler( "staff", setAdminTeam )
-
I have the latest patch and sorry for double posting, didn't notice.
-
It comes on different situations, specialy when im just running (sprinting) or when i just log in the server (I play on the CIT server).
-
My MTA has been crashing a lot this last days. I have readed the MTA CRASHING topic and i fixed everything. Only thing i have modded is the sounds, Police siren. Version = 1.3-release-3972.0.000 Time = Sun Apr 08 02:11:31 2012 Module = C:\Program Files\Rockstar Games\GTA San Andreas\gta_sa.exe Code = 0xC0000005 Offset = 0x001D9B57 EAX=00000001 EBX=00000005 ECX=00000001 EDX=00000001 ESI=240207B0 EDI=0B23FB40 EBP=00000000 ESP=0022FBF4 EIP=005D9B57 FLG=00010246 CS=001B DS=0023 SS=0023 ES=0023 FS=003B GS=0000
-
Is it because of the capital "I"? Theres a lot of logIn in this script, i didn't want to mess it up. Can anyone help me please? This error appears when a player tries to register an account that is already registered. Error: WARNING: [scripts]\ZH_login\script.lua:43: Bad argument @ 'logIn' [Expected account at argument 2, got boolean] Script: function passwordHandler(player, oldpassword, newpassword) local account = getPlayerAccount(player) if (account) then if (isGuestAccount(account)) then outputChatBox("You must be logged in to change your password.", player) return end local playerName = getPlayerName(player) local password_check = getAccount(playerName, oldpassword) if (password_check ~= false) then if (string.len(newpassword) >= 5) then setAccountPassword(account, newpassword) triggerClientEvent(player, "hidePasswordWindow", getRootElement()) else outputChatBox("Your new password must be at least 5 characters long!", player) end else outputChatBox("Old password invalid.", player) end end end function loginHandler(player, username, password) local account = getAccount(username, password) if (account ~= false) then if (logIn(player, account, password) == true) then outputChatBox("If you want to change your password, use /changepw", player) triggerClientEvent (player, "hideLoginWindow", getRootElement()) else triggerClientEvent (player, "unknownError", getRootElement()) end else triggerClientEvent (player, "loginWrong", getRootElement()) end end function registerHandler(player, username, password) local account = getAccount(username, password) if (account ~= false) then triggerClientEvent(player, "registerTaken", getRootElement()) else account = addAccount(username, password) if (logIn(player, account, password) == true) then outputChatBox("If you want to change your password, use /changepw", player) triggerClientEvent(player, "hideLoginWindow", getRootElement()) else triggerClientEvent(player, "unknownError", getRootElement()) end end end addEvent("submitChangepw", true) addEvent("submitLogin", true) addEvent("submitRegister", true) addEventHandler("submitChangepw", root, passwordHandler) addEventHandler("submitLogin", root, loginHandler) addEventHandler("submitRegister", root, registerHandler)
-
That scared me, i though it was me. But im not italian, just got a message saying me to delete maps, i never posted maps.
-
No more errors, but now it says "INFO: moving..." in the server window and the gate doesn't move. Another lua with this resource (used "code" instead of "lua", forum wasn't showing my post): Editor = {} Gate = {} Gate2 = {} Precision = {} status = {} coll = {} coll2 = {} coll3 = {} coll4 = {} -- this script mod is (no longer) PRIVATE -- - Deject3d function startBuilding(playerSource, commandName, objectid) if not objectid then outputChatBox("usage: /addgate objectid teamname", playerSource) end team = getTeamName(getPlayerTeam(playerSource)) if team == false then team = "" end for i = 1,20 do if Editor[i] == playerSource then destroyElement(Gate[i]) Gate[i] = null Editor[i] = null Precision[i] = null end if Editor[i] == null then Editor[i] = playerSource -- set Editor[i] to who made the object --creating object -v local x,y,z = getElementPosition(playerSource) object = createObject ( objectid, x + 3,y + 3,z) interior = getElementInterior ( playerSource ) setElementInterior(object,interior) --created object -^ Gate[i] = object -- added object identifier to the array, corresponds to who created it Precision[i] = .5 -- default precision bindKey(playerSource, "i", "down", moveIt) bindKey(playerSource, "j", "down", moveIt) bindKey(playerSource, "k", "down", moveIt) bindKey(playerSource, "l", "down", moveIt) bindKey(playerSource, "mouse_wheel_up", "down", moveIt) bindKey(playerSource, "mouse_wheel_down", "down", moveIt) bindKey(playerSource, "pgup", "down", moveIt) bindKey(playerSource, "pgdn", "down", moveIt) bindKey(playerSource, "u", "down", moveIt) bindKey(playerSource, "o", "down", moveIt) bindKey(playerSource, "[", "down", moveIt) bindKey(playerSource, "]", "down", moveIt) bindKey(playerSource, "enter", "down", nextPosition ,objectid, team) bindKey(playerSource, "delete", "down", removeIt, playerSource) break -- done adding our object and who created it to the arrays... stop the loop end end end function nextPosition(playerSource, key, keyState, objectid, team) unbindKey ( playerSource, "i" ) unbindKey ( playerSource, "j" ) unbindKey ( playerSource, "k" ) unbindKey ( playerSource, "l" ) unbindKey ( playerSource, "pgup" ) unbindKey ( playerSource, "pgdn" ) unbindKey ( playerSource, "mouse_wheel_down") unbindKey ( playerSource, "mouse_wheel_up" ) unbindKey ( playerSource, "enter" ) unbindKey ( playerSource, "delete" ) unbindKey ( playerSource, "u" ) unbindKey ( playerSource, "o" ) unbindKey ( playerSource, "[" ) unbindKey ( playerSource, "]" ) outputDebugString("object 1 set. object 2 controlled. ID: " .. objectid .." team: " .. team .. "") for i = 1,20 do if Editor[i] == playerSource then --creating object -v local x,y,z = getElementPosition(Gate[i]) local rx,ry,rz= getObjectRotation(Gate[i]) object = createObject ( objectid, x,y,z,rx,ry,rz) interior = getElementInterior ( playerSource ) setElementInterior(object,interior) --created object -^ Gate2[i] = object -- added object identifier to the array, corresponds to who created it Precision[i] = .5 -- default precision bindKey(playerSource, "i", "down", moveIt2) bindKey(playerSource, "j", "down", moveIt2) bindKey(playerSource, "k", "down", moveIt2) bindKey(playerSource, "l", "down", moveIt2) bindKey(playerSource, "mouse_wheel_up", "down", moveIt2) bindKey(playerSource, "mouse_wheel_down", "down", moveIt2) bindKey(playerSource, "pgup", "down", moveIt2) bindKey(playerSource, "pgdn", "down", moveIt2) bindKey(playerSource, "u", "down", moveIt2) bindKey(playerSource, "o", "down", moveIt2) bindKey(playerSource, "[", "down", moveIt2) bindKey(playerSource, "]", "down", moveIt2) bindKey(playerSource, "enter", "down", collisionObject, team, objectID) bindKey(playerSource, "delete", "down", removeIt, playerSource) break -- done adding our object and who created it to the arrays... stop the loop end end end function changePrecision(playerSource,commandName,value) if value then for i = 1,20 do if Editor[i] == playerSource then Precision[i] = value outputChatBox("Sensitivity set to: " .. value .. "", playerSource) break end end end end function moveIt(source, key, keyState) for i = 1,20 do if Editor[i] == source then object = Gate[i] prec = Precision[i] break end end if key == "i" then x,y,z = getElementPosition(object) setElementPosition ( object, x,y + prec,z ) end if key =="j" then x,y,z = getElementPosition(object) setElementPosition ( object, x - prec,y,z ) end if key =="l" then x,y,z = getElementPosition(object) setElementPosition ( object, x + prec,y,z ) end if key =="k" then x,y,z = getElementPosition(object) setElementPosition ( object, x,y - prec,z ) end if key =="pgup" then x,y,z = getElementPosition(object) setElementPosition ( object, x,y,z + prec ) end if key =="pgdn" then x,y,z = getElementPosition(object) setElementPosition ( object, x,y ,z - prec ) end -- rotation -- if key =="mouse_wheel_up" then rx,ry,rz = getObjectRotation(object) setObjectRotation ( object, rx,ry,rz - prec * 5) end if key =="mouse_wheel_down" then rx,ry,rz = getObjectRotation(object) setObjectRotation ( object, rx,ry,rz + prec * 5) end if key =="u" then rx,ry,rz = getObjectRotation(object) setObjectRotation ( object, rx,ry - prec*10,rz) end if key =="o" then rx,ry,rz = getObjectRotation(object) setObjectRotation ( object, rx,ry + prec*10,rz) end if key =="[" then rx,ry,rz = getObjectRotation(object) setObjectRotation ( object, rx- prec*10,ry,rz) end if key =="]" then rx,ry,rz = getObjectRotation(object) setObjectRotation ( object, rx+ prec*10,ry,rz) end end function moveIt2(source, key, keyState) for i = 1,20 do if Editor[i] == source then object = Gate2[i] prec = Precision[i] break end end if key == "i" then x,y,z = getElementPosition(object) setElementPosition ( object, x,y + prec,z ) end if key =="j" then x,y,z = getElementPosition(object) setElementPosition ( object, x - prec,y,z ) end if key =="l" then x,y,z = getElementPosition(object) setElementPosition ( object, x + prec,y,z ) end if key =="k" then x,y,z = getElementPosition(object) setElementPosition ( object, x,y - prec,z ) end if key =="pgup" then x,y,z = getElementPosition(object) setElementPosition ( object, x,y,z + prec ) end if key =="pgdn" then x,y,z = getElementPosition(object) setElementPosition ( object, x,y ,z - prec ) end -- rotation -- if key =="mouse_wheel_up" then rx,ry,rz = getObjectRotation(object) setObjectRotation ( object, rx,ry,rz - prec * 5) end if key =="mouse_wheel_down" then rx,ry,rz = getObjectRotation(object) setObjectRotation ( object, rx,ry,rz + prec * 5) end if key =="u" then rx,ry,rz = getObjectRotation(object) setObjectRotation ( object, rx,ry - prec*10,rz) end if key =="o" then rx,ry,rz = getObjectRotation(object) setObjectRotation ( object, rx,ry + prec*10,rz) end if key =="[" then rx,ry,rz = getObjectRotation(object) setObjectRotation ( object, rx- prec*10,ry,rz) end if key =="]" then rx,ry,rz = getObjectRotation(object) setObjectRotation ( object, rx+ prec*10,ry,rz) end end
-
Im getting the Bad argument error on this gate script i found on the community resources, i couldn't fix it my self, i don't really wanna mess it up. Error: WARNING: [scripts]\gate\gateLoader.lua:24: Bad argument @ 'getTeamName' Script: gateList = {} gateListMoveToX = {} gateListMoveToY = {} gateListMoveToZ = {} gateListMoveTorX = {} gateListMoveTorY = {} gateListMoveTorZ = {} shapes = {} team = {} temp = {} status = {} -- 0 = not moving. 1 = moving to open. 2 = moving to close function checkClass(hitElement, matchingDimension) if ( getElementType(hitElement) == "vehicle" ) then hitElement = getVehicleController(hitElement) end for i=0,#gateList do local name = getTeamName(getPlayerTeam(hitElement)) if(name == false) then name = "false" end if ( name == team[i] or name == "true") then detection = isElementWithinColShape ( hitElement, shapes[i] ) if detection == true then move(i, false) end end end end function loadup(startedResource) gates = xmlLoadFile ( "gates.xml" ) count = xmlNodeGetChildren(gates) for i=1,#count do local gate = xmlFindChild ( gates, "gate", i-1 ) local attributes = xmlNodeGetAttributes ( gate ) for name,value in pairs ( attributes ) do temp["" .. name .. ""] = value end gateList[i] = createObject(temp["objectID"], temp["x"], temp["y"], temp["z"], temp["rx"], temp["ry"], temp["rz"]) gateListMoveToX[i] = temp["x2"] gateListMoveToY[i] = temp["y2"] gateListMoveToZ[i] = temp["z2"] gateListMoveTorX[i] = temp["rx2"] gateListMoveTorY[i] = temp["ry2"] gateListMoveTorZ[i] = temp["rz2"] outputDebugString("" .. temp["objectID"] .. "") shapes[i] = createColRectangle(temp["collisionx"], temp["collisionY"], temp["collisionZ"], temp["collisionSize"],temp["collisionSize"]) team[i] = temp["team"] setElementInterior(gateList[i], temp["interiorID"]) status[i] = 0 addEventHandler ( "onColShapeHit", shapes[i], checkClass ) end xmlUnloadFile ( gates ) end function move(gateIndex, rotate) -- 0 = not moving. 1 = moving to open. 2 = moving to close outputDebugString("moving..") x,y,z = getElementPosition(gateList[gateIndex]) rx,ry,rz = getObjectRotation(gateList[gateIndex]) if status[gateIndex] == 0 then moveObject ( gateList[gateIndex], 2000, gateListMoveToX[gateIndex], gateListMoveToY[gateIndex],gateListMoveToZ[gateIndex]) status[gateIndex] = 1 setTimer ( moveBack, 3000, 1,gateIndex, x,y,z,rx,ry,rz, raising ) end end function moveBack(index, x,y,z, raising) if status[index] == 1 then status[index] = 2 moveObject ( gateList[index], 2000, x,y,z, gateListMoveTorX[gateIndex],gateListMoveTorY[gateIndex],gateListMoveTorZ[gateIndex],rx,ry,rz ) setTimer ( resetTimer, 2000, 1, index ) end end function resetTimer(index) status[index] = 0 end addEventHandler ( "onResourceStart", getResourceRootElement(getThisResource()), loadup )
-
Ok thanks a lot Castillo.
-
Thanks, i'll do that. I just need another thing, is there anyway to make the "first" spawn only for first time players, for example, first time player joins the server they start on the "plane" and then they jump etc, next time they login they are at the position they left.
-
Thanks, but what if the player goes to a gun shop and buys some guns, how can i make it that those guns that they buyed are saved?
-
Hey guys i have made this Spawn/Respawn script, some issues i have is that on Spawn the player gets the guns, thats ok, but on respawn he has no guns anymore, anyway to fix that? Another problem is that when he dies, i wanted it to have fadeCamera then he respawns, but it doesn't work. My script: -- Spawn Player on Plane function spawn(prevA, curA, autoLogin) spawnPlayer ( source, -302.70001220703, 1437.9000244141, 835.70001220703, math.random (0,288), 0, 0 ) giveWeapon ( source, 46, 1 ) -- Parachute giveWeapon ( source, 25, 2500 ) -- Shotgun giveWeapon ( source, 22, 2000 ) -- Colt 45 fadeCamera ( source, true ) setCameraTarget ( source, source ) end addEventHandler( "onPlayerLogin", getRootElement(), spawn ) -- Respawn Player at Base addEventHandler( "onPlayerWasted", getRootElement( ), function() setTimer ( spawnPlayer, 5000, 1, source, -343.27581787109, 1537.6356201172, 75.5626, 180 ) end )
-
Kinda like that, but thats for the zombies not for the bot (nemesis). Thanks anyway.
-
Hmm, thanks. What about the "killmessages" part. "Nemesis GUN Player" or "Player GUN Nemesis", is that possible?
-
Doesn't work at all. function NemesisSpawn() nemesis = exports.slothbot:spawnBot( 2763,-2459,12.5,90,112,0,0,nil,38,"hunting" ) exports.slothbot:setBotAttackEnabled ( nemesis,true ) setElementHealth ( nemesis, 10000 ) end addEventHandler ( "onResourceStart",getResourceRootElement(), NemesisSpawn )
-
That's the boss (Nemesis), script i made, i saw on some topics that extrahealth doesn't work with him, anyway to make him with more health or something? Is there anyway i can make that in killmessages it says "Nemesis GUN Player" or "Player GUN Nemesis"? Thanks for your attention. function NemesisSpawn() nemesis = exports.slothbot:spawnBot( 1272.27,-1258.25,14,90,112,0,0,nil,33,"hunting" ) exports.slothbot:setBotAttackEnabled ( nemesis,true ) exports.extrahealth:addElementExtraHealth ( nemesis, 10000 ) end addEventHandler ( "onResourceStart",getResourceRootElement(), NemesisSpawn )