-
Posts
343 -
Joined
-
Last visited
-
Days Won
6
Everything posted by RekZ
-
Spawn a hoverboard! Command : /hoverboard left shift for jump Add: Custom Animation. Custom Model. Hover Jump. Remove when leave the vehicle. Replace the Faggio. (Model and Animation arent mine) Link Community Resource Download YouTube Video
-
i cant help you if you dont help me to do it.. i do what you said maybe you dont restart the resource or dont put the script in the correct place i cant install the resource for you, sorry. --- A part of the post was hidden, please don't go to the extremes (Tut)
-
I think i dont known what you want jajaja, This is what you want ? (see the video xd) Video
-
I test it whit my users and work fine like you want, send the code where you are working
-
Because is a table you cant use local in the table, remove it xd in my last code is fine, i test the code now in my server and work good local table = {} -- BAD table = {} -- good :v
-
Ups i see my error now creados = {} function getVehicleInUse(veh) local user = 0 for seat, player in pairs(getVehicleOccupants(veh)) do user = user + 1 end return (user or 0) end function createVehicleForPlayer(thePlayer, command, model) if tonumber(model) then if not isPedInVehicle (thePlayer) then if creados[thePlayer] == nil then local x, y, z = getElementPosition(thePlayer) creados[thePlayer] = nil creados[thePlayer] = createVehicle( model, x+5, y, z) warpPedIntoVehicle(thePlayer, creados[thePlayer]) else if getVehicleInUse(creados[thePlayer]) == 0 then destroyElement(creados[thePlayer]) local x, y, z = getElementPosition(thePlayer) creados[thePlayer] = nil creados[thePlayer] = createVehicle( model, x+5, y, z) warpPedIntoVehicle(thePlayer, creados[thePlayer]) end end end end end addCommandHandler("vh", createVehicleForPlayer) function onPlayerQuitPlayer () if isElement(creados[source]) then destroyElement(creados[source]) creados[source] = nil end end addEventHandler ( "onPlayerQuit", getRootElement(), onPlayerQuitPlayer )
-
I'm not sure if this can help you i dont test it function getVehicleInUse(veh) local user = 0 for seat, player in pairs(getVehicleOccupants(veh)) do user = user + 1 end return (user or 0) end function createVehicleForPlayer(thePlayer, command, model) if not isPedInVehicle (thePlayer) then if creados[thePlayer] == nil then local x, y, z = getElementPosition(thePlayer) creados[thePlayer] = nil creados[thePlayer] = createVehicle( model, x+5, y, z) warpPedIntoVehicle(thePlayer, creados[thePlayer]) else if getVehicleInUse(creados[thePlayer]) > 0 then destroyElement(creados[thePlayer]) local x, y, z = getElementPosition(thePlayer) creados[thePlayer] = nil creados[thePlayer] = createVehicle( model, x+5, y, z) warpPedIntoVehicle(thePlayer, creados[thePlayer]) end end end end addCommandHandler("vh", createVehicleForPlayer) function onPlayerQuitPlayer () if isElement(creados[source]) then destroyElement(creados[source]) creados[source] = nil end end addEventHandler ( "onPlayerQuit", getRootElement(), onPlayerQuitPlayer )
-
Soo you want to create the car and if there is someone inside the car stop the command ?
-
Maybe this can help you function createVehicleForPlayer(thePlayer, command, model) if not isPedInVehicle (thePlayer) then if creados[thePlayer] == nil then local x, y, z = getElementPosition(thePlayer) creados[thePlayer] = nil creados[thePlayer] = createVehicle( model, x+5, y, z) warpPedIntoVehicle(thePlayer, creados[thePlayer]) else destroyElement(creados[thePlayer]) local x, y, z = getElementPosition(thePlayer) creados[thePlayer] = nil creados[thePlayer] = createVehicle( model, x+5, y, z) warpPedIntoVehicle(thePlayer, creados[thePlayer]) end end end addCommandHandler("vh", createVehicleForPlayer) function onPlayerQuitPlayer () if isElement(creados[source]) then destroyElement(creados[source]) creados[source] = nil end end addEventHandler ( "onPlayerQuit", getRootElement(), onPlayerQuitPlayer )
-
All the chat system is Server side for what i known, why you dont get the chat in the server side ? Sending the client's information to the server is an inefficient in this case i think.
-
Put this in to a client side lua local alpha = 255 bindKey ( "aim_weapon", "both", function ( _, state ) if getPedWeaponSlot(localPlayer) == 6 or getPedWeaponSlot(localPlayer) == 5 then if ( state == "down" ) then alpha = 0 elseif ( state == "up" ) then alpha = 255 end if getPedWeapon(localPlayer) == 34 then for _, v in ipairs ( getElementsByType("object",resourceRoot,true) ) do if isElementAttachedToBone ( v ) then if getPedWeaponSlot (localPlayer) == 6 then setElementAlpha ( v, alpha ) end end end end end end )
-
local sW,sH = guiGetScreenSize() -- Get Windows Resolution dont need to be render function onClientRender () if (getPedWeapon(localPlayer) == 34) then if ((getPedTask(localPlayer, "secondary", 0) == "TASK_SIMPLE_USE_GUN") and getPedControlState("aim_weapon")) then if isPlayerHudComponentVisible("crosshair") then setPlayerHudComponentVisible("crosshair",false) end dxDrawImage(0, 0, sW, sH, "crosshair.png", 0, 0, 0, tocolor(255, 255, 255, 255), true) else if not isPlayerHudComponentVisible("crosshair") then setPlayerHudComponentVisible("crosshair",true) end end else if not isPlayerHudComponentVisible("crosshair") then setPlayerHudComponentVisible("crosshair",true) end end end addEventHandler("onClientRender",root,onClientRender)
-
For what i see in others servers, people use this to create a new crossair and change it when the player want function onClientRender () if (getPedWeapon(localPlayer) == 34) then if ((getPedTask(localPlayer, "secondary", 0) == "TASK_SIMPLE_USE_GUN") and getPedControlState("aim_weapon")) then local sW,sH = guiGetScreenSize() dxDrawImage(0, 0, sW, sH, "crosshair.png", 0, 0, 0, tocolor(255, 255, 255, 255), true) end end end addEventHandler("onClientRender",root,onClientRender)
-
Server Side function onPlayerSpawn() if isElement(source) then -- Source here is the player if getTeamName(getPlayerTeam(source)) == "Red Team" then -- Team Name giveWeapon(source, 31, 500, true) -- Weapon elseif getTeamName(getPlayerTeam(source)) == "Blue Team" then -- Team Name giveWeapon(source, 30, 500, true) -- Weapon end end end addEventHandler("onPlayerSpawn", root, onPlayerSpawn)
-
This resource will make players who are in a different team give headshot to each other, but if they are from the same team nothing will happen. Server.Lua function MakePlayerHeadshot( attacker, weapon, bodypart, loss ) if isElement(attacker) then if getElementType ( attacker ) == "player" then if getPlayerTeam( source ) ~= getPlayerTeam( attacker ) then if bodypart == 9 then triggerEvent( "onPlayerHeadshot", source, attacker, weapon, loss ) setPedHeadless ( source, true ) killPed( source, attacker, weapon, bodypart ) setTimer( BackUp, 900, 1, source ) end end end end end function MakeHeadshot( source, attacker, weapon, loss ) triggerEvent( "onPlayerHeadshot", source, attacker, weapon, loss ) killPed( source, attacker, weapon, 9 ) setPedHeadless ( source, true ) setTimer( BackUp, 900, 1, source ) end function BackUp( source ) if getElementType ( source ) == "player" then setPedHeadless ( source, false ) end end addEvent ( "onServerHeadshot", true ) addEventHandler( "onPlayerDamage", getRootElement(), MakePlayerHeadshot ) addEventHandler( "onServerHeadshot", getRootElement(), MakeHeadshot ) Client.Lua function sendHeadshot ( attacker, weapon, bodypart, loss ) if attacker == getLocalPlayer() then if (getElementType(attacker) == "player") then if getPlayerTeam( source ) ~= getPlayerTeam( attacker ) then if bodypart == 9 then triggerServerEvent( "onServerHeadshot", getRootElement(), source, attacker, weapon, loss ) setElementHealth ( source, 0 ) setPedHeadless( source, true ) end end end end end --addEventHandler ( "onClientPedDamage", getRootElement(), sendHeadshot ) addEventHandler ( "onClientPlayerDamage", getRootElement(), sendHeadshot ) meta.xml <meta> <script src="Server.Lua" type="server" /> <script src="Client.Lua" type="client" /> </meta>
-
Dont hate me but you forget to remove.. <include resource="CCS_challenge" /> and if we dont have the CCS_database, how i can use your userpanel ? [2020-06-18 01:24:49] ERROR: [MGM]\[Script]\[General]\CCS_userpanel\userpanel_s.Lua:283: exports: Call to non-running server resource (CCS_stats) [string "?"] [2020-06-18 01:24:49] ERROR: [MGM]\[Script]\[General]\CCS_userpanel\userpanel_s.Lua:30: exports: Call to non-running server resource (CCS_database) [string "?"] [2020-06-18 01:24:49] ERROR: [MGM]\[Script]\[General]\CCS_userpanel\userpanel_s.Lua:75: exports: Call to non-running server resource (CCS_database) [string "?"] [2020-06-18 01:24:49] ERROR: [MGM]\[Script]\[General]\CCS_userpanel\userpanel_s.Lua:219: exports: Call to non-running server resource (CCS_database) [string "?"] [2020-06-18 01:24:49] WARNING: [MGM]\[Script]\[General]\CCS_userpanel\userpanel_s.Lua:221: Bad argument @ 'dbQuery' [Expected db-connection at argument 3, got nil]
-
Acabo de mirarlo y da errores de que la base de datos que crea el propio resource esta bloqueada xd no tengo idea de eso pero te dejo el problema para que tengas un poco mas claro que ocurre, Salu2
- 26 replies
-
Mandarle eso a alguien nuevo es una tremenda invitacion a dejar el foro y el juego xd por eso la parte español del foro tiene tan pero tan mala fama entre todos los que hablamos español... Podrias probar el Valhalla en su tiempo estaba muy lindo, nose si le habran pasado factura los años.
-
Its cool but you forget some resources like logger and ccs_database
-
What i can do if other server use my server tag in the server name ?
-
I have been looking for ways to lower the impact that mod loading has on the client, would it be a good idea to separate the mods by tables and load the mods every 5 seconds ? local WeaponsModels = { ["AK"] = { {FILE="AK/Weapon1" , ID=00000}, {FILE="AK/Weapon2" , ID=00000}, {FILE="AK/Weapon3" , ID=00000}, {FILE="AK/Weapon4" , ID=00000}, {FILE="AK/Weapon5" , ID=00000}, {FILE="AK/Weapon6" , ID=00000}, }, ["CPL"] = { {FILE="CPL/Weapon1" , ID=00000}, {FILE="CPL/Weapon2" , ID=00000}, {FILE="CPL/Weapon3" , ID=00000}, {FILE="CPL/Weapon4" , ID=00000}, {FILE="CPL/Weapon5" , ID=00000}, {FILE="CPL/Weapon6" , ID=00000}, }, } function load() if not getElementData(localPlayer,"login") then setTimer(load,10000,1) outputChatBox ( "Reload" ) return end setTimer(function() for index, weapon in pairs(WeaponsModels["AK"]) do engineImportTXD ( engineLoadTXD ( "models/"..weapon.FILE.. ".txd", weapon.ID ), weapon.ID ) engineReplaceModel ( engineLoadDFF ( "models/"..weapon.FILE.. ".dff", weapon.ID ), weapon.ID, true ) engineSetModelLODDistance( weapon.ID , 100 ) end outputChatBox ( "Mods AK" ) end, 1000, 1 ) setTimer(function() for index, weapon in pairs(WeaponsModels["CPL"]) do engineImportTXD ( engineLoadTXD ( "models/"..weapon.FILE.. ".txd", weapon.ID ), weapon.ID ) engineReplaceModel ( engineLoadDFF ( "models/"..weapon.FILE.. ".dff", weapon.ID ), weapon.ID, true ) engineSetModelLODDistance( weapon.ID , 100 ) end outputChatBox ( "Mods CPL" ) end, 5000, 1 ) end addEventHandler ( "onClientResourceStart", getResourceRootElement(), load )