Jump to content

Jaysds1

Members
  • Posts

    4,961
  • Joined

  • Last visited

Everything posted by Jaysds1

  1. There's an example on the wiki page. https://wiki.multitheftauto.com/wiki/Gui ... esolutions
  2. Can you download and run this MTADiag then post the generated PasteBin URL here.
  3. Sorry, but we can't make any login systems for you, unless you pay us, but for now you would need to search the community site. https://community.multitheftauto.com/
  4. try this, Server: local allowedTeams = { ["Staff"]=true, ["Armed Forces"]=true, ["SWAT Team"]=true, ["Government"]=true, ["Civilian Workers"]=true, ["Medic"]=true, ["Police"]=true, ["Criminal"]=true; } emp = createTeam("Unemployed team", 127, 127, 127) occ = createTeam("Unoccupied team", 173, 255, 0) function jobShift() local team = getPlayerTeam(client) local pSkin = getElementModel(client) if team then --just check if the player is on a team if allowedTeams[getTeamName(team)] then --if there team name is in the table, it returns true setPlayerTeam(client, emp) setElementModel(client, 0) triggerClientEvent(client,"hide",client) --trigger this for the one client, not all the clients elseif team == emp then --emp is a team not the name of the team setElementModel(client, pSkin) triggerClientEvent(client,"hide",client) end end end addEvent("jobShift", true) addEventHandler("jobShift", getRootElement(), jobShift) Client: JobGUI = guiCreateWindow(249,240,307,176,"Job GUI",false) guiWindowSetSizable(JobGUI,false) guiWindowSetMovable(JobGUI,false) guiSetAlpha(JobGUI,0.89999997615814) guiSetVisible(JobGUI, false) EndStartJ = guiCreateButton(26,37,254,58,"End/start shift",false,JobGUI) QuitJ = guiCreateButton(26,98,254,58,"Quit job",false,JobGUI) function ShowGUI ( ) local guiVisible = guiGetVisible ( JobGUI ) guiSetVisible ( JobGUI, not guiVisible) showCursor ( guiVisible ) end bindKey("F2","down", ShowGUI) function shift() triggerServerEvent("jobShift", localPlayer) end addEventHandler("onClientGUIClick", EndStartJ, shift) function hideGUI() guiSetVisible(JobGUI, false) showCursor(false) end addEvent("hide", true) addEventHandler("hide",root, hideGUI)
  5. well, you would need to implant it into your code/script. anyways, use this to store the player's serial: setAccountData then if it's a returning player, use this to get the account serial: getAccountData and this is for getting the player's serial: getPlayerSerial and please note that this has to be done server-sided.
  6. Jaysds1

    A way?

    They should work, which one did you try?
  7. well, there's nothing wrong in the script, When does this error come up?
  8. Jaysds1

    A way?

    ya, try this: function power(source,action,player) player = getPlayerFromName(player) if not player then outputChatBox("sorry, but we need the player full name!",source) return end if not isPedInVehicle(player) then outputChatBox("Sorry, but the player isn't in a vehicle!",source) return end local vehicle = getPedOccupiedVehicle ( player ) if ( action == "fix" ) then fixVehicle ( vehicle ) elseif ( action == "blow" ) then blowVehicle ( vehicle ) end end addCommandHandler("blow",power) addCommandHandler("fix",power) oh, server-side BTW, unless you want it client-side try this: function power(action,player) player = getPlayerFromName(player) if not player then outputChatBox("sorry, but we need the player full name!") return end if not isPedInVehicle(player) then outputChatBox("Sorry, but the player isn't in a vehicle!") return end local vehicle = getPedOccupiedVehicle ( player ) if ( action == "fix" ) then fixVehicle ( vehicle ) elseif ( action == "blow" ) then blowVehicle ( vehicle ) end end addCommandHandler("blow",power) addCommandHandler("fix",power)
  9. Ask him: memberlist.php?mode=viewprofile&u=16970
  10. Hey, If you logged the console out, you wont get in again unless you sign in to your own account... example: logout (logs me out of console account) login Jaysds1 mtaisthebest (logs me in to my account) Basically the Console has a self account. Read more here: Console
  11. Jaysds1

    Carball

    Nice, Never seen anyone with this nice idea ever!!! You have a creative mind! nice again
  12. Here: http://files.mtasa.com/apps/files/MTADiag.zip Did you restart your computer? if you didn't then I suggest doing so
  13. A: Oreo Cookies Q: How would you like MTA Forum color to be? Black and White?
  14. try this: function mfavCommand(source, command) local currentMap = getResourceInfo(exports['mapmanager']:getRunningGamemodeMap(), "name") --returns a string local serial = getPlayerSerial(source) local favs = executeSQLQuery("SELECT favmaps FROM userpanelDatas WHERE serial=?", serial) local favmap = favs[1].favmaps if favmap then local found = false for _,v in ipairs(favmap)do -- I think it's a table if string.find(currentMap..",",v,1,true) or string.find("v"..currentMap,v,1,true) then found = true outputChatBox("found") if string.find(","..currentMap,v,2,true) then executeSQLQuery("UPDATE userpanelDatas SET favmaps='"..string.gsub(v,","..currentMap, "").."' WHERE serial=?", serial) break; elseif string.find(currentMap..",",v,1) then executeSQLQuery("UPDATE userpanelDatas SET favmaps='"..string.gsub(v,currentMap..",", "").."' WHERE serial=?", serial) break; end outputChatBox("#0000ffThis map has been remove from your favourite maps#ff0000! #0000ffUse #ffffff/mfav#0000ff for mark it as favourite!", source, 255, 255, 255, true) end end if not found then outputChatBox("not found") executeSQLQuery("UPDATE userpanelDatas SET favmaps='"..favmap.." , "..currentMap.."' WHERE serial=?", serial) outputChatBox("#0000ffThis map has been added to your favourite maps#ff0000! #0000ffUse #ffffff/mfav#0000ff again for remove as favourite!", source, 255, 255, 255, true) end end end end addCommandHandler("mfav", mfavCommand)
  15. Jaysds1

    ipairs

    same errors? EDIT: Edited the script again
  16. well, I would ask for proof, but it'll be a waste of my/our time.
  17. Jaysds1

    ipairs

    please note that Lua is case sensitive, try this: local marker = createMarker( 1552.4996337891, -1677.3264160156, 15.1953125, "Cylinder", 1.5, 0, 0, 255, 150) local marker1 = createMarker( 2241.8999023438, 2435.8999023438, 9.8000001907349, "Cylinder", 1.5, 0, 0, 255, 150) local marker2 = createMarker( -2129, -2481.3999023438, 29.60000038147, "Cylinder", 1.5, 0, 0, 255, 150) local marker3 = createMarker( -1616.9000244141, 681, 6.0999999046326, "Cylinder", 1.5, 0, 0, 255, 150) local marker4 = createMarker( -216.5, 978, 18.5, "Cylinder", 1.5, 0, 0, 255, 150) local skins = {"police 1", "police 2", "police 3", "police 4", "police 5", "police 6"} function createskinGui() windowjob = guiCreateWindow(0.335,0.14,0.3963,0.6817,"Police job",true) infomemo = guiCreateMemo(0.0347,0.0611,0.9369,0.3667,"Job information",true,windowjob) skinsgrid = guiCreateGridList(0.0347,0.4841,0.9369,0.313,true,windowjob) guiGridListSetSelectionMode(skinsgrid,2) _skins = guiGridListAddColumn(skinsgrid,"Skins",0.35) -- takebtn = guiCreateButton(0.2492,0.8289,0.5047,0.0562,"Take Job",true,windowjob) Closebtn = guiCreateButton(0.2492,0.9095,0.5047,0.0562,"Close",true,windowjob) infolbl = guiCreateLabel(0.2681,0.4279,0.4637,0.0538,"Choose your skin :",true,windowjob) guiLabelSetColor(infolbl,0,0,255) guiLabelSetVerticalAlign(infolbl,"center") guiLabelSetHorizontalAlign(infolbl,"center",false) guiSetFont(infolbl,"default-bold-small") for index, skin in ipairs(skins) do local row = guiGridListAddRow (skinsgrid) guiGridListSetItemText ( skinsgrid, row, _skins, tostring(skin), false, false ) end showCursor(true) end addEventHandler("onClientGUIClick", root, function () if (source == takebtn) then local row,col = guiGridListGetSelectedItem(skinsgrid) if (row and col and row ~= -1 and col ~= -1) then local skinName = guiGridListGetItemText(skinsgrid, row, 1) if skinName == "police 1" then setElementModel(getLocalPlayer(), 280) elseif skinName == "police 2" then setElementModel(getLocalPlayer(),281) elseif skinName == "police 3" then setElementModel(getLocalPlayer(), 282) elseif skinName == "police 4" then setElementModel(getLocalPlayer(), 283) elseif skinName == "police 5" then setElementModel(getLocalPlayer(),284) elseif skinName == "police 6" then setElementModel(getLocalPlayer(), 288) end triggerEvent("closeWindow", localPlayer ) else outputChatBox("Please,select a skin of the list.",255,0,0) end elseif (source == closebtn) then triggerEvent("closeWindow", localPlayer ) end end ) function SAPDjob( hitElement ) if ( hitElement == localPlayer ) then createskinGui ( hitElement ) if ( windowjob ~= nil ) then guiSetVisible ( windowjob, true ) showCursor ( true ) guiSetInputEnabled ( true ) end end end addEventHandler("onClientMarkerHit", marker, SAPDjob) addEventHandler("onClientMarkerHit", marker1, SAPDjob) addEventHandler("onClientMarkerHit", marker2, SAPDjob) addEventHandler("onClientMarkerHit", marker3, SAPDjob) addEventHandler("onClientMarkerHit", marker4, SAPDjob) function SAPDjobleave(leaveElement) if getElementType(leaveElement) == "player" and (leaveElement == localPlayer) then if guiGetVisible(windowjob) then guiSetVisible(windowjob, false) showCursor(false) end end end addEventHandler("onClientMarkerLeave", marker, SAPDjobleave) addEventHandler("onClientMarkerLeave", marker1, SAPDjobleave) addEventHandler("onClientMarkerLeave", marker2, SAPDjobleave) addEventHandler("onClientMarkerLeave", marker3, SAPDjobleave) addEventHandler("onClientMarkerLeave", marker4, SAPDjobleave) function joinTeam() triggerServerEvent("setSAPD",localPlayer) guiSetVisible(windowjob, false) showCursor(false) end addEventHandler("onClientGUIClick", takebtn , joinTeam, false) function removeSAPDWindow() guiSetVisible(windowjob, false) showCursor(false) end addEventHandler("onClientGUIClick", closebtn , removeSAPDWindow, false) EDITED!!!
  18. well, it's known as a image, I got i here: http://www.userbarmaker.net/
  19. Jaysds1

    Reversing

    try reading this topic: viewtopic.php?f=5&t=41658
  20. lol, it's ok SugarD-x , I know how you feel, but really, my family says make some money for what I'm doing or dont go on the computer so, that's why I've been looking for some jobs, anyways, I know how you feel.
  21. Jaysds1

    MTA Android App.

    Is there a GTASA Game for Android/IOS? if there is then it should be possible to make one.
  22. A: I think we should get a prisoner to rape him Q: Does anyone know a male prisoner?
  23. I currently don't have one
  24. Sorry, but that's not enough info
×
×
  • Create New...