Jump to content

xXMADEXx

Members
  • Posts

    2,718
  • Joined

  • Last visited

Everything posted by xXMADEXx

  1. Hey, i have a spawner script, and when the person spawns a car, i would like it to spawn in green. How would i do that: -- original server ship = createMarker( 2102.4775390625, -2956.5537109375, 16.2890625, "cylinder", 2, 0, 255, 0, 200 ) local vehicles = {} function spawnVeh4(id) local x, y, z = getElementPosition(source) local rx, ry, rz = getElementRotation(source) if isElement(vehicles[source]) then destroyElement(vehicles[source]) end vehicles[source] = createVehicle(id, 2112.7265625,-2939.427734375,18,0,0,90) end addEvent("CreVehice3",true) addEventHandler("CreVehice3", root, spawnVeh4) addEventHandler("onPlayerQuit", root, function () if isElement(vehicles[source]) then destroyElement(vehicles[source]) vehicles[source] = nil end end) function showGUI3(hitPlayer) local name = getTeamName(getPlayerTeam(hitPlayer)) if (not isPedInVehicle(hitPlayer)) then if ( name == "Military" ) or ( name == "Staff" ) then triggerClientEvent (hitPlayer,"showGUI3",getRootElement(),hitPlayer) end end end addEventHandler("onMarkerHit",ship,showGUI3) -- modified script server -- ship = createMarker( 2102.4775390625, -2956.5537109375, 16.2890625, "cylinder", 2, 0, 255, 0, 200 ) local vehicles = {} function spawnVeh4(id) local x, y, z = getElementPosition(source) local rx, ry, rz = getElementRotation(source) if isElement(vehicles[source]) then destroyElement(vehicles[source]) end vehicles[source] = createVehicle(id, 2112.7265625,-2939.427734375,18,0,0,90) vehicles[source] = setVehicleColor( id, x, y, z, rx, ry, rz, 0, 255, 0 ) end addEvent("CreVehice3",true) addEventHandler("CreVehice3", root, spawnVeh4) addEventHandler("onPlayerQuit", root, function () if isElement(vehicles[source]) then destroyElement(vehicles[source]) vehicles[source] = nil end end) function showGUI3(hitPlayer) local name = getTeamName(getPlayerTeam(hitPlayer)) if (not isPedInVehicle(hitPlayer)) then if ( name == "Military" ) or ( name == "Staff" ) then triggerClientEvent (hitPlayer,"showGUI3",getRootElement(),hitPlayer) end end end addEventHandler("onMarkerHit",ship,showGUI3)
  2. xXMADEXx

    Lua help

    Trust me, the fastest way to learn how to LUA script is to just read https://wiki.multitheftauto.com/ - its also the most simplest
  3. Hey guys, im trying to make my command linked to the staff team, but it will not work. Please help. -- server -- Spawns a Leviathan and makes it a magnet helicopter function magnet_func ( player ) local team = getElementTeam ( player) if ( team == "staff" ) then local x, y, z = getElementPosition ( player ) local veh = createVehicle ( 520, x + 5, y, z ) setVehicleAsMagnetHelicopter ( veh ) end end addCommandHandler ( "magnet", magnet_func ) -- Attaches a magnet to it if its a Leviathan function setVehicleAsMagnetHelicopter ( veh, player ) if getElementModel ( veh ) == 520 then local team = getElementTeam ( player) if ( team == "staff" ) then local x, y, z = getElementPosition ( veh ) local magnet = createObject ( 1301, x, y, z-1.5) --1301 attachElements ( magnet, veh, 0, 0, -1.8 ) setElementData ( veh, "magpos", -1.5 ) setElementData ( veh, "magnet", magnet ) setElementData ( veh, "magnetic", true ) setElementData ( veh, "hasmagnetactivated", false ) end end end -- When the helicopter is destroyed, kill the magnet function destroyMagnet ( veh ) if veh then source = veh end if getElementData ( source, "magnetic" ) then local magnet = getElementData ( veh, "magnet" ) destroyElement ( magnet ) end end addEventHandler ( "onVehicleExplode", getRootElement(), destroyMagnet ) -- Moves the magnet up/down function magnetUp ( player ) local veh = getPedOccupiedVehicle ( player ) if veh then local magpos = getElementData ( veh, "magpos" ) if magpos < -1.5 then local magnet = getElementData ( veh, "magnet" ) detachElements ( magnet ) local magpos = magpos+0.1 attachElements ( magnet, veh, 0, 0, magpos, 0, 0, 0 ) setElementData ( veh, "magpos", magpos ) end end end function magnetDown ( player ) local veh = getPedOccupiedVehicle ( player ) if veh then local magpos = getElementData ( veh, "magpos" ) if magpos > -15 then local magnet = getElementData ( veh, "magnet" ) detachElements ( magnet ) local magpos = magpos-0.1 attachElements ( magnet, veh, 0, 0, magpos, 0, 0, 0 ) setElementData ( veh, "magpos", magpos ) end end end -- (un)Bind the keys function bindTrigger () if not isKeyBound ( source, "lctrl", "down", magnetVehicleCheck ) then bindKey ( source, "lctrl", "down", magnetVehicleCheck ) bindKey ( source, "rctrl", "down", magnetVehicleCheck ) bindKey ( source, "pgdn", "down", magnetUp ) bindKey ( source, "pgup", "down", magnetDown ) end end function unbindTrigger () if isKeyBound ( source, "lctrl", "down", magnetVehicleCheck ) then unbindKey ( source, "lctrl", "down", magnetVehicleCheck ) unbindKey ( source, "rctrl", "down", magnetVehicleCheck ) unbindKey ( source, "pgup", "down", magnetUp ) unbindKey ( source, "pgdn", "down", magnetDown ) end end addEventHandler ( "onPlayerVehicleEnter", getRootElement(), bindTrigger ) addEventHandler ( "onPlayerVehicleExit", getRootElement(), unbindTrigger ) addEventHandler ( "onPlayerWasted", getRootElement(), unbindTrigger ) -- When Ctrl is pressed, attach / detatch the helicopter function magnetVehicleCheck ( player ) local veh = getPedOccupiedVehicle ( player ) if veh then if getElementData ( veh, "magnetic" ) then if getElementData ( veh, "hasmagnetactivated" ) then setElementData ( veh, "hasmagnetactivated", false ) detachElements ( getElementData ( veh, "magneticVeh" ) ) else local magnet = getElementData ( veh, "magnet" ) local x, y, z = getElementPosition ( magnet ) local magpos = getElementData ( veh, "magpos" ) local marker = createColSphere ( x , y , z, 2 ) local vehs = getElementsWithinColShape ( marker, "vehicle" ) destroyElement ( marker ) grabveh = false for key, vehitem in ipairs(vehs) do if vehitem ~= veh then local grabveh = vehitem attachElements ( grabveh, magnet, 0, 0, -1, 0, 0, getVehicleRotation(grabveh) ) setElementData ( veh, "hasmagnetactivated", true ) setElementData ( veh, "magneticVeh", grabveh ) break end end end end end end
  4. Hey guys, i am trying to make a command so if someone type /accountinfo that it will outputChatBox there username and password, i got this script below --server function accountinfo ( username, password ) local account = getAccount ( username, password ) if (account == false) then outputChatBox("#00FF00Login-System: Your Username is: #FFFF00" .. username .. "#00FF00, And your Password is: #FFFF00" .. password .. "#00FF00!",255,255,255,true ) elseif (account == true) then outputChatBox("#00FF00Login-System: Your Username is: #FFFF00" .. username .. "#00FF00, And your Password is: #FFFF00" .. password .. "#00FF00!",255,255,255,true ) end end addCommandHandler("accountinfo", accountinfo )
  5. Hey guys, i have this code, it removed the object. but not the LOD, what would be the code to remove the LOD (the LOD is 0) test = removeWorldModel ( 3625, 20000, 2633.75, -2227, 15 )
  6. Hey guys, im getting an issue when i map... If i map, when i restart my server... Nothing that has to do with my map will spawn, such as my peds, blips, markers, and gates. If you know the problem, pleaseeeeeee tell me. The only way to get them back is to re-install MTA. Thanks in advance.
  7. xXMADEXx

    [HELP]GUi

    Thank you, i had no idea about that command
  8. xXMADEXx

    [HELP]GUi

    Hey guys, i have this GUI, i added binds so it shouldent show when i start the resource, only when the resource is on and i press 'F4'. But instead, when i start the resource, the GUI will show up ( GUIEditor_Window[1] = guiCreateWindow(234,208,1199,642,"US-RP Donation Panel",false) but nothing else will. Not even the stuff that is on the GUI and the binds will not work. Basicly when i start the GUI, the menu will show and i cant get it off my screen. Please help. -- the GUI GUIEditor_Window[1] = guiCreateWindow(234,208,1199,642,"US-RP Donation Panel",false) guiSetVisible(GUIEditor_Window[1], false) guiWindowSetMovable(GUIEditor_Window[1],false) guiWindowSetSizable(GUIEditor_Window[1],false) GUIEditor_Button[1] = guiCreateButton(9,568,318,65,"Buy Points",false,GUIEditor_Window[1]) GUIEditor_Button[2] = guiCreateButton(876,568,314,65,"Exit",false,GUIEditor_Window[1]) GUIEditor_Memo[1] = guiCreateMemo(333,571,542,62,"\n More Information On Forums ([url=http://us-rp.site90.net]http://us-rp.site90.net[/url])",false,GUIEditor_Window[1]) GUIEditor_TabPanel[1] = guiCreateTabPanel(9,22,1181,546,false,GUIEditor_Window[1]) GUIEditor_Tab[1] = guiCreateTab("Bronze",GUIEditor_TabPanel[1]) GUIEditor_Grid[1] = guiCreateGridList(1171,14,5,5,false,GUIEditor_Tab[1]) guiGridListSetSelectionMode(GUIEditor_Grid[1],2) GUIEditor_Grid[2] = guiCreateGridList(910,7,271,514,false,GUIEditor_Tab[1]) guiGridListSetSelectionMode(GUIEditor_Grid[2],2) guiGridListAddColumn(GUIEditor_Grid[2],"What You Will Unlock:",0.2) for i = 1, 1 do guiGridListAddRow(GUIEditor_Grid[2]) end guiGridListSetItemText(GUIEditor_Grid[2],0,1,"") GUIEditor_Grid[3] = guiCreateGridList(910,7,271,514,false,GUIEditor_Tab[1]) guiGridListSetSelectionMode(GUIEditor_Grid[3],2) GUIEditor_Tab[2] = guiCreateTab("Silver",GUIEditor_TabPanel[1]) GUIEditor_Tab[3] = guiCreateTab("Gold",GUIEditor_TabPanel[1]) GUIEditor_Tab[4] = guiCreateTab("Diamond",GUIEditor_TabPanel[1]) GUIEditor_Window[2] = guiCreateWindow(234,208,1199,642,"US-RP Donation Panel",false) guiSetVisible(GUIEditor_Window[2], false) guiWindowSetMovable(GUIEditor_Window[2],false) guiWindowSetSizable(GUIEditor_Window[2],false) GUIEditor_Button[3] = guiCreateButton(9,568,318,65,"Buy Points",false,GUIEditor_Window[2]) exitbtn = guiCreateButton(876,568,314,65,"Exit",false,GUIEditor_Window[2]) GUIEditor_Memo[2] = guiCreateMemo(333,571,542,62,"\n More Information On Are Forums! ([url=http://us-rp.site90.net]http://us-rp.site90.net[/url])",false,GUIEditor_Window[2]) local screenX, screenY = guiGetScreenSize() local width, height = 200, 200 local x = (screenX/2) - (width/2) local y = (screenY/2) - (height/2) local lp = getLocalPlayer() GUIEditor_Window[3] = guiCreateWindow(234,208,1199,642,"US-RP Donation Panel",false) guiWindowSetMovable(GUIEditor_Window[3],false) guiWindowSetSizable(GUIEditor_Window[3],false) GUIEditor_Button[5] = guiCreateButton(9,568,318,65,"Buy Points",false,GUIEditor_Window[3]) GUIEditor_Button[6] = guiCreateButton(876,568,314,65,"Exit",false,GUIEditor_Window[3]) GUIEditor_Memo[3] = guiCreateMemo(333,571,542,62,"\n More Information On Forums ([url=http://us-rp.site90.net]http://us-rp.site90.net[/url])",false,GUIEditor_Window[3]) GUIEditor_TabPanel[2] = guiCreateTabPanel(9,22,1181,546,false,GUIEditor_Window[3]) GUIEditor_Tab[5] = guiCreateTab("Bronze",GUIEditor_TabPanel[2]) GUIEditor_Grid[4] = guiCreateGridList(1171,14,5,5,false,GUIEditor_Tab[5]) guiGridListSetSelectionMode(GUIEditor_Grid[4],2) GUIEditor_Label[1] = guiCreateLabel(2,2,1178,518,"\n\nBronze is the lowest level of donation. You will unlock a Laser, and the Donation base.\n\nYou can read more about donation levels on are forums. If you really like US-RP, you will donate.",false,GUIEditor_Tab[5]) guiLabelSetHorizontalAlign(GUIEditor_Label[1],"center",false) GUIEditor_Tab[6] = guiCreateTab("Silver",GUIEditor_TabPanel[2]) GUIEditor_Label[2] = guiCreateLabel(0,0,1180,518,"\n\nSilver is a decent donation level. Its pretty cheap, and the rewards are worth it.\n\nYou will unlock a Laser, Donation base, and a vehicle spawner.\n\nThe vehicle spawner will have a Huntley, and a Landstalker! You will also unlock the donation\n\ncommand that is kind of like the military command.\n\nIt will give you a skin and put you on the Donation team.",false,GUIEditor_Tab[6]) guiLabelSetHorizontalAlign(GUIEditor_Label[2],"center",false) GUIEditor_Tab[7] = guiCreateTab("Gold",GUIEditor_TabPanel[2]) GUIEditor_Label[3] = guiCreateLabel(0,0,1181,521,"\n\nIn the Gold donation section, you will unlock everything from the Silver donation level,\n\nbut the spawner will also have an Infernus, and Kart.\n\nYou will also unlock 'Instant Staff.' Instant staff is where a\n\nstaff member of US-RP will report to you and help you with your problems. And, you will even get a weapon spawner.\n\n The weapon spawner will be equiped with an M4, Combat Shotgun, and Deagle.",false,GUIEditor_Tab[7]) guiLabelSetHorizontalAlign(GUIEditor_Label[3],"center",false) GUIEditor_Tab[8] = guiCreateTab("Diamond",GUIEditor_TabPanel[2]) GUIEditor_Label[4] = guiCreateLabel(0,2,1181,517,"\n\nIn the Diamond donation, you will unlock everything. You will unlock everything from Bronze, Silver, and Gold donation groups.\n\nYou will also get some stuff added. You will get Instant Staff Level 2.\n\nInstant Staff Level 2 is where staff will come to you, give you a car (the car must be in yoru vehicle spawner)\n\nand will also help you out with the server. You will also get Vehicle Spawner level 2, Weapon Spawner Level 2, and even a plane spawner.\n\nIn Car Spawner Level 2, you will get all the cars from Gold Donation, and a Super GT, and bullet. In Weapon Spawner Level 2, you will get all weapons from Gold Donation + Chainsaw, and a Rifle,\n\nDiamond donations help out US-RP big time!",false,GUIEditor_Tab[8]) guiLabelSetHorizontalAlign(GUIEditor_Label[4],"center",false) --functions function resourceStart () bindKey ("F4", "down", menuShow) end addEventHandler ("onClientResourceStart", getResourceRootElement ( getThisResource () ), resourceStart) function menuShow () visableornot = guiGetVisible (gUIEditor_Window[1]) if (visableornot == true) then guiSetVisible (GUIEditor_Window[1], false) showCursor (false) end if (visableornot == false) then guiSetVisible (GUIEditor_Window[1], true) showCursor (true) end end function resourceStart () bindKey ("F4", "down", menuShow2) end addEventHandler ("onClientResourceStart", getResourceRootElement ( getThisResource () ), resourceStart) function menuShow2 () visableornot = guiGetVisible (gUIEditor_Window[2]) if (visableornot == true) then guiSetVisible (GUIEditor_Window[2], false) showCursor (false) end if (visableornot == false) then guiSetVisible (GUIEditor_Window[2], true) showCursor (true) end end
  9. Just a timer so oh say every 10 mins it will do that function....
  10. Hey guys, i have this server side script, i would like to add a timer to it but iv never created a timer. So how could i add a timer to the following script (server side): function (player,cmd,...) local text = table.concat({...}, " ") local nick=getPlayerName(player) if isObjectInACLGroup ( "user." .. getAccountName ( getPlayerAccount ( player ) ), aclGetGroup ( "lvl 5" ) ) then triggerClientEvent(getRootElement(),"doOutput",getRootElement(),255,255,255,"United States Roleplay") end end )
  11. Didnt work, nothing will show when i use that code. Its like the resource never started...
  12. Hey guys, i have this Housing system that i downloaded, and i want to change the entrance marker from a corona to the spining green and blue house icons. i tried doing it.... didnt work. If you could do it that would be awsome! (examples of what i mean) Icon: http://img255.imageshack.us/img255/4690 ... 030727.png gResRoot = getResourceRootElement(getThisResource()) function loadAllHouses () local root = xmlLoadFile ("homes.xml") local houseroot = xmlFindChild (root,"houses",0) if (houseroot) then allHouses = {} for i,v in ipairs (xmlNodeGetChildren(houseroot)) do local x = xmlNodeGetAttribute (v,"x") local y = xmlNodeGetAttribute (v,"y") local z = xmlNodeGetAttribute (v,"z") local number = xmlNodeGetAttribute (v,"num") if not (xmlNodeGetAttribute (v,"owner") == "") then local marker = createMarker (tonumber(x),tonumber(y),tonumber(z),"corona",1,255,0,0,getRootElement()) -- When bought setElementData (marker,"housenumber",tonumber(number)) else local marker = createMarker (tonumber(x),tonumber(y),tonumber(z),"corona",1,0,255,0,getRootElement()) --When not bought setElementData (marker,"housenumber",tonumber(number)) end outputDebugString ("House " .. tostring(number) .. " loaded!") end end end addEventHandler("onResourceStart",gResRoot, loadAllHouses) addEventHandler ("onMarkerHit",getRootElement(), function(hitElement, dimension) if (getElementType (hitElement) == "player") and not (isPedInVehicle (hitElement)) then if (getElementData (source,"housenumber")) then local housenumber = getElementData (source,"housenumber") --outputChatBox (tostring(housenumber),hitElement,255,0,0,false) local root = xmlLoadFile ("homes.xml") local houseHeadRootNode = xmlFindChild (root,"houses",0) local houseRootNode = xmlFindChild (houseHeadRootNode,"house",tonumber(housenumber)) if (tostring(xmlNodeGetAttribute (houseRootNode,"owner")) == "") then triggerClientEvent (hitElement,"viewHouseGUIwindow",hitElement,"Nobody!",tostring(xmlNodeGetAttribute (houseRootNode,"cost")),housenumber) xmlUnloadFile (root) else triggerClientEvent (hitElement,"viewHouseGUIwindow",hitElement,tostring(xmlNodeGetAttribute (houseRootNode,"owner")),tostring(xmlNodeGetAttribute (houseRootNode,"cost")),housenumber) xmlUnloadFile (root) end end end end) addEvent("HouseSystemEnterHouse",true) addEvent("HouseSystemBuyHouse",true) addEvent("HouseSystemSellHouse",true) addEventHandler ("HouseSystemBuyHouse", getRootElement(), function(housenumber) local root = xmlLoadFile ("homes.xml") local houseHeadRootNode = xmlFindChild (root,"houses",0) local houseRootNode = xmlFindChild (houseHeadRootNode,"house",tonumber(housenumber)) local price = xmlNodeGetAttribute (houseRootNode,"cost") local owner = xmlNodeGetAttribute (houseRootNode,"owner") if not (isGuestAccount (getPlayerAccount(source))) then if (owner == "") and (getPlayerMoney (source) >= tonumber(price)) then takePlayerMoney (source,tonumber(price)) xmlNodeSetAttribute (houseRootNode,"owner",getAccountName(getPlayerAccount(source))) outputChatBox ("Congratulations, you are the new owner!",source,255,0,0,false) outputChatBox ("Price: ".. tostring(price) .. "$!",source,255,0,0,false) setMarkerColor (getMarkerByHousenumber(housenumber),255,0,0,255) xmlSaveFile (root) elseif not (owner == "") then outputChatBox ("Sorry, This house is already bought!",source,255,0,0,false) elseif (getPlayerMoney (source) < tonumber(price)) then outputChatBox ("Sorry, you are too poor!",source,255,0,0,false) end else outputChatBox ("Please log in!",source,255,0,0,false) end triggerClientEvent (source,"hideHouseGuiWindow",source) xmlUnloadFile (root) end) addEventHandler ("HouseSystemSellHouse", getRootElement(), function(housenumber) local root = xmlLoadFile ("homes.xml") local houseHeadRootNode = xmlFindChild (root,"houses",0) local houseRootNode = xmlFindChild (houseHeadRootNode,"house",tonumber(housenumber)) local price = xmlNodeGetAttribute (houseRootNode,"cost") local owner = xmlNodeGetAttribute (houseRootNode,"owner") if not (isGuestAccount (getPlayerAccount(source))) then if (owner == getAccountName(getPlayerAccount(source))) then givePlayerMoney (source,tonumber(price)/2) xmlNodeSetAttribute (houseRootNode,"owner","") outputChatBox ("Congratulations, you have sold the home!",source,255,0,0,false) outputChatBox ("Obtain: ".. tostring(price)/2 .. "$!",source,255,0,0,false) setMarkerColor (getMarkerByHousenumber(housenumber),0,255,0,255) xmlSaveFile (root) elseif not (owner == getAccountName(getPlayerAccount(source))) then outputChatBox ("This isn't your house!",source,255,0,0,false) end else outputChatBox ("Please log in!",source,255,0,0,false) end triggerClientEvent (source,"hideHouseGuiWindow",source) xmlUnloadFile (root) end) addEventHandler ("HouseSystemEnterHouse",getRootElement(), function(housenumber) local root = xmlLoadFile ("homes.xml") local houseHeadRootNode = xmlFindChild (root,"houses",0) local houseRootNode = xmlFindChild (houseHeadRootNode,"house",tonumber(housenumber)) local x,y,z = getElementPosition (source) if (xmlNodeGetAttribute (houseRootNode,"owner") == "") then setElementData (source,"posx",x) setElementData (source,"posy",y) setElementData (source,"posz",z) local interiornumber = xmlNodeGetAttribute (houseRootNode,"interior") local interiorRootNode = xmlFindChild (xmlFindChild (root,"interiors",0),"interior",tonumber(interiornumber)) setElementInterior (source,tonumber(xmlNodeGetAttribute (interiorRootNode,"id")),tonumber(xmlNodeGetAttribute (interiorRootNode,"x")),tonumber(xmlNodeGetAttribute (interiorRootNode,"y")),tonumber(xmlNodeGetAttribute (interiorRootNode,"z"))) setElementDimension (source,xmlNodeGetAttribute(houseRootNode,"dim")) outputChatBox ("Welcome! This house isn't bought yet!",source,0,255,0,false) outputChatBox ("To Exit This House, Type /exithouse",source,255,255,0,false) triggerClientEvent (source,"hideHouseGuiWindow",source) elseif (getAccountName(getPlayerAccount(source)) == xmlNodeGetAttribute (houseRootNode,"owner")) then setElementData (source,"posx",x) setElementData (source,"posy",y) setElementData (source,"posz",z) local interiornumber = xmlNodeGetAttribute (houseRootNode,"interior") local interiorRootNode = xmlFindChild (xmlFindChild (root,"interiors",0),"interior",tonumber(interiornumber)) setElementInterior (source,tonumber(xmlNodeGetAttribute (interiorRootNode,"id")),tonumber(xmlNodeGetAttribute (interiorRootNode,"x")),tonumber(xmlNodeGetAttribute (interiorRootNode,"y")),tonumber(xmlNodeGetAttribute (interiorRootNode,"z"))) setElementDimension (source,xmlNodeGetAttribute(houseRootNode,"dim")) outputChatBox ("Welcome!",source,0,255,0,false) outputChatBox ("To Exit Your House, Type /exithouse",source,255,255,0,false) triggerClientEvent (source,"hideHouseGuiWindow",source) elseif not (getAccountName(getPlayerAccount(source)) == xmlNodeGetAttribute (houseRootNode,"owner")) then outputChatBox ("You aren't the owner of this home!",source,255,0,0,false) outputChatBox ("If you are, make sure you are logged in!",source,255,0,0,false) end xmlUnloadFile (root) end) addCommandHandler ("exithouse", function(thePlayer,command) if (getElementInterior (thePlayer) ~= 0) and (getElementData (thePlayer,"posx")) and (getElementData (thePlayer,"posy")) and (getElementData (thePlayer,"posz")) then setElementPosition (thePlayer,getElementData (thePlayer,"posx"),getElementData (thePlayer,"posy"),getElementData (thePlayer,"posz")) setElementInterior (thePlayer,0) setElementDimension (thePlayer,0) removeElementData (thePlayer,"posx") removeElementData (thePlayer,"posy") removeElementData (thePlayer,"posz") end end) addCommandHandler ("createhouse", function(thePlayer,command,interiorid,dimension,price) if (interiorid) and (dimension) and (price) and (not isPedInVehicle(thePlayer)) then if (hasObjectPermissionTo (thePlayer,"command.aexec",false)) then local x,y,z = getElementPosition (thePlayer) local houseCount = tonumber(getHouseCount()) local root = xmlLoadFile ("homes.xml") local housesRoot = xmlFindChild (root,"houses",0) local newHouse = xmlCreateChild (housesRoot,"house") xmlNodeSetAttribute (newHouse,"num",houseCount) xmlNodeSetAttribute (newHouse,"interior",interiorid) xmlNodeSetAttribute (newHouse,"x",x) xmlNodeSetAttribute (newHouse,"y",y) xmlNodeSetAttribute (newHouse,"z",z) xmlNodeSetAttribute (newHouse,"cost",price) xmlNodeSetAttribute (newHouse,"owner","") xmlNodeSetAttribute (newHouse,"dim",dimension) outputChatBox ("The house will appear when you restart the resource!",thePlayer,255,0,0,false) xmlSaveFile (root) xmlUnloadFile (root) else outputChatBox ("Admin only!",thePlayer,255,0,0,false) end else outputChatBox ("Wrong syntax, or get out of your vehicle!",thePlayer,255,0,0,false) outputChatBox ("SYNTAX: /createhouse [interior ID] [Dimension] [price in $]",thePlayer,255,0,0,false) outputChatBox (" Interior ID - standard 0-21 - the standard houses.",thePlayer,255,0,0,false) outputChatBox (" Dimension - number between 0 and 65535, always take another each interior!",thePlayer,255,0,0,false) outputChatBox (" Price - How much does the home cost?",thePlayer,255,0,0,false) end end) function getHouseCount () local root = xmlLoadFile ("homes.xml") local housesRoot = xmlFindChild (root,"houses",0) local allHouses = xmlNodeGetChildren (housesRoot) houses = 0 for i,v in ipairs (allHouses) do houses = houses+1 end xmlUnloadFile (root) return houses end function getMarkerByHousenumber (housenumber) for i,v in ipairs (getElementsByType("marker")) do if (getElementData (v,"housenumber") == tonumber(housenumber)) then return v end end end
  13. Hey guys, i have a turf area for my DM zone... The area (colored) will show in F11, but not on the radar. The little radar in the bottom left it will not show on, just F11. Please help. Code: (server) local hillArea = createColRectangle ( -2982.314453125, -2989.0341796875, 1800, 2100 ) local hillRadar = createRadarArea ( -2982.314453125, -2989.0341796875, 1800, 2100, 200, 0, 0, 150 ) -- add hill_Enter as a handler for when a player enters the hill area function hill_Enter ( thePlayer, matchingDimension ) -- announce to everyone that the player entered the hill if (getElementType(thePlayer) == "player") then outputChatBox( 'You have entered the Dethmatch Zone!', thePlayer, 255, 0, 0 ) setRadarAreaFlashing ( hillRadar, true ) end end addEventHandler ( "onColShapeHit", hillArea, hill_Enter ) -- add hill_Enter as a handler for when a player leaves the hill area function hill_Exit ( thePlayer, matchingDimension ) -- check if the player is not dead if (getElementType(thePlayer) == "player") then if isPedDead ( thePlayer ) ~= true then -- if he was alive, announce to everyone that the player has left the hill outputChatBox ( 'You have left the Dethmatch Zone!', thePlayer, 255, 0, 0 ) setRadarAreaFlashing ( hillRadar, true ) end end end addEventHandler ( "onColShapeLeave", hillArea, hill_Exit )
  14. No errors, it just didnt save... When i joined back to server i wasnt on any team D: (you can add me on skype (topKIDminer) and come look.)(my server requirs Hamachi - http://free-online-gaming.site40.net/downloads
  15. No errors, it just didnt save... When i joined back to server i wasnt on any team D:
  16. Thanks , but didnt work.
  17. Thanks , but didnt work.
  18. Hey guys, i have this save system that works great! Execpt one thing... it will not save the players team. Here is my script: () function onPlayerQuit ( ) local playeraccount = getPlayerAccount ( source ) if ( playeraccount ) then local x,y,z = getElementPosition (source) setAccountData ( playeraccount, "s.HandMoney", getPlayerMoney ( source ) ) setAccountData (playeraccount, "s.skin", tostring (getPedSkin (source))) setAccountData (playeraccount, "s.x", x) setAccountData (playeraccount, "s.y", y) setAccountData (playeraccount, "s.z", z) setAccountData (playeraccount, "s.int", getElementInterior (source)) setAccountData (playeraccount, "s.dim", getElementDimension (source)) setAccountData (playeraccount, "s.rot", getPlayerRotation (source)) setAccountData (playeraccount, "s.weap0", getPedWeapon ( source, 0 )) setAccountData (playeraccount, "s.weap1", getPedWeapon ( source, 1 )) setAccountData (playeraccount, "s.weap2", getPedWeapon ( source, 2 )) setAccountData (playeraccount, "s.ammo2", getPedTotalAmmo ( source, 2 )) setAccountData (playeraccount, "s.weap3", getPedWeapon ( source, 3 )) setAccountData (playeraccount, "s.ammo3", getPedTotalAmmo ( source, 3 )) setAccountData (playeraccount, "s.weap4", getPedWeapon ( source, 4 )) setAccountData (playeraccount, "s.ammo4", getPedTotalAmmo ( source, 4 )) setAccountData (playeraccount, "s.weap5", getPedWeapon ( source, 5 )) setAccountData (playeraccount, "s.ammo5", getPedTotalAmmo ( source, 5 )) setAccountData (playeraccount, "s.weap6", getPedWeapon ( source, 6 )) setAccountData (playeraccount, "s.ammo6", getPedTotalAmmo ( source, 6 )) setAccountData (playeraccount, "s.weap7", getPedWeapon ( source, 7 )) setAccountData (playeraccount, "s.ammo7", getPedTotalAmmo ( source, 7 )) setAccountData (playeraccount, "s.weap8", getPedWeapon ( source, 8 )) setAccountData (playeraccount, "s.ammo8", getPedTotalAmmo ( source, 8 )) setAccountData (playeraccount, "s.weap9", getPedWeapon ( source, 9 )) setAccountData (playeraccount, "s.ammo9", getPedTotalAmmo ( source, 9 )) setAccountData (playeraccount, "s.weap10", getPedWeapon ( source, 10 )) setAccountData (playeraccount, "s.weap11", getPedWeapon ( source, 11 )) setAccountData (playeraccount, "s.weap12", getPedWeapon ( source, 12 )) end end addEventHandler ( "onPlayerQuit", getRootElement ( ), onPlayerQuit ) local root = getRootElement() addEventHandler("onPlayerLogin", root, function() local playeraccount = getPlayerAccount ( source ) if ( playeraccount ) then local playermoney = getAccountData ( playeraccount, "s.HandMoney" ) if ( playermoney ) then setPlayerMoney ( source, playermoney ) end local playerInt = getAccountData (playeraccount, "s.int") local playerDim = getAccountData (playeraccount, "s.dim") local playerSkin = getAccountData (playeraccount, "s.skin") local playerX = getAccountData (playeraccount, "s.x") local playerY = getAccountData (playeraccount, "s.y") local playerZ = getAccountData (playeraccount, "s.z") local playerRot = getAccountData (playeraccount, "s.rot") spawnPlayer(source, playerX, playerY, playerZ, playerRot, playerSkin, playerInt, playerDim) fadeCamera (source, true) setCameraTarget (source, source) local weap0 = getAccountData(playeraccount, "s.weap0") local weap1 = getAccountData(playeraccount, "s.weap1") local weap2 = getAccountData(playeraccount, "s.weap2") local ammo2 = getAccountData(playeraccount, "s.ammo2") local weap3 = getAccountData(playeraccount, "s.weap3") local ammo3 = getAccountData(playeraccount, "s.ammo3") local weap4 = getAccountData(playeraccount, "s.weap4") local ammo4 = getAccountData(playeraccount, "s.ammo4") local weap5 = getAccountData(playeraccount, "s.weap5") local ammo5 = getAccountData(playeraccount, "s.ammo5") local weap6 = getAccountData(playeraccount, "s.weap6") local ammo6 = getAccountData(playeraccount, "s.ammo6") local weap7 = getAccountData(playeraccount, "s.weap7") local ammo7 = getAccountData(playeraccount, "s.ammo7") local weap8 = getAccountData(playeraccount, "s.weap8") local ammo8 = getAccountData(playeraccount, "s.ammo8") local weap9 = getAccountData(playeraccount, "s.weap9") local ammo9 = getAccountData(playeraccount, "s.ammo9") local weap10 = getAccountData(playeraccount, "s.weap10") local weap11 = getAccountData(playeraccount, "s.weap11") local weap12 = getAccountData(playeraccount, "s.weap12") giveWeapon ( source, weap0, 1 ) giveWeapon ( source, weap1, 1 ) giveWeapon ( source, weap2, ammo2 ) giveWeapon ( source, weap3, ammo3 ) giveWeapon ( source, weap4, ammo4 ) giveWeapon ( source, weap5, ammo5 ) giveWeapon ( source, weap6, ammo6 ) giveWeapon ( source, weap7, ammo7 ) giveWeapon ( source, weap8, ammo8 ) giveWeapon ( source, weap9, ammo9 ) giveWeapon ( source, weap10, 1 ) giveWeapon ( source, weap11, 1 ) giveWeapon ( source, weap12, 1 ) end end )
  19. Hey guys, I was wondering how to make my staff skin god mode. If you could help that would be awsome! I need skin 217 in godmode... i honestly have no clue how to do it. Or if you could make team "Staff" godmode that would be great too. Thanks in advance.
  20. Hey guys... I have a GUI that i made, and the bindKey will not work for some reason, feel free to take a look at it: GUIEditor_Window = {} GUIEditor_TabPanel = {} GUIEditor_Tab = {} GUIEditor_Button = {} GUIEditor_Label = {} GUIEditor_Window[1] = guiCreateWindow(62,60,1549,931,"US-RP (United States Roleplay)",false) guiSetAlpha(GUIEditor_Window[1],1) guiWindowSetMovable(GUIEditor_Window[1],false) guiWindowSetSizable(GUIEditor_Window[1],false) GUIEditor_Label[1] = guiCreateLabel(20,23,1502,153,"\n\nWelcome to United States Roleplay, where roleplay is made!\n\nThis is a 100% unique server! You can not find servers like this anywhere exept for here. We have the best staff, and the best scripts.\n\nPLEASE BE SURE TO READ ARE RULES SO YOU ARE NOT AT RISK OF BEING JAILED/MUTED/KICKED/BANNED!!!!!",false,GUIEditor_Window[1]) guiLabelSetHorizontalAlign(GUIEditor_Label[1],"center",true) GUIEditor_TabPanel[1] = guiCreateTabPanel(293,278,991,475,false,GUIEditor_Window[1]) GUIEditor_Tab[1] = guiCreateTab("About us",GUIEditor_TabPanel[1]) GUIEditor_Label[2] = guiCreateLabel(14,16,964,422,"First of all, we are the best server of ALL OF MTA AND SA-MP (SA-MP is shit)\n\nxXMADEXx (server owner) got sick of trying to find a new favorite server after being banned from is favorite one (RRC:RPG) for talking back to an admin.\n\n(He was talking back because the admin was being racist to Americans, his name is Khalil so give him shit if you want to! We encourage you to give him a hard time)\n\nAnyway, this server was developed in 2012, and was releast to public (IDK).\n\n",false,GUIEditor_Tab[1]) guiLabelSetColor(GUIEditor_Label[2],0,100,255) guiLabelSetHorizontalAlign(GUIEditor_Label[2],"center",false) guiSetFont(GUIEditor_Label[2],"clear-normal") GUIEditor_Tab[2] = guiCreateTab("Rules",GUIEditor_TabPanel[1]) GUIEditor_Tab[3] = guiCreateTab("Staff",GUIEditor_TabPanel[1]) button = guiCreateButton(300,773,979,143,"Exit Menu!",false,GUIEditor_Window[1]) guiSetFont(button,"sa-gothic") bindKey("F1", "down", function () guiSetVisible(GUIEditor_Window[1], true) guiSetVisible(GUIEditor_Label[1], true) guiSetVisible(GUIEditor_Label[2], true) guiSetVisible(GUIEditor_TabPanel[1], true) guiSetVisible(GUIEditor_Tab[1], true) guiSetVisible(GUIEditor_Tab[2], true) guiSetVisible(GUIEditor_Tab[3], true) guiSetVisible(button, true) showCursor (true) end function closed() guiSetVisible(GUIEditor_Window[1], false) guiSetVisible(GUIEditor_Label[1], false) guiSetVisible(GUIEditor_Label[2], false) guiSetVisible(GUIEditor_TabPanel[1], false) guiSetVisible(GUIEditor_Tab[1], false) guiSetVisible(GUIEditor_Tab[2], false) guiSetVisible(GUIEditor_Tab[3], false) guiSetVisible(button, false) showCursor (false, false) end addCommandHandler("closemenu", closed)
  21. Hey guys... I am still new to scripting, and i am trying to create Team Pickups. The problem is, i havn't got a clue how to. I know alot of servers have them and it would be nice to have them on m server to... I know that i am asking for something, but i am not asking for much. Please give me a script to create Team Pickups. Thank you for taking your time to read this.
×
×
  • Create New...