Jump to content

roaddog

Members
  • Posts

    346
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by roaddog

  1. roaddog

    [Fixed][Ty]

    No, I have done that but still has problem, Noone is in the list except player who's afk any solution?
  2. roaddog

    [Fixed][Ty]

    Well, after some mins I figured out, and found a problem with this script ok, let me explain the problem ex. when player1 does afk and he himself does/afklist in the chat will be seen his name in the list. but when others do afk and player1 do /afklist and in the chat, the list that should be the name of the other person turned out to be empty. so that means, player can only see his name on list. I will bring the script here ---------fixed------------ I hope you understand what im trying to do, Thanks
  3. roaddog

    AFK list

    EDIT try this function afkList (player) local afkplayers = { } for i,thePlayer in ipairs(getElementsByType("player")) do if (getElementData(thePlayer, "AFK")) then table.insert(afkplayers, thePlayer) end end if (#afkplayers > 0) then outputChatBox("List of AFK Players:", player, 50, 255, 50, true) outputChatBox("---------------------",player, 50,255, 50, true) for i,thePlayer in ipairs(afkplayers) do local name = getPlayerName(thePlayer) outputChatBox("*"..name, thePlayer, 55, 255,55, true) end outputChatBox("---------------------",player, 50,255, 50, true) else outputChatBox("There's no Players AFK", player, 55, 255,55, true) end end addCommandHandler("afklist", afkList) Aw Very nice, Thank you it works It was so fast
  4. roaddog

    AFK list

    Line 4 attempt to compare number with boolean
  5. roaddog

    AFK list

    Thanks wassim, but it got error, line 4 attempt to compare number with boolean
  6. roaddog

    AFK list

    Hello all today i bring to you this problem, and I dont know how to fix this cuz you know im still learning function afkList (player, command) players = getPlayerFromName("player") for i,thePlayer in ipairs(players) do if (getElementData(thePlayer, "AFK") > 0) then outputChatBox("List of AFK Players :", player, 50, 255, 50, true) outputChatBox("---------------------",player, 50,255, 50, true) outputChatBox("*"..getPlayerName(thePlayer).."", player, 55, 255, 55, true) elseif (getElementData(thePlayer, "AFK") == 0) then outputChatBox("There's no Players AFK", player, 55, 255,55, true) end end end addCommandHandler("afklist", afkList) and debug script says Error bad argument #1 ipairs (table expected, got boolean)
  7. Hi all I got a problem with this medic job script, I want to make that medic will stop getting money from healing players when players already have 100% of health. so here the script edit : if i hit player who has 100% health. first hit I aint getting money, second hit the player lost hp, and third hit the player get healed again. function healPlayerOnHit_Handler(theAttacker, theWeapon, theBodyPart, theLoss) if(getElementType(theAttacker) == "player") then if(theWeapon == 14) and (getElementHealth(source) < 95) then cancelEvent() local targetCurrentHealth = getElementHealth(source) local newHealth = targetCurrentHealth+15 setElementHealth(source, newHealth) givePlayerMoney(theAttacker, 1.7*newHealth) end end end addEventHandler("onPlayerDamage", getRootElement(), healPlayerOnHit_Handler) I hope you understand what I wanna do, Thank you.
  8. How can I show gang and rank on the scoreboard? getPlayerGroup(player) -- get the group string of the player getGroupMembers(group) -- returns a table of the player(s) inside that group (not entirely sure whether I finished this function, if not I will soon)
  9. Oh I know now it should be like this just tried and tried exports["scoreboard"]:addScoreboardColumn( "Home", getRootElement() , 1, 20, "Home") Thanks both of ya
  10. Anyone help me please here's the code exports["scoreboard"]:addScoreboardColumn( "Home", getRootElement() , 20, "Home", 1 ) exports["scoreboard"]:addScoreboardColumn("Country",getRootElement() , 100, "Country", 3 )
  11. Like this ? sorry I have been learning since a week ago scoreboardAddColumn ( "home", 40, "Home" )
  12. Hi, again now Im going to add coloumn in scoreboard. How can I modify the width if I use exports function ? exports.scoreboard:addScoreboardColumn('Home') function showcountry() local flag = exports.admin:getPlayerCountry ( source ) if flag then setElementData(source,"Home",":admin/client/images/flags/"..flag..".png") else flag = "N/A" end end addEventHandler("onPlayerJoin",getRootElement(),showcountry) and how can I place the Home column right next to name? Thank you.
  13. Oh okay. It works fine now, Thank you very much ^^
  14. Hello Community Today I downloaded bridge-toll from community. Its awesome, I installed into my server it worked well, But I got a problem when I hit any markers(modshops, carshops) while Im in car The Bridge-Toll Gui always shown. Help me here is the script -server side -- Settings local tollPrice = 150 -- Toll Price (Default: 150) local allowedTypes = { ["Automobile"]=true; ["Bike"]=true; ["Monster Truck"]=true; } -- Allowed vehicle types -- End of settings -- Barriers local tollbarrierLSLV = createObject (968, 1745.19, 509.79, 28.6, 0, 90, 340) -- gate LS > LV local tollbarrierLSLV2 = createObject (968, 1736.8, 513.2, 28.6, 0, 89, 338) -- gate LS > LV 2 local tollbarrierLVLS = createObject (968, 1723.5, 510.5, 28.9, 0, 270, 338) -- gate LV > LS local tollbarrierLVLS2 = createObject (968, 1731.9, 507.64, 28.9, 0, 271, 338) -- gate LV > LS 2 local tollbarrierLVSF = createObject (968, -1401.1, 826.2, 47.6, 0, 270, 318) -- gate LV > SF local tollbarrierLVSF2 = createObject (968, -1407.9, 832, 47.6, 0, 270, 316) -- gate LV > SF 2 local tollbarrierSFLV = createObject (968, -1395.1, 829.2, 47.6, 0, 90, 316) -- gate SF > LV local tollbarrierSFLV2 = createObject (968, -1389, 823.4, 47.6, 0, 90, 316) -- gate SF > LV 2 local tollbarrierTRSF = createObject (968, -2691.69, 1271.3, 55.5, 0, 270, 0) -- gate TR > SF local tollbarrierTRSF2 = createObject (968, -2683, 1271.19, 55.5, 0, 270, 0) -- gate TR > SF 2 local tollbarrierSFTR = createObject (968, -2671.2, 1277.7, 55.5, 0, 90, 0) -- gate SF > TR local tollbarrierSFTR2 = createObject (968, -2680.8, 1278.19, 55.5, 0, 90, 0) -- gate SF > TR 2 local tollbarrierLSSF = createObject (968, 51.7, -1528.1, 5.2, 0, 90, 85) -- gate LS > SF local tollbarrierSFLS = createObject (968, 53.7, -1535, 5.2, 0, 270, 85) -- gate SF > LS -- Blips local tollblip1 = createBlip (1736, 512, 28, 42) setBlipVisibleDistance (tollblip1, 250) local tollblip2 = createBlip (-1398, 828, 53, 42) setBlipVisibleDistance (tollblip2, 250) local tollblip3 = createBlip (-2676, 1278, 62, 42) setBlipVisibleDistance (tollblip3, 250) local tollblip4 = createBlip (52.7, -1531.6, 6, 42) setBlipVisibleDistance (tollblip4, 250) -- Markers local tollboothLSLV = createMarker (1746, 499, 27.5, "cylinder", 5, 0, 255, 0, 0) local tollboothLSLV2 = createMarker (1736.69, 503.2, 27.5, "cylinder", 5.0, 0, 255, 0, 0) local tollboothLVLS = createMarker (1725, 524, 27.5, "cylinder", 5, 0, 255, 0, 0) local tollboothLVLS2 = createMarker (1732.19, 518.2, 27.1, "cylinder", 5.0, 0, 255, 0, 0) local tollboothLVSF = createMarker (-1397, 836, 47, "cylinder", 5, 0, 0, 100, 0) local tollboothLVSF2 = createMarker (-1403.59, 839.79, 46, "cylinder", 4.0, 0, 255, 0, 0) local tollboothSFLV = createMarker (-1399, 820, 47, "cylinder", 5, 0, 255, 0, 0) local tollboothSFLV2 = createMarker (-1394.09, 813.7, 46, "cylinder", 4.0,255, 0, 0, 0) local tollboothTRSF = createMarker (-2696, 1283, 54, "cylinder", 5, 0, 255, 0, 0) local tollboothTRSF2 = createMarker (-2686.3, 1281.8, 54, "cylinder", 5, 0, 255, 0, 0) local tollboothSFTR = createMarker (-2667, 1268, 54, "cylinder", 5, 0, 255, 2, 0) local tollboothSFTR2 = createMarker (-2677, 1267.3, 54, "cylinder", 5, 0, 255, 0, 0) local tollboothLSSF = createMarker (57.59, -1525.3, 4, "cylinder", 5, 0, 255, 0, 0) local tollboothSFLS = createMarker (46.79, -1537.09, 4, "cylinder", 5, 0, 255, 0, 0) addEventHandler ("onMarkerHit", root, function (hitElement, dimension) if source == tollboothLSLV or tollboothLVLS or tollboothLVSF or tollboothSFLV or tollboothTRSF or tollboothSFTR or tollboothLSLV2 or tollboothLVLS2 or tollboothLVSF2 or tollboothSFLV2 or tollboothTRSF2 or tollboothSFTR2 or tollboothLSSF or tollboothSFLS and dimension then if getElementType (hitElement) == "player" and isPedInVehicle (hitElement) then local sourceVehicle = getPedOccupiedVehicle (hitElement) local controller = getVehicleController (sourceVehicle) local pAcc = getPlayerAccount (hitElement) if allowedTypes [getVehicleType (sourceVehicle)] then if isGuestAccount (pAcc) then if getPlayerMoney (hitElement) < tollPrice then outputChatBox ("[TOLL] You don't have enough money. (Toll Price: $"..tollPrice..")", controller, 255, 0, 0) else setElementVelocity (sourceVehicle, 0, 0, 0) triggerClientEvent (controller, "manageTollGUI", controller, 1, tollPrice, true) end elseif not isGuestAccount (pAcc) then if getAccountData (pAcc, "toll.impulses") and getAccountData (pAcc, "toll.impulses") > 0 then setAccountData (pAcc, "toll.impulses", getAccountData (pAcc, "toll.impulses") - 1) triggerEvent ("tollPaid", controller, true) outputChatBox ("[TOLL] Toll impulse used, left:#ffffff "..getAccountData (pAcc, "toll.impulses"), controller, 255, 120, 0, true) elseif not getAccountData (pAcc, "toll.impulses") or getAccountData (pAcc, "toll.impulses") == 0 then setElementVelocity (sourceVehicle, 0, 0, 0) triggerClientEvent (controller, "manageTollGUI", controller, 1, tollPrice) end end else outputChatBox ("[TOLL] This vehicle type is not allowed", controller, 255, 0, 0) end else return end end end ) addEventHandler ("onMarkerLeave", root, function (leaveElement) if source == tollboothLSLV or tollboothLVLS or tollboothLVSF or tollboothSFLV or tollboothTRSF or tollboothSFTR or tollboothLSLV2 or tollboothLVLS2 or tollboothLVSF2 or tollboothSFLV2 or tollboothTRSF2 or tollboothSFTR2 then if getElementType (leaveElement) == "player" and isPedInVehicle (leaveElement) then triggerClientEvent (leaveElement, "manageTollGUI", leaveElement, 2) end end end ) -Client side -- Settings local enableImpulses = true -- If set to false players will not be able to purchase impulses -- End of settings function centerTollGUI (theWindow) local screenW, screenH = guiGetScreenSize () local windowW, windowH = guiGetSize (theWindow,false) local x, y = (screenW - windowW) / 2, (screenH - windowH) / 2 guiSetPosition (theWindow, x, y, false) end -- Toll GUI local tollGUI = guiCreateWindow(0.37, 0.22, 0.34, 0.41,"Toll Booth",true) centerTollGUI (tollGUI) guiWindowSetMovable(tollGUI,false) guiWindowSetSizable(tollGUI,false) guiSetVisible (tollGUI, false) local tollIMG = guiCreateStaticImage(0.27, 0.07, 0.48, 0.47,"tollbooth.png",true,tollGUI) local tollinfo = guiCreateLabel(0.34, 0.58, 0.42, 0.04,"Toll Price: $",true,tollGUI) local tollinfoPrice = guiCreateLabel(0.53, 0.58, 0.42, 0.04,"",true,tollGUI) local tollPay = guiCreateButton(0.17, 0.66, 0.64, 0.14,"Pay Toll",true,tollGUI) local tollImpulses = guiCreateButton(0.17, 0.82, 0.64, 0.14,"Purchase Impulses",true,tollGUI) local tollClose = guiCreateButton(0.88, 0.08, 0.09, 0.09,"X",true,tollGUI)
  15. Still not working same problem, now the pack is available, but I type /maze the chatbox says its not available, Thanks anyway
  16. Hello MTA Im here to ask some help with my script. Okay, let me explain what the problem is, the problem is when I type /maze after the pack generated, ChatBox will say that the Maze is available because the pack is generated, but after I take the pack, It will be destroyed. I type /maze again and ChatBox says The same msg that Maze is available. the chatbox should say that There's no pack atm. function createBag() local random = math.random ( #mbag ) local x, y, z = mbag[random][1], mbag[random][2], mbag[random][3] bag = createPickup( x, y, z, 3, 1274 ) setElementCollisionsEnabled( bag, false ) outputChatBox( "A Maze-pack is available!, Search it! at Maze ", root, 101, 250, 0 ) end addEventHandler("onResourceStart", resourceRoot,createBag) addEventHandler("onPickupHit",root, function ( player ) if ( source ~= bag ) then return end if ( isPedInVehicle( player ) ) then return end destroyElement( bag ) destroyElement( bl ) randomMoney = math.random ( 3000, 5000 ) randomArmor = math.random( 10, 20 ) name = getPlayerName(player) givePlayerMoney(player,randomMoney) setPedArmor ( player, getPedArmor(player) + randomArmor ) outputChatBox(name.." found the packs, got $" .. tostring(randomMoney) .." and ".. tostring(randomArmor) .."% Armor", root, 101, 250, 0) outputChatBox("New Maze-pack will be available after 10 mins", root, 200, 250, 0) setTimer( createBag, 240000, 1 ) end) ---------here's the problem ------------ function mazeCommand(player, maze) if createBag then outputChatBox("*Maze is availabe now!",player,255,255,0) elseif not createBag then outputChatBox("There's no package available now!",player,50,255,25) end end addCommandHandler("maze", mazeCommand) That's it, I hope you get my point. sorry for my bad english
×
×
  • Create New...