Jump to content

TAPL

Retired Staff
  • Posts

    7,337
  • Joined

  • Days Won

    11

Everything posted by TAPL

  1. this really easy Edit: i change the code, copy it again lp = getLocalPlayer() rRoot = getResourceRootElement(getThisResource()) addEventHandler("onClientResourceStart",rRoot,function() triggerServerEvent("getData",lp,lp) end ) addEvent("sendData",true) addEventHandler("sendData",root,function(small,med,misc) if small and med and misc then smallGuns = small mediumGuns = med miscGuns = misc WCW = guiCreateWindow(367,244,570,233,"Please Choose Weapon",false) guiSetVisible (WCW, false) guiWindowSetSizable(WCW,false) guiWindowSetMovable(WCW,false) local screenW,screenH=guiGetScreenSize() local windowW,windowH=guiGetSize(WCW,false) local x,y = (screenW-windowW)/2,(screenH-windowH)/2 guiSetPosition(WCW,x,y,false) ButOK = guiCreateButton(18,207,256,19,"OK",false,WCW) ButC = guiCreateButton(290,207,256,19,"Cancel",false,WCW) checkBox = guiCreateCheckBox(20,30,150,20,"Show This Menu again?",true,false,WCW) guiBringToFront(ButC) guiBringToFront(ButOK) function checkboxClick() if (guiCheckBoxGetSelected(checkBox) ) then setElementData(localPlayer,"ShowGun",false) else setElementData(localPlayer,"ShowGun",true) end end addEventHandler("onClientGUIClick", checkBox, checkboxClick, false) function GiveWeapon() triggerServerEvent("TakeAll",lp,lp) wep = guiGridListGetItemText (WCSmallGuns, guiGridListGetSelectedItem (WCSmallGuns), 1) ammo = guiGridListGetItemText (WCSmallGuns, guiGridListGetSelectedItem (WCSmallGuns), 2) if wep and ammo then triggerServerEvent("GiveGun",lp,lp,getWeaponIDFromName(wep),ammo) end wep = guiGridListGetItemText (WCMGuns, guiGridListGetSelectedItem (WCMGuns), 1) ammo = guiGridListGetItemText (WCMGuns, guiGridListGetSelectedItem (WCMGuns), 2) if wep and ammo then triggerServerEvent("GiveGun",lp,lp,getWeaponIDFromName(wep),ammo) end wep = guiGridListGetItemText (WCMiscGuns, guiGridListGetSelectedItem (WCMiscGuns), 1) ammo = guiGridListGetItemText (WCMiscGuns, guiGridListGetSelectedItem (WCMiscGuns), 2) if wep and ammo then triggerServerEvent("GiveGun",lp,lp,getWeaponIDFromName(wep),ammo) end end addEvent("GiveGunMenu",true) addEventHandler("GiveGunMenu",root,GiveWeapon) WCSmallGuns = guiCreateGridList(18,54,169,148,false,WCW) guiGridListSetSelectionMode(WCSmallGuns,0) local columnSG = guiGridListAddColumn( WCSmallGuns, "Small Guns", 0.55 ) local ammoSG = guiGridListAddColumn( WCSmallGuns, "Ammo", 0.20 ) if ( columnSG ) then for k,v in ipairs (smallGuns) do local jSG = guiGridListAddRow ( WCSmallGuns ) guiGridListSetItemText ( WCSmallGuns, jSG, columnSG,getWeaponNameFromID(v[1]), false, false ) guiGridListSetItemText ( WCSmallGuns, jSG, ammoSG,v[2], false, true ) end end WCMGuns = guiCreateGridList(198,53,169,148,false,WCW) guiGridListSetSelectionMode(WCMGuns,0) local columnMG = guiGridListAddColumn( WCMGuns, "Medium Guns", 0.55 ) local ammoMG = guiGridListAddColumn( WCMGuns, "Ammo", 0.20 ) if ( columnMG ) then for k,v in ipairs (mediumGuns) do local jSG = guiGridListAddRow ( WCMGuns ) guiGridListSetItemText ( WCMGuns, jSG, columnMG,getWeaponNameFromID(v[1]), false, false ) guiGridListSetItemText ( WCMGuns, jSG, ammoMG,v[2], false, true ) end end WCMiscGuns = guiCreateGridList(378,52,169,148,false,WCW) guiGridListSetSelectionMode(WCMiscGuns,0) local columnMSG = guiGridListAddColumn( WCMiscGuns, "Misc. Guns", 0.55 ) local ammoMSG = guiGridListAddColumn( WCMiscGuns, "Ammo", 0.20 ) if ( columnMSG ) then for k,v in ipairs (miscGuns) do local jSG = guiGridListAddRow ( WCMiscGuns ) guiGridListSetItemText ( WCMiscGuns, jSG, columnMSG,getWeaponNameFromID(v[1]), false, false ) guiGridListSetItemText ( WCMiscGuns, jSG, ammoMSG,v[2], false, true ) end end function ShowWC() getVisible = guiGetVisible (WCW) if (getVisible == true) then guiSetVisible (WCW , false) guiSetVisible (ButOK , false) guiSetVisible (ButC , false) showCursor (false) end if (getVisible == false) then guiSetVisible (WCW , true) guiSetVisible (ButOK , true) guiSetVisible (ButC , true) showCursor (true) end end addEvent("ShowWC",true) addEventHandler("ShowWC",root,ShowWC) function onClick (button, state, absoluteX, absoluteY) if ( source == ButOK ) then triggerServerEvent("TakeAll",lp,lp) wep = guiGridListGetItemText (WCSmallGuns, guiGridListGetSelectedItem (WCSmallGuns), 1) ammo = guiGridListGetItemText (WCSmallGuns, guiGridListGetSelectedItem (WCSmallGuns), 2) if wep and ammo then triggerServerEvent("GiveGun",lp,lp,getWeaponIDFromName(wep),ammo) end wep = guiGridListGetItemText (WCMGuns, guiGridListGetSelectedItem (WCMGuns), 1) ammo = guiGridListGetItemText (WCMGuns, guiGridListGetSelectedItem (WCMGuns), 2) if wep and ammo then triggerServerEvent("GiveGun",lp,lp,getWeaponIDFromName(wep),ammo) end wep = guiGridListGetItemText (WCMiscGuns, guiGridListGetSelectedItem (WCMiscGuns), 1) ammo = guiGridListGetItemText (WCMiscGuns, guiGridListGetSelectedItem (WCMiscGuns), 2) if wep and ammo then triggerServerEvent("GiveGun",lp,lp,getWeaponIDFromName(wep),ammo) end ShowWC() elseif ( source == ButC ) then ShowWC() end end addEventHandler ("onClientGUIClick", getRootElement(), onClick) end end ) function getData(to) local file = xmlLoadFile("data.xml") small = {} med = {} misc = {} if file then for k,v in ipairs (xmlNodeGetChildren(xmlFindChild(file,"SmallGuns",0)))do local id = xmlNodeGetAttribute(v,"id") local ammo = xmlNodeGetAttribute(v,"ammo") table.insert(small, {id,ammo}) end for k,v in ipairs (xmlNodeGetChildren(xmlFindChild(file,"MediumGuns",0)))do local id = xmlNodeGetAttribute(v,"id") local ammo = xmlNodeGetAttribute(v,"ammo") table.insert(med, {id,ammo}) end for k,v in ipairs (xmlNodeGetChildren(xmlFindChild(file,"MiscGuns",0)))do local id = xmlNodeGetAttribute(v,"id") local ammo = xmlNodeGetAttribute(v,"ammo") table.insert(misc, {id,ammo}) end end triggerClientEvent(to,"sendData",to,small,med,misc) end addEvent("getData",true) addEventHandler("getData",root,getData) function TakeAll( Player ) takeAllWeapons(Player) end addEvent("TakeAll",true) addEventHandler("TakeAll",getRootElement(),TakeAll) function GiveGun( Player , Gun , Ammo ) if Gun and Ammo then giveWeapon(Player, Gun,Ammo) setPedWeaponSlot(Player, getSlotFromWeapon(Gun)) end end addEvent("GiveGun",true) addEventHandler("GiveGun",getRootElement(),GiveGun) function ShowWC(Player) triggerClientEvent(Player,"ShowWC",Player) end addEventHandler("onPlayerSpawn",root,function() if not getElementData(source,"ShowGun") then ShowWC(source) else triggerClientEvent(source,"GiveGunMenu",source) end addCommandHandler("gun",function(plr) ShowWC(plr) end ) setTimer(removeCommandHandler,1 * 60 * 1000 ,1, "gun") end)
  2. lp = getLocalPlayer() rRoot = getResourceRootElement(getThisResource()) addEventHandler("onClientResourceStart",rRoot,function() triggerServerEvent("getData",lp,lp) end ) addEvent("sendData",true) addEventHandler("sendData",root,function(small,med,misc) if small and med and misc then smallGuns = small mediumGuns = med miscGuns = misc WCW = guiCreateWindow(367,244,570,233,"Please Choose Weapon",false) guiSetVisible (WCW, false) guiWindowSetSizable(WCW,false) guiWindowSetMovable(WCW,false) local screenW,screenH=guiGetScreenSize() local windowW,windowH=guiGetSize(WCW,false) local x,y = (screenW-windowW)/2,(screenH-windowH)/2 guiSetPosition(WCW,x,y,false) ButOK = guiCreateButton(18,207,256,19,"OK",false,WCW) ButC = guiCreateButton(290,207,256,19,"Cancel",false,WCW) checkBox = guiCreateCheckBox(20,30,150,20,"Show This Menu again?",true,false,WCW) guiBringToFront(ButC) guiBringToFront(ButOK) function checkboxClick() if (guiCheckBoxGetSelected(checkBox) ) then setElementData(localPlayer,"ShowGun",false) else setElementData(localPlayer,"ShowGun",true) end end addEventHandler("onClientGUIClick", checkBox, checkboxClick, false) WCSmallGuns = guiCreateGridList(18,54,169,148,false,WCW) guiGridListSetSelectionMode(WCSmallGuns,0) local columnSG = guiGridListAddColumn( WCSmallGuns, "Small Guns", 0.55 ) local ammoSG = guiGridListAddColumn( WCSmallGuns, "Ammo", 0.20 ) if ( columnSG ) then for k,v in ipairs (smallGuns) do local jSG = guiGridListAddRow ( WCSmallGuns ) guiGridListSetItemText ( WCSmallGuns, jSG, columnSG,getWeaponNameFromID(v[1]), false, false ) guiGridListSetItemText ( WCSmallGuns, jSG, ammoSG,v[2], false, true ) end end WCMGuns = guiCreateGridList(198,53,169,148,false,WCW) guiGridListSetSelectionMode(WCMGuns,0) local columnMG = guiGridListAddColumn( WCMGuns, "Medium Guns", 0.55 ) local ammoMG = guiGridListAddColumn( WCMGuns, "Ammo", 0.20 ) if ( columnMG ) then for k,v in ipairs (mediumGuns) do local jSG = guiGridListAddRow ( WCMGuns ) guiGridListSetItemText ( WCMGuns, jSG, columnMG,getWeaponNameFromID(v[1]), false, false ) guiGridListSetItemText ( WCMGuns, jSG, ammoMG,v[2], false, true ) end end WCMiscGuns = guiCreateGridList(378,52,169,148,false,WCW) guiGridListSetSelectionMode(WCMiscGuns,0) local columnMSG = guiGridListAddColumn( WCMiscGuns, "Misc. Guns", 0.55 ) local ammoMSG = guiGridListAddColumn( WCMiscGuns, "Ammo", 0.20 ) if ( columnMSG ) then for k,v in ipairs (miscGuns) do local jSG = guiGridListAddRow ( WCMiscGuns ) guiGridListSetItemText ( WCMiscGuns, jSG, columnMSG,getWeaponNameFromID(v[1]), false, false ) guiGridListSetItemText ( WCMiscGuns, jSG, ammoMSG,v[2], false, true ) end end function ShowWC() getVisible = guiGetVisible (WCW) if (getVisible == true) then guiSetVisible (WCW , false) guiSetVisible (ButOK , false) guiSetVisible (ButC , false) showCursor (false) end if (getVisible == false) then guiSetVisible (WCW , true) guiSetVisible (ButOK , true) guiSetVisible (ButC , true) showCursor (true) end end addEvent("ShowWC",true) addEventHandler("ShowWC",root,ShowWC) function onClick (button, state, absoluteX, absoluteY) if ( source == ButOK ) then triggerServerEvent("TakeAll",lp,lp) wep = guiGridListGetItemText (WCSmallGuns, guiGridListGetSelectedItem (WCSmallGuns), 1) ammo = guiGridListGetItemText (WCSmallGuns, guiGridListGetSelectedItem (WCSmallGuns), 2) if wep and ammo then triggerServerEvent("GiveGun",lp,lp,getWeaponIDFromName(wep),ammo) end wep = guiGridListGetItemText (WCMGuns, guiGridListGetSelectedItem (WCMGuns), 1) ammo = guiGridListGetItemText (WCMGuns, guiGridListGetSelectedItem (WCMGuns), 2) if wep and ammo then triggerServerEvent("GiveGun",lp,lp,getWeaponIDFromName(wep),ammo) end wep = guiGridListGetItemText (WCMiscGuns, guiGridListGetSelectedItem (WCMiscGuns), 1) ammo = guiGridListGetItemText (WCMiscGuns, guiGridListGetSelectedItem (WCMiscGuns), 2) if wep and ammo then triggerServerEvent("GiveGun",lp,lp,getWeaponIDFromName(wep),ammo) end ShowWC() elseif ( source == ButC ) then ShowWC() end end addEventHandler ("onClientGUIClick", getRootElement(), onClick) end end ) function getData(to) local file = xmlLoadFile("data.xml") small = {} med = {} misc = {} if file then for k,v in ipairs (xmlNodeGetChildren(xmlFindChild(file,"SmallGuns",0)))do local id = xmlNodeGetAttribute(v,"id") local ammo = xmlNodeGetAttribute(v,"ammo") table.insert(small, {id,ammo}) end for k,v in ipairs (xmlNodeGetChildren(xmlFindChild(file,"MediumGuns",0)))do local id = xmlNodeGetAttribute(v,"id") local ammo = xmlNodeGetAttribute(v,"ammo") table.insert(med, {id,ammo}) end for k,v in ipairs (xmlNodeGetChildren(xmlFindChild(file,"MiscGuns",0)))do local id = xmlNodeGetAttribute(v,"id") local ammo = xmlNodeGetAttribute(v,"ammo") table.insert(misc, {id,ammo}) end end triggerClientEvent(to,"sendData",to,small,med,misc) end addEvent("getData",true) addEventHandler("getData",root,getData) function TakeAll( Player ) takeAllWeapons(Player) end addEvent("TakeAll",true) addEventHandler("TakeAll",getRootElement(),TakeAll) function GiveGun( Player , Gun , Ammo ) if Gun and Ammo then giveWeapon(Player, Gun,Ammo) setPedWeaponSlot(Player, getSlotFromWeapon(Gun)) end end addEvent("GiveGun",true) addEventHandler("GiveGun",getRootElement(),GiveGun) function ShowWC(Player) triggerClientEvent(Player,"ShowWC",Player) end addEventHandler("onPlayerSpawn",root,function() if not getElementData(source,"ShowGun") then ShowWC(source) end addCommandHandler("gun",function(plr) ShowWC(plr) end ) setTimer(removeCommandHandler,1 * 60 * 1000 ,1, "gun") end)
  3. You can find a Game Control Panel Here: http://www.webhostingtalk.com/showthread.php?t=1043075
  4. -- open the window function openJobWindow() if not guiGetVisible(jobWindow) then guiSetVisible(jobWindow, true) showCursor(true) end end addCommandHandler("me",openJobWindow) -- hide the window function hideJobWindow() if guiGetVisible(jobWindow) then guiSetVisible(jobWindow, false) showCursor(false) end end then we create the marker local myMarker = createMarker(-2596.625, 579.358, 15.626, 'cylinder', 2.0, 255, 0, 0, 150) function MarkerHit(hitElement) if getElementType(hitElement) == "player" then openJobWindow() end end addEventHandler("onClientMarkerHit", myMarker, MarkerHit) function markerLeave(leaveElement) if getElementType(leaveElement) == "player" then hideJobWindow() end end addEventHandler("onClientMarkerLeave", myMarker, markerLeave)
  5. TAPL

    local gui = {};

    doesn't matter if it was not inside any function but if it was inside function and you want use it from another function you will have to make it global
  6. TAPL

    problem

    addEventHandler("onResourceStart",resourceRoot, function() resetSkyGradient() end)
  7. --create the table in the gridlist local column = guiGridListAddColumn(gui['list'],'Playlist',0.9); guiGridListClear(gui['list']); for name, url in pairs(musicTable) do local row = guiGridListAddRow(gui['list']); guiGridListSetItemText(gui['list'],row,column,tostring(name),false,false); end;
  8. https://wiki.multitheftauto.com/wiki/Res ... ing_Editor
  9. function kickPlayerHandler (player,cmd,kickedname) if (kickedname) then local kicked = getPlayerFromName(kickedname) if (kicked) then kickPlayer(kicked) else outputChatBox("Error.: Player name not exist",player) end else outputChatBox("Error.: /kick ",player) end end addCommandHandler("kick",kickPlayerHandler)
  10. oh, really? can you stop these servers? http://www.game-monitor.com/search.php? ... 8.77.98.96 anyway, how we can believe you? post some screenshot
  11. i know it was fixed already. you say ('the code was fixed') then why you post this Oo just read this (Red Note) https://wiki.multitheftauto.com/wiki/SetPedFrozen
  12. are you have ssh root access? you don't know what is ssh, i think you should search on googel to execute .so files you must have ssh access
  13. @Klesh, what you did is wrong. @Sparrow, setPedFrozen is deprecated so use this setElementFrozen instead.
  14. how? please help me thank you Is this very difficult to understand? or you just waiting for ready code? lazy people!
  15. dont be stupid it is unlimited web hosting and i have all that support php and ssl and ssh and perl and all scripts but the problem how i run the server of mta i mean .so files and other i hope you understand me and dont thing me stupid dude you can't host mta server with web hosting, also how you have *unlimited web hosting* and your web site on free host
  16. TAPL

    onPlayerWasted

    addEventHandler("onClientPlayerWasted", localPlayer, function() guiSetVisible(menu,true) showCursor(true) end)
  17. TAPL

    scoreboard

    function createthedamnteams() team1 = createTeam("Members",0,255,0) team2 = createTeam("Moderators",255,255,0) team3 = createTeam("Admins",0,0,255) team4 = createTeam("VIP",139,0,139) end addEventHandler("onResourceStart", resourceRoot, createthedamnteams)
  18. are you using killmessages export ? i remember that is possible to set the space (width) between the name and the weapon image Example exports.killmessages:outputMessage ({"Player1",{"padding",width=5},{"icon",id=31},{"padding",width=5},{"color",r=255,g=255,b=10},"Player2" },root,255,0,0)
  19. 1- did you give the resource admin right? 2- where the server side?
  20. Instead of waiting someone for give you a ready code, keep trying to make the code working by yourself.
  21. did you have a VPS server or Dedicated server?
  22. it's not just about this script, it's when ever i make any new script in my server i can see some people asking for help here to make like what i do. examples: 1-i make a script vote maps for BaseMode from two years ago, i saw someone here asking help to make it 2-i make script anti vote flood for BaseMode and than someone has uploaded one like what i make in community 3-i make script GhostMode for BaseMode, and too i see them on community 4- i make shop in my server for BaseMode, i saw here 1594156741567 one asking for help to make like what i do(with stolen image from my shop) and many others scripts ..
  23. lol why everyone want make like what i making in my server
  24. TAPL

    staff

    function getPlayerFromNamePart(Name) if not (Name) then return end for i,player in ipairs (getElementsByType ("player")) do if (string.find(getPlayerName(player):lower(),Name:lower())) then return player end end end function Jail (player, command, name) if isStaff(player) then local thePlayer = getPlayerFromNamePart(name) if not thePlayer then outputChatBox("This Player Name is not exist!",player,255,0,0) return end if getElementData( thePlayer, "isJailed") then outputChatBox("This player is already in jail.",player,255,0,0) return end setElementData(thePlayer, "jailSkin", getElementModel ( thePlayer )) setElementModel ( thePlayer, 22 ) setElementPosition ( thePlayer, 52, 2483, 21 ) takeAllWeapons ( getRootElement() ) setElementData ( thePlayer, "isJailed", true ) outputChatBox (getPlayerName(thePlayer).." has been jailed", getRootElement(), 255, 0, 0, true ) else outputChatBox ("You cannot use this command!", player, 255, 0, 0, true ) end end addCommandHandler("jail",Jail) function Unjail (player, command, name) if isStaff(player) then local thePlayer = getPlayerFromNamePart(name) if not thePlayer then outputChatBox("This Player Name is not exist!",player,255,0,0) return end if not getElementData( thePlayer, "isJailed") then outputChatBox("This player is not in jail.",player,255,0,0) return end setElementPosition ( thePlayer, 72, 2484, 16.3 ) setElementModel ( thePlayer, tonumber(getElementData(thePlayer,"jailSkin"))) setElementData ( thePlayer, "isJailed", false ) outputChatBox (getPlayerName(thePlayer).." has been unjailed. Be good now, "..getPlayerName(thePlayer), getRootElement(), 0, 255, 0, true ) else outputChatBox ("You cannot use this command!", player, 255, 0, 0, true ) end end addCommandHandler("unjail",Unjail) ped1inside = createPed ( 71, 69, 2503, 17) setPedRotation (ped1inside, 180) function respawn() local x,y,z = getElementPosition(source) local rx,ry,rz = getElementRotation(source) setTimer(createPed, 60000, 1, 71, x,y,z,rz) if isElement(ped1inside) then destroyElement(ped1inside) end end addEventHandler("onPedWasted",ped1inside,respawn) function visit (player) setElementPosition (player, 71, 2499, 17 ) end addCommandHandler("visitjail", visit) function isStaff(player) for index, group in ipairs({"Admin", "SuperModerator", "Moderator"}) do if isObjectInACLGroup ( "user."..getAccountName(getPlayerAccount(player)), aclGetGroup ( group ) ) then return true end end end
  25. seems like votemanager aren't running, make sure votemanager is running.
×
×
  • Create New...