
xXMADEXx
Members-
Posts
2,718 -
Joined
-
Last visited
Everything posted by xXMADEXx
-
V is returning the table that is inside of the "teams" table. For example, if you did this: for i, v in pairs ( teams ) do print ( tostring ( i ) ) end It would output: teamACL teamACL2 to the console. If you did this: for i, v in pairs ( teams ) do for i, v in pairs ( v ) do print ( v ) end end It would output: "" "" "Team 2" "[2]" to the console, if it makes scenes, sorry if i'm not clear enough.
-
Yeah, but newteam is defined, will it work? Like i wanna create a new team with the variable newteam (i set that variable each time the code is run) I'm not too sure what you mean...
-
I haven't tried this, but it should work: local teams = { teamACL = { name = "", tag = "" }, teamACL2 = { name = "Team 2", tag = "[2]" } } -- Note: Make sure that "player" and "newnick" are defined by now for i, v in pairs(teams) do if string.find(newnick, v.tag) then if isObjectInACLGroup("user." ..(getAccountName(getPlayerAccount(player)), aclGetGroup(v)) then local team = getTeamFromName(v.name) if team then setPlayerTeam(player, team) setAccountData ( getPlayerAccount ( player ), "team", v.name ) break else outputChatBox("Team wasn't found!", getRootElement()) end else kickPlayer(player, "You must be in the ACL group and logged in!") outputChatBox("Player ".. getPlayerNametagText(player).."#ffffff was kicked for trying to fake team "..v.name, getRootElement()) end end end
-
Here is just a basic example: local playerSkins = { } addEventHandler ( 'onPlayerWasted', root, function ( ) playerSkins[source] = getPedSkin ( source ) end ) addEventHandler ( "onPlayerSpawn", root, function ( ) local id = 0 if ( playerSkins [ source ] ) then id = tonumber ( playerSkins [ source ] ) end setPedSkin ( source, id ) end )
-
Here: local teams = { newteam = { ['name'] = tagname, -- Make sure "tagname" is defined ['tag'] = gettaglower, -- make sure "gettaglower" is defined } }
-
You can't create a new weapon, it has to be a model and/or texture replace.
-
You can check the weapon ID with onClientPlayerWeaponFIre
-
Do what I do and use the "encryption" option on the MTA compiler, nobody can decode it. https://luac.multitheftauto.com/ Or, if you really want it to be secure, you can use "callRemote" to a website php code.
-
We're here to help, not do it for you.
-
There's no function like this, but you can just simply create a marker (or col shape) around the pickup.
-
Weird, it worked ._. Last time I used fetchRemote, it worked with localhost lol. Thanks.
-
I said, I was using XAMPP and USBWebServer to host the web server.
-
This resource is on the MTA community. I've seen it on there, but i've forgoten where. It wouldn't be too hard to make this using: dxDrawPartialCircle.
-
Hi guys. So, I started up my server and i'm making a script that uses fetchRemote on the client side, but for some reason when I use fetchRemote, it get the error "1006." This is what I put for the host: http://127.0.0.1:8080/Nerd_Gaming/downloads/ (I also tried http://localhost) and I keep getting error 1006 (Destination IP not allowed) which is weird because it's being hosted on my computer. I tried changing the web host from XAMPP to USBWebServer and I still get the error... Any suggestions on how to fix it? (Note: If I use this on the server side: fetchRemote ( 'http://localhost:8080/test.txt', response ) it works just fine, but says error 1006 on client side)
-
You can use examples from these resources that i've made that have DX buttons: http://www.mediafire.com/download/gbkal ... -login.zip https://community.multitheftauto.com/ind ... ls&id=7970 Here's a basic example: local rectangleData = { x = 0, y = 0, width = 100, height = 20 } addEventHandler ( "onClientRender", root, function ( ) dxDrawRectangle ( rectangleData.x, rectangleData.y, rectangleData.width, rectangleData.height, tocolor ( 0, 0, 0, 120 ) ) end ) addEventHandler ( "onClientClick", root, function ( _, _, x, y ) if ( x >= rectangleData.x and x <= rectangleData.x + rectangleData.width and y >= rectangleData.y and y <= rectangleData.y + rectangleData.height ) then outputChatBox ( "On rectangle click!" ) end end )
-
https://wiki.multitheftauto.com/wiki/DxDrawCircle https://wiki.multitheftauto.com/wiki/Dx ... tialCircle
-
Well, first you just need to make a simple MySQL/SQLite connection using dbConnect. Then, in the event you just need to do something like this: local dbc = dbConnect ( "sqlite", "mydatabase.sql" ) dbExec ( dbc, "CREATE TABLE IF NOT EXISTS stats ( Player TEXT, Wins INT, Deaths INT )" ) addEventHandler ( "onPlayerJoin", root, function ( ) dbExec ( "INSERT INTO stats ( Player, Wins, Deaths ) VALUES ( ?, ?, ? )", getPlayerName ( source ), '0', '0' ) end ) addEventHandler("onPlayerQuit", getRootElement, function() local wins = getElementData(source, "wins") local deaths = getElementData(source, "deaths") dbExec ( "UPDATE stats SET Wins=?, Deaths=? WHERE Player=?", wins, deaths, getPlayerName( source ) ) end)
-
setElementData is used to store temporary data, when the player quits all of the data will be losted. With MySQL, the data will save to a remote server (or the same), so the data will be saved when the server restarts, or the player quits.
-
try putting in fadeCamera
-
Because they have questions..
-
You shouldn't use the MySQL module, it's very out dated. Here is some stuff that might help you: http://www.w3schools.com/sql/default.as ... beebb8869c http://dev.mysql.com/doc/refman/5.0/en/tutorial.html If you want, you can take a look at my "Warp Manager" script, it uses SQLite (Pretty much the same as MySQL) to save the warps, and hopefully you can learn something from it. https://community.multitheftauto.com/ind ... ls&id=7419
-
These? setCameraMatrix textCreateDisplay textCreateTextItem textDisplayAddObserver textDisplayRemoveObserver
-
There may be more errors, but the only one I found was you needed another "getLocalPlayer ( )" function touge() PanelTouge = guiCreateWindow ( 341, 204, 292, 495, "TougeRushers Carros", false ) guiSetProperty(PanelTouge, "CaptionColour", "FFD90000") guiWindowSetSizable(PanelTouge, false) showCursor (true) nissanr32 = guiCreateButton(24, 41, 63, 46, "Nissan Skyline GTR R32", false, PanelTouge) brz = guiCreateButton(24, 101, 63, 46, "Subaru BRZ", false, PanelTouge) nissanr35 = guiCreateButton(24, 161, 63, 46, "Nissan Skyline GTR R35", false, PanelTouge) memotext = guiCreateMemo(39, 432, 203, 53, "Estos son los carros oficiales del\nequipo |TougeRushers|", false, PanelTouge) guiMemoSetReadOnly(memotext, true) showCursor (true) addEventHandler ( "OnClientGUIClick", nissanr32, nissann, false ) end addCommandHandler ("tougecars", touge) function nissann () showCursor (true) triggerServerEvent ( "OnNissanEnter", getLocalPlayer ( ), getLocalPlayer ( ) ) end
-
Do you even know what an IP address is? You cannot just "add" them, they have to be assigned.
-
It's not a requirement, but doesn't mean it can't be there. This doesn't make sense. If the player is not in admin group then he's already in Everyone's group so "elseif" statement shouldn't be used here. Here: local staff = createTeam("Staff", 126, 0, 145) local Regular = createTeam("Regular", 169,169,169) addEventHandler("onPlayerLogin", root, function(_, acc) local accName = getAccountName(acc) if isObjectInACLGroup("user."..accName, aclGetGroup("Admin")) then setPlayerTeam(source, staff) else -- If you want to know that if the player is in Moderator or any other group then you can use elseif. setPlayerTeam(source, Regular) end end