-
Posts
1,102 -
Joined
Everything posted by Enargy,
-
Hey, I wonder who is the safest database to save data, if SQLite or MySQL(or need to learn both ). the issue is that I want to learn to use one of these two options to create my own systems or something else. Thnx.
-
ó simplemente tambien puedes usar este modo(es mas sencillo): local screenW, screenH = guiGetScreenSize() local showGUI = true acepto = guiCreateButton(403, 649, 116, 28, "I accept", false) declino = guiCreateButton(525, 649, 116, 28, "I decline", false) addEventHandler("onClientRender", root, function() if (showGUI) == true then dxDrawRectangle((screenW - 699) / 2, (screenH - 625) / 2, 699, 625, tocolor(0, 136, 255, 200), false) dxDrawText("¡Welcome to our server!", 363, 93, 622, 158, tocolor(255, 255, 255, 255), 3, "default-bold", "center", "center", false, false, true, true, false) dxDrawLine(163, 697, 863, 697, tocolor(0, 0, 0, 255), 3, true) dxDrawLine(163, 697, 863, 697, tocolor(0, 0, 0, 255), 3, true) dxDrawLine(163, 72, 863, 72, tocolor(0, 0, 0, 255), 5, true) dxDrawText("Before you start you should know a few things", 241, 148, 708, 227, tocolor(0, 0, 0, 255), 2, "default-bold", "left", "top", false, false, true, true, false) dxDrawText("#FFFFFF* #333333You must be respectful with players and admins", 192, 297, 470, 347, tocolor(255, 255, 255, 255), 2, "default-bold", "left", "top", false, false, true, true, false) dxDrawText("#FFFFFF* #333333This is a Race Deathmatch server", 192, 247, 470, 297, tocolor(255, 255, 255, 255), 2, "default-bold", "left", "top", false, false, true, true, false) dxDrawText("#FFFFFF* #333333Don't answer for money or admin rights you need to earn by yourself", 192, 347, 470, 397, tocolor(255, 255, 255, 255), 1.5, "default-bold", "left", "top", false, false, true, true, false) dxDrawText("#FFFFFF* #333333Flood, Cheating, and Glitching isn't allowed in this server", 192, 397, 470, 447, tocolor(255, 255, 255, 255), 1.7, "default-bold", "left", "top", false, false, true, true, false) dxDrawText("#FFFFFF* #333333Don't be a Dumbass", 192, 447, 470, 497, tocolor(255, 255, 255, 255), 2, "default-bold", "left", "top", false, false, true, true, false) dxDrawText("#FFFFFF* #333333Don't be a Dumbass", 192, 447, 470, 497, tocolor(255, 255, 255, 255), 2, "default-bold", "left", "top", false, false, true, true, false) dxDrawText("#FFFFFFHope you enjoy the server->", 241, 653, 519, 703, tocolor(255, 255, 255, 255), 1, "default-bold", "left", "top", false, false, true, true, false) dxDrawText("#FFFFFF<-Don't go back!", 641, 653, 919, 703, tocolor(255, 255, 255, 255), 1, "default-bold", "left", "top", false, false, true, true, false) showCursor(true) else return end end ) addEventHandler("onClientGUIClick", root, function() if ( source == acepto ) then showGUI = false showCursor(false) end end )
-
client.lua local vehicleMarker = createMarker(-2404.1486816406, -2201.865234375, 32.2,"cylinder",1,255,255,255) function vehicleGUI() vehicleGUI = guiCreateWindow(277, 204, 269, 266, "Vehicle Shop", false) guiWindowSetSizable(vehicleGUI, false) guiSetVisible(vehicleGUI,false) vehicleFBITruck = guiCreateButton(9, 69, 250, 40, "Sd.Kfz.222", false, vehicleGUI) vehicleClose = guiCreateButton(178, 218, 81, 27, "Close", false, vehicleGUI) end addEventHandler("onClientResourceStart",resourceRoot,vehicleGUI) function playerOnMarker() if isElementWithinMarker(localPlayer, vehicleMarker) then guiSetVisible(vehicleGUI, true) showCursor( true ) end end addEventHandler("onClientMarkerHit", vehicleMarker, playerOnMarker) function closeGUI() if source == vehicleClose then guiSetVisible(vehicleGUI,false) showCursor(false) end end addEventHandler("onClientGUIClick",getRootElement(),closeGUI) function vehicleBuy() if source == vehicleFBITruck then triggerServerEvent("onVehicleBought",localPlayer) guiSetVisible(vehicleGUI,false) showCursor( false ) end end addEventHandler("onClientGUIClick",getRootElement(),vehicleBuy)
-
You're welcome.
-
https://wiki.multitheftauto.com/wiki/FetchRemote
-
try this: local SoundEnabled = false function disablePlayLocalMusic(playerSource, command) if (playerSource) then if(SoundEnabled) then SoundEnabled = false outputChatBox ( "Ambience Sounds Disabled!", playerSource ) elseif not (SoundEnabled) then outputChatBox ( "Ambience Sounds Already Disabled!", playerSource ) end end end addCommandHandler ( "OffAmbience", disablePlayLocalMusic) function enablePlayLocalMusic(playerSource, command) if (playerSource) then if(SoundEnabled) then outputChatBox ( "Ambience Sounds Already Enabled!", playerSource ) elseif not (SoundEnabled) then SoundEnabled= true outputChatBox ( "Ambience Sounds Enabled!", playerSource ) end end end addCommandHandler ( "OnAmbience", enablePlayLocalMusic) PD: Where is function sound() exactly?
-
Not bad. good job
-
try this: function onMessage(message, messageType) if messageType == 0 then if message == "police" or message == "terrorist" or message == "president" then textDisplayRemoveObserver(dis,source) textDisplayRemoveObserver(dis1,source) textDisplayRemoveObserver(dis2,source) end end end addEventHandler("onPlayerChat", root, onMessage)
-
Updated! 1.2.0 - A new exception was added in the meta file to restrict the use of commands by Admin group. https://community.multitheftauto.com/index.php?p= ... 944d=10944
-
---SERVER-SIDE function vehicleFBITruck() if ( getPlayerMoney (source) >= 3000 ) then takePlayerMoney(source, 3000) outputChatBox("You have bought Sd.Kfz.222 vehicle.",source) else outputChatBox('You dont have enough money to buy this Vehicle.', source, 255, 0, 0 ) end end) addEvent("onVehicleBought", true) addEventHandler("onVehicleBought", getRootElement(), vehicleFBITruck) ---CLIENT-SIDE triggerServerEvent("onVehicleBought", localPlayer) the rest you must add it.
-
wtf? wrong code, you cannot use a mixed function.
-
you think someone will do what you ask? you're wrong.
-
[quote name=..&G:..]People can compile them themselves after they edited them as they wanted. For example I cannot use the script because I cannot configure it with my gamemode The script was made to work for any gamemode and also for a custom hud
-
I don't think being compiled affect so much and its just for security case
-
GetResourceFromName not working with onClientResourceStart?
Enargy, replied to BlueTheFurry's topic in Scripting
function start() ---your code here end addEventHandler("onClientResourceStart", resourceRoot, start) sorry I'm at the phone. -
you can use somethin' like this: function spawnCar(thePlayer, command) local x,y,z = getElementPosition(thePlayer) local playerTeam = getPlayerTeam(thePlayer) if playerTeam then local teamName = getTeamName(playerTeam) if ( teamName == "NAVY" ) then car = createVehicle(411, x,y,z) warpPedIntoVehicle(thePlayer, car) else outputChatBox("You're not part of NAVY team!", thePlayer, 255, 0, 0, false) end end end addCommandHandler("spawnc", spawnCar) check it out https://wiki.multitheftauto.com/
-
try this in serverside: addEventHandler("onPlayerCommand", root, function(cmd) if (cmd == "login") then cancelEvent() end end)
-
< Coin System > Hey guys, I bring a coin system to avoid both use money game and use something different can have for a roleplay or specific server. * features: this system gives also be able to use in different incidents since it has functions that can be exported from himself. - SERVER (syntax): · setPlayerCoin (player theplayer, int amount) - set a specific value. · givePlayerCoin (player theplayer, int amount) - establishes a summed with the previous value. · takePlayerCoin (player theplayer, int amount) - the specific value is taken. · getPlayerCoin (player theplayer) - gets the values that has a player. - CLIENT-SIDE (syntax): · getPlayerCoin (player theplayer) Examples: Commands (only admins) there are commands that can only be used by the admin group. syntax: /setcoin <playername> <amount> syntax: /givecoin <playername> <amount> EDIT: Changelog [b]1.3.0[/b] - META config was removed by some bugs that caused and it was decompiled to edit your preference. [b]1.2.0[/b] - Some bugs was fixed. [b]1.1.0[/b] - Resource release. Download: https://community.multitheftauto.com/index.php?p=resources&s=details&id=10944 Thnx
-
Debias usar 'onPlayerJoin' para poder bindear la tecla, el codigo en sí esta bien pero olvidaste agregar el 'bindKey' a la hora de entrar. function globalMessage(thePlayer, cmd, ...) local message = table.concat ( { ... }, " " ); local name = getPlayerName(thePlayer); local account = getAccountName ( getPlayerAccount ( thePlayer ) ) if isObjectInACLGroup("user." .. account, aclGetGroup("Admin")) then outputChatBox("#ff0000*[ADMIN]*#FFFFFF"..name..": #FFFFFF"..message,root, 255, 255, 255, true) return else end local account = getAccountName ( getPlayerAccount ( thePlayer ) ) if isObjectInACLGroup("user." .. account, aclGetGroup("SuperModerator")) then outputChatBox("#000fff*[sMOD]*#FFFFFF"..name..": #FFFFFF"..message,root, 255, 255, 255, true) return else end local account = getAccountName ( getPlayerAccount ( thePlayer ) ) if isObjectInACLGroup("user." .. account, aclGetGroup("VIP")) then outputChatBox("#ffff00*[VIP]*#FFFFFF"..name..": #FFFFFF"..message,root, 255, 255, 255, true) return else end local account = getAccountName ( getPlayerAccount ( thePlayer ) ) if isObjectInACLGroup("user." .. account, aclGetGroup("Moderator")) then outputChatBox("#00ff00*[MOD]*#FFFFFF"..name..": #FFFFFF"..message,root, 255, 255, 255, true) return else outputChatBox("#123456[Global]#FFFFFF"..name..": #FFFFFF"..message,root, 255, 255, 255, true) return end end addCommandHandler("global", globalMessage) addEventHandler("onResourceStart", getResourceRootElement(getThisResource()), function() for index,player in pairs(getElementsByType("player")) do bindKey(player,"x", "down", "chatbox", "global") end end) addEventHandler("onPlayerJoin", root,function() bindKey(source, "x", "down", "chatbox", "global") end)
-
Bueno la cuestión es que en servidores vacíos con recursos por defectos no hace mucha diferencia, pero en los que tienen tantos puede ocasionar una pequeña, o gran diferencia en el soporte del computador que puede tener el jugador.
-
the resolution can not be changed when the player will log in.
-
function replaceTXD() txd = engineLoadTXD("txdFile.txd") engineImportTXD( txd, 30152) --- afro hair id end addEventHandler("onClientResourceStart", resourceRoot, replaceTXD)
-
is necessary using shaders? why did not try with engineLoadTXD & engineImportTXD?
