-
Posts
367 -
Joined
-
Last visited
Everything posted by Ab-47
-
Server Problem; Server- function joinSWAT() local SwatTeam = getTeamFromName("SWAT") setPlayerTeam(source,SwatTeam) setElementModel(source,285) giveWeapon ( source, 31, 500, false ) giveWeapon ( source, 25, 100, false ) giveWeapon ( source, 23, 1, false ) giveWeapon ( source, 24, 100, false ) setElementData( source, "Occupation", "SWAT", true ) outputChatBox("You now have your SWAT Gear! Move Out!.",source,0,255,0) end addEvent("setSWAT", true) addEventHandler("setSWAT",getRootElement(),joinSWAT) I moved the getTeamFromName inside the function, tested it multiple times and seems to work. I think it's an easy solution.
-
Your Welcome
-
Duuuuuuude! Sorry for the bad language but what the FUCK are you on about? Impersonation in which way, when and where? I don't know who the hell you are to start of with, and no it's not a fail function if it completely works. I can say I stole the outputChatBox message idea from another server, but does not make me an imposter or a failure in making a function. As I said earlier, rough work I'm not gonna dedicate my time to prove someone wrong when it's blantanly written infront of someone's face. Good Day
-
Is your server online by host? Or are you manually opening a public server? Be sure to check if it's in 'Local' in server browser.
-
It's your console logs. If you have any bad arguments with a script, it'd get logged there. I don't think there's an error with the server, also I cant see the first link, seems to be a problem with my countries Internet security. Just fix the script errors you get, it'd show the filename.
-
You have to portforward in order to have your server up on the server browser. Or buy a host.
-
Server- function showMenu ( thePlayer ) triggerClientEvent ( "ShowAmmu", thePlayer ) end addEventHandler ( "onMarkerHit", ammuSell, showMenu ) Client- wdwMenu = guiCreateWindow( 0.150, 0.150, 0.70, 0.70, "Ammunation", true ) guiSetVisible ( wdwMenu, false ) showCursor ( false ) function ShowTheMenu ( ) guiSetVisible ( wdwMenu, true ) showCursor ( true ) end addEvent ( "ShowAmmu", true ) addEventHandler ( "ShowAmmu", getRootElement (), ShowTheMenu )
-
Ahh.. I thought if you added 'root' instead of another argument, it'd be outputed to everyone. Anyway, thanks for notifying me.
-
Or you can simply add this line in your script: accountname = getAccountName (getPlayerAccount(source)) if isObjectInACLGroup ( "user." .. accountname, aclGetGroup ( "Admin" ) ) then
-
Re-install MTA, or ignore the patch.
-
Doesn't matter, they aren't linked, the message will be outputed to everyone, works fine. Btw it was made in like 5 mins some rough work.
-
function replaceModel() txd = engineLoadTXD(".txd file name here", ID ) engineImportTXD(txd, ID) dff = engineLoadDFF(".dff file name here", ID ) engineReplaceModel(dff, ID) end addEventHandler ( "onClientResourceStart", getResourceRootElement(getThisResource()), replaceModel) Just replace the ID and have your skin mods in the same directory, create a meta and you're done, just start the script
-
I don't understand what you're doing, the best I could do is get the GUI to show and clean a few things up. Client- windowjob = guiCreateWindow ( 0.2, 0.2, 0.25, 0.5, "Police job", true ) guiSetAlpha( windowjob, 1 ) button = guiCreateButton ( 0.5, 0.8, 0.45, 0.15, "Close", true, windowjob ) button1 = guiCreateButton ( 0.01, 0.8, 0.45, 0.15, "Accept", true, windowjob ) label = guiCreateLabel ( 0.1, 0.1, 0.9, 0.1, "Double Click Vehicle to take it.", true, windowjob ) showCursor(false) guiSetVisible( windowjob, false ) guiWindowSetSizable( windowjob, false ) guiWindowSetMovable( windowjob, false ) vehicles = { {"Officer 1", 280}, {"Officer 2", 281}, {"Traffic officer", 284}, {"Swat", 285}, } grid = guiCreateGridList(0.01, 0.2, 0.99, 0.5, true, windowjob) guiGridListAddColumn(grid, "Skins", 0.85) for i,veh in ipairs(vehicles) do row = guiGridListAddRow(grid) -- guiGridListSetItemText(grid, row, 1, tostring(veh[1]), false, false) guiGridListSetItemData(grid, row, 1, tostring(veh[2])) end function get() local row, col = guiGridListGetSelectedItem(grid) if (row and col and row ~= -1 and col ~= -1) then local model = tonumber(guiGridListGetItemData(grid, row, 1)) if model ~= "" then triggerServerEvent("setSAPD", localPlayer, model) guiSetVisible(windowjob,false) showCursor(false) end end end addEventHandler("onClientGUIClick", button1, get, false) function close() if (source == button) then guiSetVisible(windowjob,false) showCursor(false) end end addEventHandler("onClientGUIClick", button, close) function SAPDgui() guiSetVisible(windowjob,true) showCursor(true) end addEventHandler("onClientMarkerHit", marker, SAPDgui) addEventHandler("onClientMarkerHit", marker1, SAPDgui) addEventHandler("onClientMarkerHit", marker2, SAPDgui) function SAPDjobleave(leaveElement) if getElementType(leaveElement) == "player" and (leaveElement == localPlayer) then if guiGetVisible(windowjob, true) then guiSetVisible(windowjob, false) showCursor(false) end end end addEventHandler("onClientMarkerLeave", marker, SAPDjobleave) addEventHandler("onClientMarkerLeave", marker1, SAPDjobleave) addEventHandler("onClientMarkerLeave", marker2, SAPDjobleave) Be aware, when you add an event, you should trigger the event in the oposing script, if you add an event client sided trigger the event server sided. With the GUI, you need markers in order to trigger the function to open your GUI, so you have to create Markers as-well. marker = createMarker ( x, y, z, 'type') marker1 = createMarker ( x, y, z, 'type') marker2 = createMarker ( x, y, z, 'type') You aren't getting anywhere with this: function get() local row, col = guiGridListGetSelectedItem(grid) if (row and col and row ~= -1 and col ~= -1) then local model = tonumber(guiGridListGetItemData(grid, row, 1)) if model ~= "" then triggerServerEvent("setSAPD", localPlayer, model) guiSetVisible(windowjob,false) showCursor(false) end end end addEventHandler("onClientGUIClick", button1, get, false) If you haven't added an event in the server side. Imo, create a new script with better understanding, or start of with something less complicated.
-
You're right, example: Ban/Kick a player with a command, already exists within the FR GUI script Give all players money; function playerReward() local allPlayers = getElementsByType("player") for index,value in ipairs(allPlayers) do givePlayerMoney ( value, amount) end end addCommandHandler ( "reward", playerReward ) Blip Scripts; Blip = createBlip .... Blip2 = createBlip.. And the distance: setBlipVisibleDistance ( blip, dis ) setBlipVisibleDistance ( blip2, dis ) Music/Sound script; Client- addEventHandler( 'onClientResourceStart', resourceRoot, function( ) local sound = playSound3D( 'http://www.181.fm/winamp.pls?station=181-power&style=mp3&description=Power%20181%20(Top%2040)&file=181-power.pls', 485.87612915039, -11.931990623474, 1000.679687 ) setSoundMaxDistance(sound, 600 ) setElementInterior ( sound, 17 ) end ) function event () outputChatBox ( "An event has been created! Use /eventwarp to be warped to the event!", root, 0, 255, 0 ) end addCommandHandler ( "command", event ) Server- function warp (player) setElementPosition ( player, 485.87612915039, -11.931990623474, 1000.679687 ) setElementInterior ( player, 17 ) end addCommandHandler ( "eventwarp", warp ) Payday Script- function payday() local allPlayers = getElementsByType("player") for index,value in ipairs(allPlayers) do givePlayerMoney ( value, 10 ) outputChatBox (" Pay-check ", value, 255, 255, 255, false) outputChatBox ("You got 10$ for your personal earnings!", value, 255, 0, 0, false) end end function onResourceStart(thisResource) setTimer ( payday, 50000, 0 ) end addEventHandler ( "onResourceStart", getResourceRootElement(getThisResource()), onResourceStart ) Ped Script- createPed setElementInterior setElementDimension
-
oh, okay. is there any MySQL tuttorial for mta sa? There may be more, found this: https://forum.multitheftauto.com/viewtop ... 48&t=42067
-
Requesting Moderators for our board
Ab-47 replied to Baseplate's topic in Maghrebi Arabic / Darija / الدارجة
I'd request Samer & Sparrow to be a moderator, well known great chaps -
Ohhh.. I'm absolutely sorry both of you for posting in the wrong place. Kindly could a moderator move this board to the correct place D: thanks Nvm thanks moderators
-
You're welcome.
-
Which board should it be in? Board says; 'Showroom', I'm clearly showing my script to the public just telling them how to construct it in whichever coods they want. Hmm, I've been here for a small while, and I'm pretty sure this is the correct place. (Correct me if I'm wrong, please) And thanks.
-
Button = guiCreateButton( 20, 200, 150, 30, "", false ) guiSetProperty ( Button, "NormalTextColour", "FFFF0000" ) Well I guess your problem is the color, try using another HEX code. Example: #00FF00 or #FFFF00 Example: guiSetProperty ( Button, "NormalTextColour", "00FF00" )
-
No not at all. Apart from disabling your scripts.
-
For the teleport to the interior you'd need: createMarker setElementPosition setElementInterior setElementDimension fadeCamera For the GUI you'd need: guiCreateWindow guiCreateButton addEventHandler And other functions to improve your script. Simply make it yourself given the functions above, click on them for more info.
-
Maybe your files are corrupted, try using the old version of MTA and see if you experience the same problem.
-
Make sure collisions are true if you place your own object. If you experience a bug in some players going through objects, I suggest a simple reconnect or restart your MTA, if the problem persists, seek attention.