-
Posts
21,935 -
Joined
-
Last visited
-
Days Won
6
Everything posted by Castillo
-
What the..? you must use playSound function and it's only client-side.
-
myMarker = createMarker ( -696.35626220703, 966.18280029297, 12.28093624115 'corona', 2.0, 0, 120, 225, 150 )
-
You forgot a comma in createMarker function door = createObject (969, -693.33526611328, 961.4765625, 11.519198417664, 0, 0, 90) myMarker = createMarker ( -696.35626220703, 966.18280029297, 12.28093624115, 'corona', 2.0, 0, 120, 225, 150 ) function markerHit (player) local theAccount = getPlayerAccount(player) if theAccount then local accountName = getAccountName(theAccount) if isObjectInACLGroup ( "user." .. accountName, aclGetGroup ( "Admin" ) ) then moveObject ( door, 1500, -693.3701171875, 970.4765625, 11.519198417664 ) end end end addEventHandler ( "onMarkerHit", myMarker, markerHit ) function markerLeave (player) local theAccount = getPlayerAccount(player) if theAccount then local accountName = getAccountName(theAccount) if isObjectInACLGroup ( "user." .. accountName, aclGetGroup ( "Admin" ) ) then moveObject ( door, 1500, -693.33526611328, 961.4765625, 11.519198417664 ) end end end addEventHandler ( "onMarkerLeave", myMarker, markerLeave )
-
Sorry dude, i don't get you, i know "Daniels"? who's him? and i kicked what? i don't even know you..
-
I'm afraid your post makes no sense, qais. Back on the problem: You can't attach a bind to an ELEMENT, you need a function for that, try this code: --[[ ===================================================== Racemap : Mortal Kombat v2 ===================================================== ]]-- local root = getRootElement() local this = getThisResource() local resourceRoot = getResourceRootElement(this) local localPlayer = getLocalPlayer() local Marker = {} addEventHandler("onClientResourceStart", resourceRoot, function() Marker[1] = createMarker(2404.4, -3551.9, 7.6, "corona", 5, 0, 0, 0) outputChatBox ("Mortal Kombat v2", 255, 255, 0, true) local stereo1 = engineLoadTXD ( "shade.txd" ) engineImportTXD ( stereo1, 3458 ) setCloudsEnabled ( false ) setMinuteDuration(60000) setTimer (function() setTime (0, 0) end , 60000, 0) setWaterColor( 100, 0, 0 ) setWaveHeight ( 0 ) setSkyGradient( 100, 0, 0, 100, 0, 0 ) end ) addEventHandler("onClientResourceStop", root, function(res) if res == this then end end ) addEventHandler("onClientMarkerHit", root, function(player, matchingDimension) if not matchingDimension then return end if player == localPlayer and isPedInVehicle(player) then local vehicle = getPedOccupiedVehicle(player) if source == Marker[1] then local x, y, z = getElementPosition ( source ) local rx, ry, rz = getElementRotation ( source ) ramp = createObject ( 1634, x, y, z, rx, ry, rz ) attachElements ( ramp, vehicle, 0, 6, -1, 0, 0, 180 ) bindKey ( "mouse2", "down", function () moveObject ( ramp, 100, 1, 0, 0 ,0 ,0 ,0) end) end end end )
-
It's for the people who are too lazy. Strange, when i used "root" as getRootElement() it didn't worked (it was in an outputChatBox).
-
door = createObject (969, -693.33526611328, 961.4765625, 11.519198417664, 0, 0, 90) function opendoor (player) local theAccount = getPlayerAccount(player) if theAccount then local accountName = getAccountName(theAccount) if isObjectInACLGroup ( "user." .. accountName, aclGetGroup ( "Admin" ) ) then moveObject ( door, 1500, -693.3701171875, 970.4765625, 11.519198417664 ) end end end addCommandHandler ( "open", opendoor ) function closedoor (player) local theAccount = getPlayerAccount(player) if theAccount then local accountName = getAccountName(theAccount) if isObjectInACLGroup ( "user." .. accountName, aclGetGroup ( "Admin" ) ) then moveObject ( door, 1500, -693.33526611328, 961.4765625, 11.519198417664 ) end end end addCommandHandler ( "close", closedoor ) If you want to make it "auto" you need a marker or a collision shape. https://wiki.multitheftauto.com/wiki/Ser ... _functions https://wiki.multitheftauto.com/wiki/Ser ... _functions
-
[RSGP] Free Server Hosting! || THIS DEAL IS OVER!! ||
Castillo replied to Thomas_Matthew's topic in Hosting solutions
Turismo, i'm afraid this is over. -
Este script deberia ser server-side, ya que estas usando varias funciones server-side nada mas. function alphaCommand(player, command, alpha) local playerName = getAccountName ( getPlayerAccount ( player ) ) if isObjectInACLGroup ( "user." .. playerName, aclGetGroup ( "Admin" ) ) then alpha = alpha and tonumber(alpha) if alpha then setElementAlpha(player, alpha) end end end addCommandHandler('alpha', alphaCommand) addCommandHandler('ap', alphaCommand)
-
You want to check if the player who types the command is on "Admins" team, right? door = createObject (969, -693.33526611328, 961.4765625, 11.519198417664, 0, 0, 90) function opendoor (player) local team = getPlayerTeam(player) if team then if getTeamName(team) == "Admins" then x,z,y = getElementPosition(door) moveObject ( door, 1500, -693.3701171875, 970.4765625, 11.519198417664 ) end end end addCommandHandler ( "open", opendoor ) function closedoor (player) local team = getPlayerTeam(player) if team then if getTeamName(team) == "Admins" then x,z,y = getElementPosition(door) moveObject ( door, 1500, -693.33526611328, 961.4765625, 11.519198417664 ) end end end addCommandHandler ( "close", closedoor )
-
That could be a little annoying, since it will execute that function every time a resource starts.
-
No te entiendo, que quieres hacer? usar el script de alpha del Freeroam en tu propio resource?
-
addEventHandler("onClientGUIChanged", SearchMaps, function(element) local mapsearch = guiGetText(element) guiGridListClear(Shop) for i = 0, mapCount do if ( string.find ( string.upper ( tostring(Maps[i]) ) ), string.upper ( mapsearch ), 1, true ) ) then local row = guiGridListAddRow(Shop) guiGridListSetItemText(Shop, row, 1, tostring(Maps[i]), false, false) end end end ) That should work.
-
Clear the grid list and then do a timer to add the elements to the gridlist?
-
This doesn't has any kind of system to do what you mentioning, you should use a marker or a colshape. https://wiki.multitheftauto.com/wiki/Ser ... _functions https://wiki.multitheftauto.com/wiki/Ser ... _functions
-
You must store the maps into a table, then use this event: onClientGUIChanged, and loop through table to find the maps with the desired name.
-
this script is server side or client side?
-
You "bought" it huh? the whole Valhalla scripts are on the MTA community (again), i don't think you bought anything
-
Set "Allow colorcoded names" to false
-
--Server side function loginHandler(client, username, password) if (username == "user" and password == "apple") then if (client) then spawnPlayer(client, 1954.3701, -1768.8671, 13.5468) fadeCamera(client, true) setCameraTarget(client, client) outputChatBox("Welcome to my MTA:Server", client) showCursor(client,false) end else outputChatBox("Invalid username and password. Please re-connect and try again.",client) end end addEvent("submitLogin", true) addEventHandler("submitLogin", getRootElement(), loginHandler) --Client side function createLoginWindow() local X = 0.375 local Y = 0.375 local Width = 0.25 local Height = 0.25 wdwLogin = guiCreateWindow(X, Y, Width, Height, "Please Log In", true) X = 0.0825 Y = 0.2 Width = 0.25 Height = 0.25 guiCreateLabel(X, Y, Width, Height, "Username: ", true, wdwLogin) Y = 0.5 guiCreateLabel(X, Y, Width, Height, "Password: ", true, wdwLogin) X = 0.415 Y = 0.2 Width = 0.5 Height = 0.15 edtUser = guiCreateEdit(X, Y, Width, Height, "", true, wdwLogin) Y = 0.5 edtPass = guiCreateEdit(X, Y, Width, Height, "", true, wdwLogin) guiEditSetMaxLength(edtUser, 50) guiEditSetMaxLength(edtPass, 50) X = 0.415 Y = 0.7 Width = 0.25 Height = 0.2 btnLogin = guiCreateButton(X, Y, Width, Height, "Log In", true, wdwLogin) guiSetVisible(wdwLogin, false) addEventHandler("onClientGUIClick", btnLogin, clientSubmitLogin, false) end function clientSubmitLogin(button, state) if (button == "left" and state == "up") then local username = guiGetText(edtUser) local password = guiGetText(edtPass) if (username and password) then triggerServerEvent("submitLogin", getLocalPlayer(), getLocalPlayer(), username, password) guiSetInputEnabled(false) guiSetVisible(wdwLogin, false) else outputChatBox("Please enter a username and password.") end end end addEventHandler("onClientResourceStart", getResourceRootElement(getThisResource()), function () createLoginWindow() outputChatBox("Welcome to My New MTA:Server, please Log In") if (wdwLogin ~= nil) then guiSetVisible(wdwLogin, true) showCursor(true) guiSetInputEnabled(true) else outputChatBox("An unexpected error has occurred and the log in GUI has not been created.") end end) It works now.
-
Pleomax, that's valhalla scripts, he or anyone else shouldn't use them without their permission.
-
Uhm, no.. i've closed my RPG server long time ago, remade some stuff from it some weeks ago, but nothing else, still thinking if i will re-open it or not, but this script isn't for me really, just for my client (working for a guy for $$).
