-
Posts
4,961 -
Joined
-
Last visited
Everything posted by Jaysds1
-
Edited the script again, the problem was that the element "player" was at the end of the outputChatBox parameter.
-
2. Use these functions: isObjectInACLGroup -- checks if the object is in the acl group getAccountName -- Get's the player's account name aclGetGroup --Get's the group by name ------------------Example---------------------- isObjectInACLGroup("user."..getAccountName(source),aclGetGroup("admin")) --checks if the player is in the admin group 3. There's no function named "isPlayerInACLGroup". I think he meant "isObjectInACLGroup"
-
Sorry, we can't read the Total/Write/Read .
-
One thing you would have to avoid is using the same function name as the variable name. Make sure this is server-sided. Try this: function dbFunc() local db = dbConnect( "sqlite", "dbname=zahrej;host=mysql.mmhost.eu", "zahrej", "passwordhhaha", "share=1" ) if ( db ) then outputChatBox ( "Connected" ) else outputChatBox ( "Something went wrong" ) end end addCommandHandler ("database", dbFunc )
-
@Hutchpe try this: local sound --make the sound available for the whole script function startGarageMusic() sound = playSound("saints_row_garage.mp3", true) setRadioChannel(0) setSoundVolume( sound, 0.8 ) end addEventHandler("onClientVehicleEnter",getRootElement(),startGarageMusic) function stopGarageMusic() if isElement(sound) then stopSound( sound ) end end addCommandHandler ( "stopsound", stopGarageMusic ) addEventHandler("onClientVehicleExit",getRootElement(),stopGarageMusic) @dazzlepoint Try this: local sounds = { ['S1'] = "http://d.liveatc.net/kjfk_twr", ['S2'] = "http://212.45.104.34:8042/listen.pls", } function startMySound() local vehicle = getPedOccupiedVehicle( localPlayer ) local id = getVehicleID(vehicle) or getElementModel(vehicle) if (id == 513 ) then setRadioChannel(0) sound = playSound( sounds['S1'] ) elseif (id == 429 ) then setRadioChannel(0) sound = playSound( sounds['S2'] ) end end addEventHandler("onClientPlayerVehicleEnter",getRootElement(),startMySound) function stopMySound() stopSound( sounds ) end addCommandHandler ( "stopsound", stopMySound ) addEventHandler("onClientVehicleExplode",getRootElement(),stopMySound) Yes it does have to be client-side, and no you don't need to add the sound to the [[meta.xml]] .
-
Well, it should work if you destroy the vehicle.
-
Use: getPedWeapon -- get's the ped's weapon getPedTotalAmmo --get's the ped's weapon total ammo setWeaponAmmo --set's the ped's weapon ammo
-
Sorry, I used the wrong event, try this one: local govTeams = { ["Police"]=true, ["SWAT"]=true, ["FBI"]=true, ["Army"]=true } function unemploy ( thePlayer ) if getElementType(thePlayer)~="player" then return end if getPlayerWantedLevel( thePlayer ) == 6 and then --check if the players wanted level is 6 if govTeams[getTeamName(getPlayerTeam(thePlayer))] then --check if the player is working for the government setPlayerTeam(thePlayer,getTeamFromName("Unemployed")) --set the player to un-employed as the government doesn't like criminals outputChatBox ("Menetit työsi, koska olet korruptoitunut!",thePlayer , 255, 0, 0) end end end addEventHandler("onPlayerDamage",root,unemploy) --This is triggered when a player is attacked
-
local isPlayerViewingPanel = false local sw,sh = guiGetScreenSize() local font = dxCreateFont("impact.ttf") --creates font function dxDrawTheImage ( ) if isPlayerViewingPanel then dxDrawImage (240, 145, 550, 480, "window.png" ) dxDrawText( "THIS IS MY NEW FONT!!!", sw/2 - 1024, sh/2 - 768, sw/2 + 175, sh/2 + 80, tocolor(255,255,255), 1, font ) end end addEventHandler ( "onClientRender", root, dxDrawTheImage ) bindKey("f9", "down",function() isPlayerViewingPanel = not isPlayerViewingPanel end) Try this and if it doens't work please describe what's not working!
-
Zonex servers | Host a Awesome Game server!
Jaysds1 replied to Zonex servers's topic in Hosting solutions
Ok, I have confirmed that the website theme/template was bought!!! Just by looking at the whole site CSS and Page Source, I know the site they bought it from but don't remember the name for it. -
This should work: local isPlayerViewingPanel = false local sw,sh = guiGetScreenSize() local font = dxCreateFont("impact.ttf") --creates font function dxDrawTheImage ( ) if isPlayerViewingPanel then dxDrawImage ( 240, 145, 550, 480, "window.png" ) dxDrawText( "THIS IS MY NEW FONT!!!", sw/2 - 1024, sh/2 - 768, 175, 80, tocolor(255,255,255), 1, font ) end end addEventHandler ( "onClientRender", root, dxDrawTheImage ) bindKey("f9", "down",function() isPlayerViewingPanel = not isPlayerViewingPanel end) and make sure you have the font in the same folder as this script!!!
-
Please buy the official and compatible gtasa. Either from: Steam or the official site: RockStar [*]RockStar Warehouse [*](Download) RockStar
-
Sorry, but the MTA Devs can't do anything about this... viewtopic.php?f=114&t=15740
-
You could try making one your self and ask us for help after
-
Is it possible you could post the map's "map.xml" file?
-
Sorry, just updated the code again
-
try this: --Thanks TAPL for Useful Function!!! function getPlayerFromNamePart(name) if name then for i, player in ipairs(getElementsByType("player")) do if string.find(getPlayerName(player):lower(), tostring(name):lower(), 1, true) then return player end end end return false end function assignNewTeam ( source, _, playername, teamname ) if not playername then outputChatBox("Please enter in the player's name that you would like to remove from team!",source,255,0,0) return end local player = getPlayerFromName(playername) if not player then player = getPlayerFromNamePart(playername) end if not player or isElement(player) then outputChatBox("Sorry, player doesn't exist!",source,255,0,0) return end local theTeam = getTeamFromName ( teamname ) if not theTeam then theTeam = createTeam ( teamName ) end setPlayerTeam ( source, theTeam ) end addCommandHandler ( "invite", assignNewTeam ) function unassignTeam ( source, _, playername, teamname ) if not playername then outputChatBox("Please enter in the player's name that you would like to remove from team!",source,255,0,0) return end local player = getPlayerFromName(playername) if not player then player = getPlayerFromNamePart(playername) end if not player or isElement(player) then outputChatBox("Sorry, player doesn't exist!",source,255,0,0) return end local theTeam = getPlayerTeam ( player ) if not theTeam then outputChatBox("Player isn't on a team!",source,255,0,0) return end setPlayerTeam ( player, nil ) end addCommandHandler ( "dismiss", unassignTeam )
-
Wow, ok local sw,sh = guiGetScreenSize() local font = dxCreateFont("impact.ttf") --creates font --creates a text using the customed font in the middle of the screen dxDrawText( "THIS IS MY NEW FONT!!!", sw/2 - 200, sh/2 - 200, 200, 200, tocolor(0,255,0), 1, font )
-
Lol, I've seen that and I had to shake my head, anyways, wait till @Sandelssi13 replies!!!
-
ok, Wiki Example: local myFont = nil -- Display text using dxDrawText addEventHandler( "onClientRender", root, function() if myFont then dxDrawText( "dxDrawText", 100, 350, 300, 350, tocolor(255,255,0), 1, myFont ) end end ) -- Use 'toggle' command to switch custom font on and off addCommandHandler( "toggle", function() if not myFont then myFont = dxCreateFont( "segoeui.ttf", 20 ) -- Create custom font else destroyElement( myFont ) -- Destroy custom font myFont = nil end end )
-
dxCreateFont -- creates custom font dxDrawText --draw text