-
Posts
21,935 -
Joined
-
Last visited
-
Days Won
6
Everything posted by Castillo
-
Lo que queres es reiniciar un recurso cada 30 minutos? si es asi, usa las siguientes funciones: setTimer getResourceFromName restartResource P.D: Para que necesitas esto exactamente?
-
Lo que queres hacer es restringir un comando para ser usado cad X tiempo? si es asi, entonces podes usar la siguiente funciones: getTickCount con esta funcion podes calcular cuanto paso desde que se ejecuto el comando ( tenes que guardar en una variable o una tabla cuando uses el comando el valor de getTickCount ).
-
Estas usando freeroam?
-
You're welcome.
-
Copy it again.
-
local VEH = { [ 581 ] = true, [ 509 ] = true, [ 481 ] = true, [ 462 ] = true, [ 521 ] = true, [ 463 ] = true, [ 510 ] = true, [ 522 ] = true, [ 461 ] = true, [ 448 ] = true, [ 468 ] = true, [ 586 ] = true } function onEnterVehicle ( theVehicle, seat, jacked ) if VEH [ getElementModel ( theVehicle ) ] then addPedClothes ( source, "moto", "moto", 16 ) end end addEventHandler ( "onPlayerVehicleEnter", getRootElement(), onEnterVehicle ) function onExitVehicle ( theVehicle, seat, jacked ) if VEH [ getElementModel ( theVehicle ) ] then removePedClothes ( source, 16 ) end end addEventHandler ( "onPlayerVehicleExit", getRootElement(), onExitVehicle )
-
If you leave that getLocalPlayer there, the script won't work.
-
Tema movido.
-
Post the server side part where you trigger: "gang.returnGangBank". Edit: Now that I compared your code to one of my scripts, I noticed that they're pretty much the same thing. addEvent ( "gangSystem:returnGangBank", true ) addEventHandler ( "gangSystem:returnGangBank", root, function ( balance, actions ) guiSetText ( gangGUI[ "gangPanel" ][ "money_balance" ], tostring ( balance ) ) guiGridListClear ( gangGUI[ "gangPanel" ][ "money_action_list" ] ) for index, action in ipairs ( actions ) do local row = guiGridListAddRow ( gangGUI[ "gangPanel" ][ "money_action_list" ] ) guiGridListSetItemText ( gangGUI[ "gangPanel" ][ "money_action_list" ], row, 1, tostring ( action[ "action" ] ), false, false ) end end ) And I know why, it's because one of your servers ( SORC:ZM ) is using leaked scripts of my property. Topic locked.
-
Not alone, because it doesn't have a player element.
-
You're welcome.
-
Example: Resource 1: function exported ( text ) outputChatBox ( text ) end meta.xml: function="exported" type="server" /> Resource 2: exports [ "resource-1" ]:exported ( "Hello World!" )
-
function buyCarColor(thePlayer,red,green,blue) local account = getPlayerAccount(thePlayer) if not (isGuestAccount(account)) then setAccountData(account,"firstRed",red) setAccountData(account,"firstGreen",green) setAccountData(account,"firstBlue",blue) outputChatBox("#00ff00[sHOP] #ffffff---!",thePlayer,255,255,255,true) local PVeh = getPedOccupiedVehicle(thePlayer) setVehicleColor(PVeh,red,green,blue) end end function callClientFunction(client, funcname, ...) local arg = { ... } if (arg[1]) then for key, value in next, arg do if (type(value) == "number") then arg[key] = tostring(value) end end end -- If the clientside event handler is not in the same resource, replace 'resourceRoot' with the appropriate element triggerClientEvent(client, "onServerCallsClientFunction", resourceRoot, funcname, unpack(arg or {})) end function callServerFunction(funcname, ...) local arg = { ... } if (arg[1]) then for key, value in next, arg do arg[key] = tonumber(value) or value end end loadstring("return "..funcname)()(unpack(arg)) end addEvent("onClientCallsServerFunction", true) addEventHandler("onClientCallsServerFunction", resourceRoot , callServerFunction) function updatePlayerLogin( ) local account = getPlayerAccount( source ) red = getAccountData(account,"firstRed") green = getAccountData(account,"firstGreen") blue = getAccountData(account,"firstBlue") local PVeh = getPedOccupiedVehicle(source) setVehicleColor(PVeh,red,green,blue) end addEventHandler("onPlayerLogin", getRootElement(),updatePlayerLogin)
-
Syntax of exported functions? there's no syntax, you just export it.
-
Busca en la comunidad por un save system.
-
One of these "Col*" is returning nil.
-
local text = ( 5 > 4 and "I'm bigger!" or "I'm smaller..." ) outputChatBox ( text ) You can also do that.
-
No, tenes que enviar el evento al client side, podes usar esto: addEvent ( "onPlayerRegister", true ) addEventHandler ( "onPlayerRegister", root, function ( ) triggerClientEvent ( source, "onPlayerRegister", source ) end )
-
El evento es solo server side.
-
Maybe there's an script changing the nametag color to white.
-
------------------------------------------ -- Dx Login Panel -- ------------------------------------------ -- Developer: Braydon Davis (xXMADEXx) -- -- File: server.lua -- -- Copyright 2013 (C) Braydon Davis -- -- All rights reserved. -- ------------------------------------------ local cameras = { { 329.10980224609, -2117.2749023438, 50.161201477051, 329.65179443359, -2116.4926757813, 49.853763580322 }, { 1266.0053710938, -1965.7087402344, 114.59829711914, 1265.1549072266, -1966.1115722656, 114.25980377197 }, { 1514.0283203125, -1716.5743408203, 39.910701751709, 1514.5087890625, -1715.865234375, 39.394691467285 }, { 1338.7514648438, -875.66558837891, 99.84880065918, 1339.4935302734, -875.07824707031, 99.52579498291 }, { 1426.5421142578, -725.40289306641, 120.97090148926, 1427.3695068359, -725.00805664063, 120.571434021 }, { 1357.5914306641, -592.23327636719, 125.15190124512, 1357.1751708984, -593.02673339844, 124.70780944824 }, { 988.01123046875, -341.88409423828, 74.752601623535, 988.70251464844, -342.45135498047, 75.200187683105 }, { -224.32290649414, -153.71020507813, 35.085899353027, -223.61195373535, -153.04695129395, 34.852146148682 } } function openView( plr ) local theplr = nil if ( source and getElementType ( source ) == 'player' ) then theplr = source elseif ( plr and getElementType ( plr ) == 'player' ) then theplr = plr end setTimer ( function ( p ) local ind = math.random ( #cameras ) setCameraMatrix ( p, unpack ( cameras[ind] ) ) end, 700, 1, theplr ) end addEventHandler ( "onPlayerJoin", root, openView ) addEventHandler ( "onPlayerLogout", root, openView ) --addCommandHandler ( 'view', openView ) function attemptLogin ( user, pass ) if ( user and pass and type ( user ) == 'string' and type ( pass ) == 'string' ) then --local user = string.lower ( user ) --local pass = string.lower ( pass ) local account = getAccount ( user ) if ( account ) then if ( not logIn ( source, account, pass ) ) then message ( source, "Incorrect password." ) return false end setCameraTarget ( source, source ) triggerLogin ( source, user, pass ) else message ( source, "Unknown account." ) return false end end return false end addEvent ( "Login:onClientAttemptLogin", true ) addEventHandler ( "Login:onClientAttemptLogin", root, attemptLogin ) function attemptRegister ( user, pass ) if ( user and pass and type ( user ) == 'string' and type ( pass ) == 'string' ) then --local user = string.lower ( user ) --local pass = string.lower ( pass ) local account = getAccount ( user ) if ( not account ) then local account = addAccount ( user, pass ) if ( account ) then if ( not logIn ( source, account, pass ) ) then return message ( source, "Logging in has failed." ) end triggerEvent ( "onPlayerRegister", source ) setCameraTarget ( source, source ) triggerLogin ( source, user, pass ) else message ( source, "Adding account failed.\nPlease report to an admin." ) end else message ( source, "This account already exists." ) end end return false end addEvent ( "Login:onClientAttemptRegistration", true ) addEventHandler ( "Login:onClientAttemptRegistration", root, attemptRegister ) function message ( source, msg ) triggerClientEvent ( source, "onPlayerLoginPanelError", source, msg ) end function triggerLogin ( source, user, pass ) triggerClientEvent ( source, "onClientPlayerLogin", source, user, pass ) end addEventHandler ( 'onPlayerLogout', root, function ( ) triggerClientEvent ( source, 'onClientPlayerLogout', source ) end ) Ok, con esto ahora tenes un evento llamado: "onPlayerRegister" que podes usar en otros scripts, ejemplo: addEvent ( "onPlayerRegister", true ) addEventHandler ( "onPlayerRegister", root, function ( ) outputChatBox ( getPlayerName ( source ) .." es nuevo en el servidor, bienvenido!", root, 0, 255, 0 ) end )
-
Postea el script server side del recurso ese.