-
Posts
99 -
Joined
-
Last visited
Posts posted by Om.
-
-
OR, You can use something like table to protect many nicks e.g
local protected = { ["Nickname1"] = "Player 1 Serial", ["Nickname2"] = "Player 2 Serial" } function checkForNickname() local name = getPlayerName(source) if protected[name] then local serial = getPlayerSerial(source) if serial ~= protected[name] then kickPlayer(source, "Nickname is protected!") end end end addEventHandler("onPlayerJoin", root, checkForNickname) addEventHandler("onPlayerChangeNick", root, checkforNickname)
Still didn't test it tho, should work
-
not so exp, but tried using cancelEvent() before calling chatMain function?
-
If you mean this:
SpoilerThen it's probably your pc. For me, this error occurs whenever I don't have my audio device (Headphones/Speakers) plugged in. If it's plugged in then i get no error(s). Incase you've already plugged your headsets and it still says the same, You gotta install Realtek Audio Drivers
-
You can use mine, although it's a bit hard to install, i've mentioned the installation steps on the topic.
Resource: https://community.multitheftauto.com/index.php?p=resources&s=details&id=13930
Topic:
-
On 12/23/2016 at 0:05 AM, Arran said:
Should be more like:
setTimer(setElementData, 60000 * 10, 1, thePlayer, "isPlayerMuted", false)
But thePlayer could easily have quit within those 10 minutes. Also your entire script is fundamentally flawed because there is no verification of permission, such things should be done server side and verify permission with hasObjectPermissionTo and there is also avoid using setElementData for important stuff like whether someone is muted unless you have server side checks to prevent that element data being changed by a client. Further reading on that here:
https://wiki.multitheftauto.com/wiki/Script_security
Well, This one worked too :3 thank you
-
4 hours ago, wazoka93 said:
[2016-12-21 17:43:39] WARNING: exg_carshop\sourceS.lua:65: Bad argument @ 'dbQuery' [Expected db-connection at argument 1]
[2016-12-21 17:43:39] WARNING: exg_carshop\sourceS.lua:68: Bad argument @ 'dbPoll' [Expected db-query at argument 1, got boolean]
[2016-12-21 17:45:03] WARNING: mta_speedo\ex_Server.lua:4: Bad argument @ 'dbExec' [Expected db-connection at argument 1]
[2016-12-21 17:45:24] WARNING: mta_vehicle\sourceS.lua:267: Bad argument @ 'dbQuery' [Expected db-connection at argument 1]whats the problem? please help
in dbQuery, you have to put 2 argument, first the connection handler, second is mysql query. Example:
conn = dbConnect("blabla") query = dbQuery(conn, "Your MySQL Query.")
- 1
-
Oh. i see, thanks. I'll try that
-
function mutePlayer(button) if button == "left" then if (source == playerTab.button[2]) then player = guiGridListGetSelectedItemText(GUIEditor.gridlist[1]) time = guiGetText(playerTab.combobox[1]) reason = guiGetText(playerTab.edit[1]) thePlayer = getPlayerFromName(player) if (time == "10 mins") then setElementData(thePlayer, "isPlayerMuted", true) setTimer(setElementData, 1000, 1, getPlayerFromName(player), false) outputChatBox("(Admin) " .. player .. " has been muted for 10 minutes by " .. getPlayerName(localPlayer) .. " for " .. reason) end guiSetVisible(playerTab.window[1], false) guiSetVisible(GUIEditor.window[1], true) end end end addEventHandler("onClientGUIClick", resourceRoot, mutePlayer)
Debug Error says: Bad argument @ 'setElementData' [Expected string at argument 2, got boolean on this line:
setTimer(setElementData, 1000, 1, getPlayerFromName(player), false)
-
12 hours ago, #BrosS said:
Very good job mate , Keep up
thank you:)
- 1
-
22 minutes ago, Abu-Solo said:
Just tried it.. I have nothing to say...
very very Nice and good JOB~!
Thank you
-
3 hours ago, Abu-Solo said:
I can't wait for this login panel,
but ... it need to be more good
Make some gui changes
Make it dx.. or change the gui a bit
Thank you. I just released it. you can check if you want.
- 1
-
-
On 12/1/2016 at 10:09 PM, Rudransh said:
Cancer?
no, fighting with my own self.
-
Login System
Some Images of GUI:
https://puu.sh/sJnRg/2928be4ec3.png
https://puu.sh/sJnTw/cb57d4b9ce.png
Features:
- Uses External MySQL Database for register/login
- Logs in user to MTA System if account exist.
- It is opensource
Installation:
- Configure your database configurations in server.lua
- Export database.sql to your selected database.
- Add this resource to your ACL's admin group and boom!
- Finished! You can start the script and connect to the server!
Download Links
- MTA Community Resource: https://community.multitheftauto.com/index.php?p=resources&s=details&id=13930
Exports:
-- To Be Updated.. exports.login:getPlayerUsername(player) -- Gets Player Username.
- 1
- 1
-
You didn't get me, Opening the GUI works perfectly fine, but when there are many people on logging screen, if one guy clicks "Login" button, The Login GUI Disappears for everyone who were on login gui
ps: it got solved automatically, lol
- 1
-
-
after clicking "login button" everything works fine, but GUI closes to all players who are in login screen instead of only the localplayer, pls help
function successfullLogin() fadeCamera(true, 1, 255, 0, 0) guiSetVisible(GUIEditor.window[1], false) showCursor(false) end addEvent("login.success", true) addEventHandler("login.success", root, successfullLogin)
-
DEBUG ERROR: bad argument @ 'attachElements' [Expected element at argument 1, got boolean]
I've no idea why.
local helicopter = { ["Police Maverick"] = true, ["Sparrow"] = true, ["Cargobob"] = true, ["Hunter"] = true, } function SwatRope() local myVehicle = getPedOccupiedVehicle(localPlayer) if myVehicle and helicopter[getVehicleName(myVehicle)] then local x,y,z = getElementPosition(myVehicle) local loc = createSWATRope(x, y, z, 10000) attachElements(loc, localPlayer, 0, 0, 5) end end addCommandHandler("rope", SwatRope)
-
@Foxlu Are you sure you installed correct version of the mysql socket? maybe your server is 64bit and you installed 32bit module, or vice versa.
-
A: meow
Q: wat does the fox say xP
-
23 hours ago, Savannah said:
Won't GuiSetText work?
It works, but it does not change, it remains stable. since last is SF Airport, Title comes of SF for all GUIs. anyways this is solved, thank you
20 hours ago, LoPollo said:You probably tested only in easten bay airport.
-
2 minutes ago, LoPollo said:
Honestly if you need to change a window title... it's very possible that there's a better way to do it (or at least respecting mta's limits)
Yep, there's no function to change the title. A workaround may be crating a temp window with the new title, move all elements of the old window to the new one, destroy the old window and assign the temp window to the old var
gotta try it' thanks
-
--[[ -- Resource Name: Information. -- Author: Om (RipeMangoes69) -- Date: 4/12/2016 -- File: client.lua ]]-- -- GUI GUIEditor = { window = {}, label = {}, memo = {} } function createInfoObjects() local markers = { {area = "Los Santos Airport", x = 1582.45, y = -2286.32, z = 12}, {area = "Las Vegas Airport", x = 1674.30859375, y = 1444.9501953125, z = 9.2} } for _, m in ipairs(markers) do local marker = createMarker(m.x, m.y, m.z, "cylinder", 1, 255, 255, 255, 100) GUIEditor.window[1] = guiCreateWindow(645, 250, 266, 378, "Information: " .. m.area, false) guiWindowSetSizable(GUIEditor.window[1], false) guiSetVisible(GUIEditor.window[1], false) GUIEditor.label[1] = guiCreateLabel(5, 353, 190, 15, "* Click anywhere on GUI Window to close it.", false, GUIEditor.window[1]) guiSetFont(GUIEditor.label[1], "default-small") GUIEditor.memo[1] = guiCreateMemo(9, 24, 247, 324, "", false, GUIEditor.window[1]) guiMemoSetReadOnly(GUIEditor.memo[1], true) end end addEventHandler("onClientResourceStart", getRootElement(), createInfoObjects) function openGUI( hitElement, matchingDimension ) if getElementType( hitElement ) == "player" then if isPedInVehicle(hitElement) then outputChatBox("You cannot access GUI from vehicle!", 255, 0, 0) guiSetVisible(GUIEditor.window[1], false) showCursor(false) else guiSetVisible(GUIEditor.window[1], true) showCursor(true) end end end addEventHandler("onClientMarkerHit", resourceRoot, openGUI) function closeGUI() guiSetVisible(GUIEditor.window[1], false) showCursor(false) end addEventHandler("onClientGUIClick", resourceRoot, closeGUI)
How am i suppose to "change" the GUI Title ? (area in the table). thanks.
-
I'm free developer right here. but too busy fighting with life
mysql select question
in Scripting
Posted
Instead or outputChatBox and JSON, You can use iprint function to print the table