Jump to content

top sniper

Members
  • Posts

    262
  • Joined

  • Last visited

Everything posted by top sniper

  1. with this all Weapons will disable
  2. hi i have a problem with getguitxt server: addEvent("block1",true) addEventHandler("block1",root, function() if currentWeaponID == (txt) then - toggleControl ( source, "fire", false ) end end ) Client: addEventHandler ("onClientGUIClick", getRootElement(), function(button, state, absoluteX, absoluteY) if source == block then local text = guiGetText ( idbl ) triggerServerEvent("block1",localPlayer) end end )
  3. thanks to all for helping
  4. hi .. there is a problem with share money code .. the problem is some players take money from anther players by sending to them -(amount) this is the code addEvent("sendMoney", true) addEventHandler("sendMoney", getRootElement(), function ( playerNick, amount ) local cash = getPlayerMoney(source) if (cash > tonumber">tonumber(amount)) then toWho = getPlayerFromName(playerNick) if (toWho ~= false) then givePlayerMoney(toWho,amount) name = getPlayerName(source) takePlayerMoney(source,amount) outputChatBox("You've given money amount of: " .. amount .. "$ to: " .. playerNick,source,255,255,150) outputChatBox(name .. " has given you money amount of: " .. amount .. "$!",toWho,255,255,245) else outputChatBox("Player did not exist",source,255,0,0) end else outputChatBox("Insufficient founds!",source,255,0,0) end end)
  5. the problem was i should change true to false to set it on !!
  6. triggerServerEvent("spawn1",localPlayer)
  7. i foreget cancelEvent() thank you sniper it work no problem
  8. I did not understand what you mean
  9. use this function chatbox(text, msgtype) local account = getAccountName(getPlayerAccount(source)) local name = getPlayerName(source) cancelEvent()
  10. addEvent("spawn1",true) addEventHandler("spawn1",root, function() spawnPlayer ( source, 252, 1861, 9, 1, 0, 0, t) local redteam = getTeamFromName ( "F.B.I" ) if ( redteam ) then -- If it was found (not false) setPlayerTeam ( source, redteam ) setElementHealth ( source, 100 ) setPedArmor ( source, 20 ) giveWeapon ( source , 31,600 ) giveWeapon ( source , 25,500 ) giveWeapon ( source , 46 ) giveWeapon ( source , 16,5 ) setTeamFriendlyFire ( redteam, true ) end end ) even this not working
  11. i toke this code from mtasa wiki function setFriendlyFireOn ( ) -- For each team, for index, theTeam in ipairs">ipairs ( getElementsByType("team") ) do -- if friendly fire is off, if ( getTeamFriendlyFire ( theTeam ) == false ) then -- switch it on. setTeamFriendlyFire ( theTeam, true ) end end end -- Add console command 'setFF' addCommandHandler ( "setFF", setFriendlyFireOn ) but it didn't work
  12. i toke this code from mtasa wiki function setFriendlyFireOn ( ) -- For each team, for index, theTeam in ipairs ( getElementsByType("team") ) do -- if friendly fire is off, if ( getTeamFriendlyFire ( theTeam ) == false ) then -- switch it on. setTeamFriendlyFire ( theTeam, true ) end end end -- Add console command 'setFF' addCommandHandler ( "setFF", setFriendlyFireOn ) but it didn't work
  13. now it works thanks for helping me
  14. I did not get any error .. and no error with meta . and this is the full code root = getRootElement() localPlayer = getLocalPlayer() myBlip = createBlip ( 131, 69, 2,6 ) shopWindow = guiCreateWindow(170,50,530,510,"shop panel by MOJRM-511 edited bt TopSniper ",false) guiSetVisible (shopWindow, false) guiWindowSetSizable(shopWindow,false) guiWindowSetMovable(shopWindow,true) tabPanel = guiCreateTabPanel(11,23,599,499,false,shopWindow) addEvent ( 'onMarker1Hit', true ) addEventHandler ( 'onMarker1Hit', root, function ( ) guiSetVisible (shopWindow, true) end ) ------------------------------------------------------------------------------------------------------- tab2 = guiCreateTab("buy weapons",tabPanel) --------- ????? 1 -line 1 ------------------------------------------------------------------------------------ guiCreateStaticImage( 10,10,90,75, "weapon/24.png", false,tab2 ) weapButton_1 = guiCreateButton(10,80,90,30,"$150 deagle",false,tab2) guiCreateStaticImage( 110,10,90,75, "weapon/31.png", false,tab2 ) weapButton_2 = guiCreateButton(110,80,90,30,"$250 M4",false,tab2) --------------------------------- guiCreateStaticImage( 210,10,90,75, "weapon/16.png", false,tab2 ) weapButton_3 = guiCreateButton(210,80,90,30,"$1500 Grenade ",false,tab2) --------------------------------- guiCreateStaticImage( 310,10,90,75, "weapon/30.png", false,tab2 ) weapButton_4 = guiCreateButton(310,80,90,30,"$200 AK-47",false,tab2) -------------------------------- guiCreateStaticImage( 410,10,90,75, "weapon/29.png", false,tab2 ) weapButton_5 = guiCreateButton(410,80,90,30,"$150 mp5",false,tab2) -------------------------2 ?????----------------------------------------------------------------------------------------------------------- guiCreateStaticImage( 10,110,90,80, "weapon/32.png", false,tab2 ) weapButton_6 = guiCreateButton(10,190,90,30,"$450 TEC-9",false,tab2 ) guiCreateStaticImage( 110,110,90,80, "weapon/34.png", false,tab2 ) weapButton_7 = guiCreateButton(110,190,90,30,"$250 Sniper",false,tab2) guiCreateStaticImage( 210,110,90,80, "weapon/28.png", false,tab2 ) weapButton_8 = guiCreateButton(210,190,90,30,"$400 Uzi",false,tab2) guiCreateStaticImage( 310,110,90,80, "weapon/46.png", false,tab2 ) weapButton_9 = guiCreateButton(310,190,90,30,"$250 Parachute ",false,tab2) guiCreateStaticImage( 410,110,90,80, "weapon/25.png", false,tab2 ) weapButton_10 = guiCreateButton(410,190,90,30,"$200 ShotGun",false,tab2) -------------------------------------------------------------------------- line 3 guiCreateStaticImage( 10,220,90,80, "weapon/26.png", false,tab2 ) weapButton_11 = guiCreateButton(10,300,90,30,"$700 Sawn-Off",false,tab2 ) guiCreateStaticImage( 110,220,90,80, "weapon/27.png", false,tab2 ) weapButton_12 = guiCreateButton(110,300,90,30,"$650 Combat",false,tab2 ) guiCreateStaticImage( 210,220,90,80, "weapon/4.png", false,tab2 ) weapButton_13 = guiCreateButton(210,300,90,30,"$500 Knif",false,tab2 ) guiCreateStaticImage( 310,220,90,80, "weapon/22.png", false,tab2 ) weapButton_14 = guiCreateButton(310,300,90,30,"$200 Pistol",false,tab2 ) guiCreateStaticImage( 410,220,90,80, "weapon/9.png", false,tab2 ) weapButton_15 = guiCreateButton(410,300,90,30,"$400 Chainsaw",false,tab2 ) --------------------------------------------------------------------------------------line 4 guiCreateStaticImage( 10,330,90,80, "weapon/17.png", false,tab2 ) weapButton_16 = guiCreateButton(10,410,90,30,"$1200 Tear Gas",false,tab2 ) guiCreateStaticImage( 110,330,90,80, "weapon/42.png", false,tab2 ) weapButton_17 = guiCreateButton(110,410,90,30,"$400 Fire Extinguisher",false,tab2 ) guiCreateStaticImage( 210,330,90,80, "weapon/23.png", false,tab2 ) weapButton_18 = guiCreateButton(210,410,90,30,"$100 Silenced Pistol",false,tab2 ) guiCreateStaticImage( 310,330,90,80, "weapon/39.png", false,tab2 ) weapButton_19 = guiCreateButton(310,410,90,30,"$1800 Satchel Charges",false,tab2 ) guiCreateStaticImage( 410,330,90,80, "weapon/38.png", false,tab2 ) weapButton_20 = guiCreateButton(410,410,90,30,"$3000 minigun",false,tab2 ) --------------------------------------الشوب-------------------------------------------------3tab tab3 = guiCreateTab("shop",tabPanel) --------------------------------------------------------------------------------------------------------- -------------------------------- ----------------------------------------------------------------------------------------------------------- bindKey ( "F2" , "down" , function() if ( guiGetVisible ( shopWindow ) == true ) then guiSetVisible ( shopWindow ,false ) showCursor (false ) guiSetInputEnabled(false) elseif ( guiGetVisible ( shopWindow ) == false ) then guiSetVisible ( shopWindow ,true ) showCursor (false ) guiSetInputEnabled(true) playSound("MOJRM-511.mp3") end end ) ------------------------------------------------------------------------------------------------------ -------------------------------------------------------------------بدايه ربط الازرار بالسيرفر server---------- addEventHandler ("onClientGUIClick", getRootElement(), function(button, state, absoluteX, absoluteY) if ( source == weapButton_1 ) then triggerServerEvent("gived",getLocalPlayer()) end end ) addEventHandler ("onClientGUIClick", getRootElement(), function(button, state, absoluteX, absoluteY) if ( source == weapButton_2 ) then triggerServerEvent("givem4",getLocalPlayer()) end end ) addEventHandler ("onClientGUIClick", getRootElement(), function(button, state, absoluteX, absoluteY) if ( source == weapButton_3 ) then triggerServerEvent("givegrn",getLocalPlayer()) end end ) addEventHandler ("onClientGUIClick", getRootElement(), function(button, state, absoluteX, absoluteY) if ( source == weapButton_4 ) then triggerServerEvent("givemk",getLocalPlayer()) end end ) addEventHandler ("onClientGUIClick", getRootElement(), function(button, state, absoluteX, absoluteY) if ( source == weapButton_5 ) then triggerServerEvent("givemp5",getLocalPlayer()) end end ) addEventHandler ("onClientGUIClick", getRootElement(), function(button, state, absoluteX, absoluteY) if ( source == weapButton_6 ) then triggerServerEvent("TEC-9",getLocalPlayer()) end end )
  15. i have a problem with onhitmarker function server side : marker1 = createMarker ( 131, 68, 2 ) addEventHandler("onMarkerHit",root, function () if ( source == marker1 ) then triggerClientEvent("marker11",getRootElement()) end end ) client side : addEvent("marker11",true) addEventHandler("marker11",getLocalPlayer, function() guiSetVisible (shopWindow, true) end )
  16. but when the time ended the game speed still 0
  17. thanks it works fine now
  18. top sniper

    fix . .

    What's the problem with this code local frozeTime = 60 -- Seconds as frozen local timeLeft = {} local timeLeftText = {} addEvent("Froze", true) addEventHandler("Froze", root, function() if getPlayerMoney(source) >= 7500 then local players = getElementsByType("player") takePlayerMoney(source, 7500) outputChatBox("All players successfully frozen", source, 255, 255, 0, true) for theKey,thePlayer in ipairs(players) do if (thePlayer ~= source) then setElementFrozen(thePlayer, true) setGameSpeed(0) setElementData(thePlayer, "Timeleft", tonumber(frozeTime)) showTimeLeft(thePlayer) end end else outputChatBox("Not enough money.", source, 255, 0, 0, true) end end) function showTimeLeft(player) timeLeft[player] = textCreateDisplay() textDisplayAddObserver(timeLeft[player], player) timeLeftText[player] = textCreateTextItem("Time left: " .. getElementData(player, "Timeleft"), 0.45, 0.1, "high", 255, 255, 255, 255) textDisplayAddText(timeLeft[player], timeLeftText[player]) setTimer(updateTimeLeft, 1000, getElementData(player, "Timeleft"), player) end function updateTimeLeft(player) setElementData(player, "Timeleft", getElementData(player, "Timeleft") - 1) textItemSetText(timeLeftText[player], "Time left: " .. getElementData(player, "Timeleft")) if tonumber(getElementData(player, "Timeleft")) == 0 then textDestroyDisplay(timeLeft[player]) setElementFrozen(player, false) end end it Was working fine before it would add setGameSpeed(0) Everyone is now frozen even who buy the freeze and when the time runs out the set game speed event still working .. and sorry for my bad english
  19. if you pay from jihost your server Will work after 29 days of your purchase it
  20. My brother bought 26-player mta server and the server is not working also the ftp is not working fix the problem plz
  21. addEvent("GUIEditor_Button[1]",true) addEventHandler("GUIEditor_Button[1]",root, function() local PlayerMoney = getPlayerMoney(source) if ( PlayerMoney >= 0) then elseif isObjectInACLGroup ( "user." .. accountname, aclGetGroup ( "Admin" )) then takePlayerMoney(source,0) setGameSpeed(tonumber(10 )) local name = getPlayerName(source) outputChatBox ( "#FFCC00[" ..name .. "]:#FF0000 Has killing by {shop}", getRootElement(), 255, 0, 0, true ) else outputChatBox("ERRoR Shop!", source, 255, 0, 0, true) end end ) it works fine before i add aclGetGroup code ..
  22. thanks for helping me i will try it now
×
×
  • Create New...