-
Posts
4,961 -
Joined
-
Last visited
Everything posted by Jaysds1
-
Maybe we could convince one of the Admin's or Devs to make an Important announcements, this would put the event on everyone's UserPanel and in topics (i think)... How about that?
-
ok, thanks for telling me you guyz, I should have been more awake last night anyways, use what kenix posted...
-
lol, Q: What should we do with Capy?
-
While in map editor, go into objects and go in to catergory Lights, That LOD is a light LOD, I'm not sure if you could remove it but it's in there. Good luck
-
actually, it's: executeSQLCreateTable ( "Peds", "PosX, PosY, PosZ" )
-
try this: "race" type="map" name="[DM]Zibler-let's party" author="Zibler " version="1.0.0"> "zibler.map" dimension="0"> "#minplayers" value="[ 0 ]"> "#maxplayers" value="[ 128 ]"> "#gravity" value="[ 0.008000 ]"> "#weather" value="[ 3 ]"> "#time" value="1:0"> "#locked_time" value="[ false ]"> "#waveheight" value="[ 0 ]"> "#gamespeed" value="[ 1 ]"> "song.mp3">
-
try lowering the range. Plus the model wasn't removed, I just tested it.
-
Sorry, but you can't change your serial... it's basically part of your computer now, doesn't matter if you uninstall or reinstall MTA... Here's an example:
-
thanks, it's been a ruff day for me... I've edited it BTW
-
Client-side: -- CLIENT SIDE --Don't leave this with out -- or the script will return false local marker = createMarker( 94.800003051758, 1925.1999511719, 17, "Cylinder", 2, 40, 73, 0, 200) GUIEditor_Button = {} GUIEditor_Memo = {} GUIEditor_Label = {} windowjob = guiCreateWindow(531,232,301,397,"Armed Forces",false) guiSetVisible(windowjob, false) GUIEditor_Button[1] = guiCreateButton(22,352,108,35,"Take job",false,windowjob) GUIEditor_Label[1] = guiCreateLabel(193,-103,5,5,"",false,windowjob) GUIEditor_Button[2] = guiCreateButton(179,352,110,36,"Cancel",false,windowjob) GUIEditor_Memo[1] = guiCreateMemo(19,33,273,215,"Welcome To Armed Forces\n\nTo take Armed Forces job, press Take job.\n\nIf you don't want to, press Cancel.",false,windowjob) addEvent("window",true) addEventHandler("window",root,function(oc) guiSetVisible(windowjob,oc) showCursor(oc) if(oc==true)then addEventHandler("onClientGUIClick", GUIEditor_Button[1] , joinTeam, false) addEventHandler("onClientGUIClick", GUIEditor_Button[2] , removeAFWindow, false) end end) function joinTeam() triggerServerEvent("setAF",locaPlayer) guiSetVisible(windowjob,false) showCursor(false) end function removeAFWindow() guiSetVisible(windowjob, false) showCursor(false) end Server: -- SERVER SIDE --Samething here function createTeamsOnStart () teamAF = createTeam ( "Armed Forces", 40, 73, 0 ) setTeamFriendlyFire ( teamAF, false ) end addEventHandler("onResourceStart", resourceRoot, createTeamsOnStart) function joinAF() --Don't include anything in the brackets if you never sent/added any arguments setPlayerTeam(client,teamAF) setBlipColor ( client, 40, 73, 0, 255 ) setElementModel(client,287) setPlayerNametagColor (client, 40, 73, 0 ) giveWeapon ( client, 3, 1 ) setElementData( client, "Occupation", "Armed Forces", true ) outputChatBox("You have been employed as Armed Forces.",client,0,255,0) end addEvent("setAF", true) addEventHandler("setAF",root,joinAF) local marker = createMarker( 94.800003051758, 1925.1999511719, 17, "Cylinder", 2, 40, 73, 0, 200) function AFjob( pPlayer ) local accName = getAccountName ( getPlayerAccount ( pPlayer )) --Don't put this in if statements and thePlayer is suppose to be bPlayer if (accName) then if isObjectInACLGroup ("user."..accName, aclGetGroup ( "Armed Forces" ) ) then if getElementType(pPlayer) == "player" then triggerClientEvent(pPlayer,"window",root,true) end end end end addEventHandler("onMarkerHit", marker, AFjob) function AFjobleave( pPlayer ) if getElementType(pPlayer) == "player" then triggerClientEvent(pPlayer,"window",root,false) end end addEventHandler("onMarkerLeave", marker, AFjobleave) BTW, Did you added this to the ACL.xml?
-
Search: search.php?st=0&sk=t&sd=d&sr=posts&keywords=Setup+Server
-
The community is other scripters work...
-
It's suppose to be in your Map Editor... Click Map Editor and when your launched in-game, There should be some buttons at the top and bottom, Do what Flaker said:
-
Sorry, that's true, I can't believe I never put that :slap:
-
Thanks Alpha, It's a long script so, I tried making more checks.
-
here: function card () local acc = getPlayerAccount(client) if ( acc ) then if(getAccountData(acc,"onHaveGunLicense"))then outputChatBox("You already have a gun license",client,150,0,0) else setAccountData(acc,'onHaveGunLicense', true) end end end addEvent('givecard', true) addEventHandler('givecard', root, card )
-
A: failers = xmlLoadFile("superfailers.xml") if failers then for i,v in ipairs(xmlNodeGetChildren(failers))do if(v=="Samer")then outputChatBox(v.."is not going to be a super hero.",root,0,255,0) print(v.."is not going to be a super hero.") break; end end end Q: Who knows me?
-
try this: g_Root = getRootElement() function Initiate() local country = getPlayerCountry(source) if (country == nil or false) then country = "n/a" end setElementData(source, "country", country) end addEventHandler('onPlayerJoin', g_Root, Initiate) addEventHandler("onResourceStart",resourceRoot,function() -- You can remove this if you want outputChatBox('#ffffff[bemVindo] #ffff00Divirtam-se #ffffffDONE', getRootElement(), 255, 100, 100, true) -- call(getResourceFromName("scoreboard"),"addScoreboardColumn","Country", getRootElement(), 9, 50) exports.Scoreboard:addScoreboardColumn("Country",root,9,50) setTimer(function() local country = getPlayerCountry(source) if country == nil or country == false then country = "n/a" end for i,v in ipairs(getElementsByType("player"))do setElementData(v, "country", country) end end, 4000, 1) end) aCountries = {} function getPlayerCountry ( player ) if(getPlayerFromName(getPlayerName(player)))then return getIpCountry ( getPlayerIP ( player ) ) else outputDebugString("Player is not define or is not on the server.",3) end end function getIpCountry ( ip ) local ip_group = tonumber ( gettok ( ip, 1, 46 ) ) local ip_code = ( gettok ( ip, 1, 46 ) * 16777216 ) + ( gettok ( ip, 2, 46 ) * 65536 ) + ( gettok ( ip, 3, 46 ) * 256 ) + ( gettok ( ip, 4, 46 ) ) if ( #aCountries == 0 ) then loadIPGroups () end if ( not aCountries[ip_group] ) then aCountries[ip_group] = {} end for id, group in ipairs ( aCountries[ip_group] ) do if ( ( group.rstart <= ip_code ) and ( ip_code <= group.rend ) ) then return group.rcountry end end return false end -- Load all IP groups from "conf/IpToCountryCompact.csv" function loadIPGroups () unrelPosReset() local readFilename = "conf/IpToCountryCompact.csv"; local hReadFile = fileOpen( readFilename, true ) if not hReadFile then outputDebugString( "Cannot read " .. readFilename,3 ) return end local buffer = "" while true do local endpos = string.find(buffer, "\n") -- If can't find CR, try to load more from the file if not endpos then if fileIsEOF( hReadFile ) then break end buffer = buffer .. fileRead( hReadFile, 500 ) end if endpos then -- Process line local line = string.sub(buffer, 1, endpos - 1) buffer = string.sub(buffer, endpos + 1) local parts = split( line, string.byte(',') ) if #parts > 2 then local rstart = tonumber(parts[1]) local rend = tonumber(parts[2]) local rcountry = parts[3] -- Relative to absolute numbers rstart = unrelRange ( rstart ) rend = unrelRange ( rend ) local group = math.floor( rstart / 0x1000000 ) if not aCountries[group] then aCountries[group] = {} end local count = #aCountries[group] + 1 aCountries[group][count] = {} aCountries[group][count].rstart = rstart aCountries[group][count].rend = rend aCountries[group][count].rcountry = rcountry end end end fileFlush(hReadFile) --Got to put the data in to the file before you close it fileClose(hReadFile) end -- Make a stream of absolute numbers relative to each other local relPos = 0 function relPosReset() if(relPos>0)then relPos = 0 end end function relRange( v ) if(v)then local rel = v - relPos relPos = v return rel else outputDebugString("Never got the range.",3) end end -- Make a stream of relative numbers absolute local unrelPos = 0 function unrelPosReset() if(unrelPos>0)then unrelPos = 0 end end function unrelRange( v ) if(v)then local unrel = v + unrelPos unrelPos = unrel return unrel else outputDebugString("Unable to unrel Range",3) end end ---------------------------------------------------------------------------------------- -- -- Set to true to enable commands "makecsv" and "iptest" -- ---------------------------------------------------------------------------------------- local makeAndTestCompactCsv = false if makeAndTestCompactCsv then local makeCor -- Takes a 'IPV4 CSV' file sourced from [url=http://software77.net/geo-ip/]http://software77.net/geo-ip/[/url] -- and makes a smaller one for use by Admin addCommandHandler ( "makecsv", function () local status = makeCor and coroutine.status(makeCor) if (status == "suspended") then outputDebugString( "Please wait" ) return end makeCor = coroutine.create ( makeCompactCsvWorker ) coroutine.resume ( makeCor ) end ) function makeCompactCsvWorker () outputDebugString ( "makeCompactCsv started" ) relPosReset() local readFilename = "conf/IpToCountry.csv"; local hReadFile = fileOpen( readFilename, true ) if not hReadFile then outputDebugString ( "Cannot read " .. readFilename ) return end local writeFilename = "conf/IpToCountryCompact.csv"; local hWriteFile = fileCreate( writeFilename, true ) if not hWriteFile then fileClose(hReadFile) outputDebugString ( "Cannot create " .. writeFilename ) return end local tick = getTickCount() local buffer = "" while true do if ( getTickCount() > tick + 50 ) then -- Execution exceeded 50ms so pause and resume in 50ms setTimer(function() local status = coroutine.status(makeCor) if (status == "suspended") then coroutine.resume(makeCor) elseif (status == "dead") then makeCor = nil end end, 50, 1) coroutine.yield() tick = getTickCount() end local endpos = string.find(buffer, "\n") -- If can't find CR, try to load more from the file if not endpos then if fileIsEOF( hReadFile ) then break end buffer = buffer .. fileRead( hReadFile, 500 ) end if endpos then -- Process line local line = string.sub(buffer, 1, endpos - 1) buffer = string.sub(buffer, endpos + 1) -- If not a comment line if string.sub(line,1,1) ~= '#' then -- Parse out required fields local _,_,rstart,rend,rcountry = string.find(line, '"(%w+)","(%w+)","%w+","%w+","(%w+)"' ) if rcountry then -- Absolute to relative numbers rstart = relRange( rstart ) rend = relRange( rend ) -- Output line fileWrite( hWriteFile, rstart .. "," .. rend .. "," .. rcountry .. "\n" ) end end end end fileClose(hWriteFile) fileClose(hReadFile) outputDebugString ( "makeCompactCsv done" ) end addCommandHandler ( "iptest", ipTest ) end function ipTestDo( ip )
-
I've edited the client-side in my last post, copy it again, and can you post your server-side script
-
try this, client-side: GUIEditor_Window = {} GUIEditor_Button = {} GUIEditor_Label = {} GUIEditor_Image = {} GUIEditor_Window[3] = guiCreateWindow(408,279,511,283,"Buy gun license (v1.0)",false) GUIEditor_Window[4] = guiCreateWindow(0.3,0.15,0.30,0.1,"Oh damn!",true) guiSetVisible(GUIEditor_Window[3],false) guiSetVisible(GUIEditor_Window[4],false) guiSetAlpha(GUIEditor_Window[4],1) guiBringToFront(GUIEditor_Window[4]) label = guiCreateLabel (0.20,0.25,0.65,0.3,"You dont have enough money to buy that.",true,GUIEditor_Window[4]) button = guiCreateButton (0.35,0.6,0.3,0.2,"Ok",true,GUIEditor_Window[4]) guiWindowSetMovable(GUIEditor_Window[3],false) guiWindowSetSizable(GUIEditor_Window[3],false) GUIEditor_Image[1] = guiCreateStaticImage(168,23,166,141,"images/mtalogo.png",false,GUIEditor_Window[3]) GUIEditor_Button[1] = guiCreateButton(162,162,196,49,"Buy gun license $ 3000",false,GUIEditor_Window[3]) guiSetFont(GUIEditor_Button[1],"clear-normal") GUIEditor_Label[1] = guiCreateLabel(10,254,296,16,"To Buy Weapons You Need to Buy gun license",false,GUIEditor_Window[3]) guiLabelSetColor(GUIEditor_Label[1],255,255,0) guiSetFont(GUIEditor_Label[1],"clear-normal") GUIEditor_Button[3] = guiCreateButton(403,22,99,18,"Exit",false,GUIEditor_Window[3]) guiSetFont(GUIEditor_Button[3],"clear-normal") addEventHandler("onClientGUIClick",guiRoot,function() money = getPlayerMoney (localPlayer) if (source == GUIEditor_Button[29]) then guiSetVisible (GUIEditor_Window[1],false) showCursor (false) elseif (source == GUIEditor_Button[30]) then guiSetVisible (GUIEditor_Window[2],false) showCursor (false) elseif (source == GUIEditor_Button[1]) then if (money >= 100) then outputChatBox ("You bought a Pistol $100",225,225,0) takePlayerMoney(100) triggerServerEvent ("give45",getLocalPlayer(),give45) else guiSetVisible(GUIEditor_Window[2],true) guiSetVisible(GUIEditor_Window[1],false) end elseif (source == GUIEditor_Button[2]) then if (money >= 200) then outputChatBox ("You bought a Silenced $200",225,225,0) takePlayerMoney(200) triggerServerEvent ("givesilenced",getLocalPlayer(),givesilenced) else guiSetVisible(GUIEditor_Window[1],false) guiSetVisible(GUIEditor_Window[2],true) end elseif (source == GUIEditor_Button[3]) then guiSetVisible(GUIEditor_Window[3],false) showCursor(false) elseif (source == GUIEditor_Button[4]) then if (money >= 500) then outputChatBox ("You bought a Shotgun $500",225,225,0) takePlayerMoney(500) triggerServerEvent ("givesh",getLocalPlayer(),givesh) else guiSetVisible(GUIEditor_Window[1],false) guiSetVisible(GUIEditor_Window[2],true) end elseif (source == GUIEditor_Button[5]) then if (money >= 700) then outputChatBox ("You bought a Sawn Off $700",225,225,0) takePlayerMoney(700) triggerServerEvent ("giveso",getLocalPlayer(),giveso) else guiSetVisible(GUIEditor_Window[1],false) guiSetVisible(GUIEditor_Window[2],true) end elseif (source == GUIEditor_Button[6]) then if (money >= 1000) then outputChatBox ("You bought a SPAZ-12 $1000",225,225,0) takePlayerMoney(1000) triggerServerEvent ("giveSP",getLocalPlayer(),giveSP) else guiSetVisible(GUIEditor_Window[1],false) guiSetVisible(GUIEditor_Window[2],true) end elseif (source == GUIEditor_Button[7]) then if (money >= 400) then outputChatBox ("You bought a Tec-9 $400",225,225,0) takePlayerMoney(400) triggerServerEvent ("givetec",getLocalPlayer(),givetec) else guiSetVisible(GUIEditor_Window[1],false) guiSetVisible(GUIEditor_Window[2],true) end elseif (source == GUIEditor_Button[8]) then if (money >= 600) then outputChatBox ("You bought a Uzi $600",225,225,0) takePlayerMoney(600) triggerServerEvent ("giveuzi",getLocalPlayer(),giveuzi) else guiSetVisible(GUIEditor_Window[1],false) guiSetVisible(GUIEditor_Window[2],true) end elseif (source == GUIEditor_Button[9]) then if (money >= 800) then outputChatBox ("You bought a MP5 $800",225,225,0) takePlayerMoney(800) triggerServerEvent ("givemp5",getLocalPlayer(),givemp5) else guiSetVisible(GUIEditor_Window[1],false) guiSetVisible(GUIEditor_Window[2],true) end elseif (source == GUIEditor_Button[11]) then if (money >= 1000) then outputChatBox ("You bought an AK-47 $1000",225,225,0) takePlayerMoney(1000) triggerServerEvent ("giveak",getLocalPlayer(),giveak) else guiSetVisible(GUIEditor_Window[1],false) guiSetVisible(GUIEditor_Window[2],true) end elseif (source == GUIEditor_Button[10]) then if (money >= 2000) then outputChatBox ("You bought a M4 $2000",225,225,0) takePlayerMoney(2000) triggerServerEvent ("givem4",getLocalPlayer(),givem4) else guiSetVisible(GUIEditor_Window[1],false) guiSetVisible(GUIEditor_Window[2],true) end elseif (source == GUIEditor_Button[13]) then if (money >= 3000) then outputChatBox ("You bought a Sniper $3000",225,225,0) takePlayerMoney(3000) triggerServerEvent ("gives",getLocalPlayer(),gives) else guiSetVisible(GUIEditor_Window[1],false) guiSetVisible(GUIEditor_Window[2],true) end elseif (source == GUIEditor_Button[12]) then if (money >= 1000) then outputChatBox ("You bought a Country Sniper $1000",225,225,0) takePlayerMoney(1000) triggerServerEvent ("givecs",getLocalPlayer(),givecs) else guiSetVisible(GUIEditor_Window[1],false) guiSetVisible(GUIEditor_Window[2],true) end elseif (source == GUIEditor_Button[25]) then if (money >= 1000) then outputChatBox ("You bought a MedKit $1000",225,225,0) takePlayerMoney(1000) triggerServerEvent ("givehealth",getLocalPlayer(),givehealth) else guiSetVisible(GUIEditor_Window[1],false) guiSetVisible(GUIEditor_Window[2],true) end elseif (source == GUIEditor_Button[26]) then if (money >= 1500) then outputChatBox ("You bought a Bullet Proof Vest $1500",225,225,0) takePlayerMoney(1500) triggerServerEvent ("givearmor",getLocalPlayer(),givearmor) else guiSetVisible(GUIEditor_Window[1],false) guiSetVisible(GUIEditor_Window[2],true) end elseif (source == button) then guiSetVisible(GUIEditor_Window[2],false) guiSetVisible(GUIEditor_Window[1],true) elseif ( source == GUIEditor_Button[3] ) then guiSetVisible(GUIEditor_Window[3],true) guiSetVisible(GUIEditor_Window[4],false) elseif (source == GUIEditor_Button[1]) then if (money >= 3000) then takePlayerMoney(3000) triggerServerEvent ("givecard",localPlayer) else guiSetVisible(GUIEditor_Window[2],true) guiSetVisible(GUIEditor_Window[1],false) end end end,true) function showGUI () if(eventName=="showGUI")then guiSetVisible (GUIEditor_Window[1],true) showCursor (true) else guiSetVisible (GUIEditor_Window[3],true) showCursor(true) end end addEvent ("showGUI",true) addEventHandler ("showGUI",getRootElement(),showGUI) addEvent ("showGUI2",true) addEventHandler ("showGUI2",getRootElement(),showGUI) createBlip ( 1367, -1279, 13 , 6 ) For the marker, the markers don't attach to the ground, so lower down the (ones) number and see if it's close to the ground
-
change those give functions to this: function giveGUN() if(not getAccountData(acc,"GunLicense")then outputChatBox("Sorry You Must Have A Gun License",client,100,0,0) else giveWeapon(thewep) end end
-
:lol: Nice, and np(even though I miss read )
-
Snap, just read again Thanks solid
-
try this: function onConsoleSay ( text ) if isElement(console) then ---Or if source == console then cancelEvent() outputChatBox("The best console: "..text, root, 0, 255, 0) end end addEventHandler("onChatMessage", root, onConsoleSay) I got it from this topic: viewtopic.php?f=91&t=42598&p=430495&hilit=onChatMessage#p430495