Jump to content

TwiX!

Members
  • Posts

    905
  • Joined

  • Last visited

Everything posted by TwiX!

  1. 1)not want copy ffs userpanel 2)Maybe will be add
  2. TwiX!

    need sum help

    function LoggedIn(thePlayer) spawnPlayer(thePlayer, 2505.52, -1741.73, 2072.98) fadeCamera(thePlayer, false, 1.0, 0, 0, 0) -- setTimer( fadeCamera, 500, 1, thePlayer, false, 0.5 ) -- outputChatBox("Welocme To Cops & Robbers Server. Remember You are guest", thePlayer) end addEvent("guestLogin",true) addEventHandler("guestLogin",getRootElement(),LoggedIn)
  3. TwiX!

    need sum help

    c function myfirstwindow() local swidth, sheight = guiGetScreenSize() local width, height = 400, 400 local x = (swidth/2) - (width/2) local y = (sheight/2) - (height/2) window1 = guiCreateWindow(x, y, width, height, "Title", false) -- MAIN WINDOW guiWindowSetMovable(window1, false) guiWindowSetSizable(window1, false) --Button guestBtn = guiCreateButton(160,370,70,30, "Play as Guest", false, window1) addEventHandler("onClientGUIClick", guestBtn, window1buttonresponse, false) end addEventHandler("onClientResourceStart", getResourceRootElement(getThisResource()), function() myfirstwindow() outputChatBox("Wlcome to MTA:SA Cops & Robbers Server. Please Log-In") if window1 ~= nil then guiSetVisible(window1, true) else outputChatBox("An error has occured") end showCursor(true) guiSetInputEnabled(true) end ) function window1buttonresponse(button,state) if button == 'left' and state == 'up' then guiSetVisible(window1,false); showCursor(false,false); triggerServerEvent("guestLogin",localPlayer,localPlayer); end end s addEvent("guestLogin", true) addEventHandler("guestLogin", root, function (thePlayer) spawnPlayer(thePlayer, 2505.52, -1741.73, 2072.98) fadeCamera(thePlayer, false, 1.0, 0, 0, 0) -- setTimer( fadeCamera, 500, 1, thePlayer, false, 0.5 ) -- outputChatBox("Welocme To Cops & Robbers Server. Remember You are guest", thePlayer) end )
  4. you have everything to do it learn lua here pls: https://wiki.multitheftauto.com/wiki/Scr ... troduction or other's lua tutorials
  5. Copy my code Paste in your own script do /restart YOUR SCRIPT NAME about meta don't forget about type="client" Set yourself a team (can with admin panel) if you don't have this team, create it with name "SWAT"
  6. function Buy() if MoonPB then local time = getRealTime() local yearday = time.yearday local day = time.monthday local month = time.month + 1 local year = time.year local money = getPlayerMoney() if(guiRadioButtonGetSelected(Moon1w))then if money > 10000 then takePlayerMoney(10000) MoonMembership = true local DateMS = yearday local DateME = DateMS + 7 setElementData(localPlayer, "player.Moonmemend", DateME, true) setElementData(localPlayer, "player.Moonmem", MoonMembership, true) triggerServerEvent("turnOnMem", root, localPlayer) guiSetVisible(MoonPB, false) guiSetVisible(MoonUB, true) addEventHandler("onClientGUIClick", MoonUB, CancelSub, false) outputChatBox("You bought a 1 week subscription (Today's Date: "..day.."/"..month.."/"..year.."). It will end in 7 days.", 255, 255, 255) end elseif(guiRadioButtonGetSelected(Moon1m))then if money > 50000 then takePlayerMoney(50000) MoonMembership = true local DateMS = yearday local DateME = DateMS + 31 setElementData(localPlayer, "player.Moonmemend", DateME, true) setElementData(localPlayer, "player.Moonmem", MoonMembership, true) triggerServerEvent("turnOnMem", root, localPlayer) guiSetVisible(MoonPB, false) guiSetVisible(MoonUB, true) addEventHandler("onClientGUIClick", MoonUB, CancelSub, false) outputChatBox("You bought a 1 month subscription (Today's Date: "..day.."/"..month.."/"..year.."). It will end in 31 days.", 255, 255, 255) end elseif(guiRadioButtonGetSelected(Moon6m))then if money > 100000 then takePlayerMoney(100000) MoonMembership = true local DateMS = yearday local DateME = DateMS + 182 setElementData(localPlayer, "player.Moonmemend", DateME, true) setElementData(localPlayer, "player.Moonmem", MoonMembership, true) triggerServerEvent("turnOnMem", root, localPlayer) guiSetVisible(MoonPB, false) guiSetVisible(MoonUB, true) addEventHandler("onClientGUIClick", MoonUB, CancelSub, false) outputChatBox("You bought a 6 month subscription (Today's Date: "..day.."/"..month.."/"..year.."). It will end in 182 days.", 255, 255, 255) end elseif(guiRadioButtonGetSelected(Moon1y))then if money > 500000 then takePlayerMoney(500000) MoonMembership = true local DateMS = yearday local DateME = DateMS + 364 setElementData(localPlayer, "player.Moonmemend", DateME, true) setElementData(localPlayer, "player.Moonmem", MoonMembership, true) triggerServerEvent("turnOnMem", root, localPlayer) guiSetVisible(MoonPB, false) guiSetVisible(MoonUB, true) addEventHandler("onClientGUIClick", MoonUB, CancelSub, false) outputChatBox("You bought a yearly subscription (Today's Date: "..day.."/"..month.."/"..year.."). It will end in 364 days.", 255, 255, 255) end end end end ---Spawn--- function onSpawn() local isOn = getElementData(localPlayer, "player.Moonmemturn") local Member = getElementData(localPlayer, "player.Moonmem") local MemberEnd = getElementData(localPlayer, "player.Moonmemend") if source == localPlayer then if not yearday == MemberEnd then if Member == true then if isOn == true then triggerServerEvent("turnOnSpawn", root, localPlayer) setTimer(outputChatBox, 3000, 1, "?Moon Member Check........", 255, 255, 255) setTimer(outputChatBox, 5000, 1, "?Moon Member Check........Done!", 255, 255, 255) else outputChatBox("?Advice: Your Member tag is not on, if you want to turn it on do /moonon", 0, 150, 255) end end end end end addEventHandler("onClientPlayerSpawn", root, onSpawn) use setAccountData,getAccountData For save all in account setElementData - it can store a temporary data
  7. local x,y = guiGetScreenSize(); local jMarker = createMarker(1289.0939941406, -1647.5231933594, 12.546875, "Cylinder", 1.8, 0, 0, 57, 150); local sizeX,sizeY = 332,350; local jX,jY = x/2 - sizeX/2,y/2 - sizeY/2; GUIEditor_Button = {} GUIEditor_Memo = {} GUIEditor_Label = {} windowjob = guiCreateWindow(jX,jY,sizeX,sizeY,"SWAT",false); guiSetVisible(windowjob,false) GUIEditor_Button[1] = guiCreateButton(22,280,108,35,"Take job",false,windowjob) GUIEditor_Label[1] = guiCreateLabel(193,-103,5,5,"",false,windowjob) GUIEditor_Button[2] = guiCreateButton(179,280,110,36,"Cancel",false,windowjob) GUIEditor_Memo[1] = guiCreateMemo(19,33,320,200,"SWAT Team",false,windowjob) guiMemoSetReadOnly(GUIEditor_Memo[1],true) function SWATjob(hitElement) if source == jMarker then if getPlayerGang(hitElement) == "SWAT" and (hitElement == localPlayer) then if not guiGetVisible(windowjob) then guiSetVisible(windowjob,true); showCursor(true); end end end end addEventHandler("onClientMarkerHit",getRootElement(),SWATjob) function SWATjobLeave(leaveElement) if source == jMarker then if getElementType(leaveElement) == "player" and (leaveElement == localPlayer) then if guiGetVisible(windowjob) then guiSetVisible(windowjob,false); showCursor(false); end end end end addEventHandler("onClientMarkerLeave",getRootElement(),SWATjobLeave) function joinTeam() triggerServerEvent("setSWAT",localPlayer) guiSetVisible(windowjob, false) showCursor(false) end addEventHandler("onClientGUIClick", GUIEditor_Button[1] , joinTeam, false) function removeSWATWindow() guiSetVisible(windowjob, false) showCursor(false) end addEventHandler("onClientGUIClick", GUIEditor_Button[2] , removeSWATWindow, false) function getPlayerGang(player) local team = getPlayerTeam(player); return getTeamName(team); end 100% Work
  8. found errors local x,y = guiGetScreenSize(); local jMarker = createMarker(1289.0939941406, -1647.5231933594, 12.546875, "Cylinder", 1.8, 0, 0, 57, 150); local sizeX,sizeY = 332,350; local jX,jY = x/2 - sizeX/2,y/2 - sizeY/2; GUIEditor_Button = {} GUIEditor_Memo = {} GUIEditor_Label = {} windowjob = guiCreateWindow(jX,jY,sizeX,sizeY,"SWAT",false); guiSetVisible(windowjob,false) GUIEditor_Button[1] = guiCreateButton(22,280,108,35,"Take job",false,windowjob) GUIEditor_Label[1] = guiCreateLabel(193,-103,5,5,"",false,windowjob) GUIEditor_Button[2] = guiCreateButton(179,280,110,36,"Cancel",false,windowjob) GUIEditor_Memo[1] = guiCreateMemo(19,33,320,200,"SWAT Team",false,windowjob) guiMemoSetReadOnly(GUIEditor_Memo[1],true) function SWATjob(hitElement) if source == jMarker then if getPlayerGang(hitElement) == "SWAT" and (hitElement == localPlayer) then if not guiGetVisible(windowjob) then guiSetVisible(windowjob,true); showCursor(true); end end end end addEventHandler("onClientMarkerHit",getRootElement(),SWATjob) function SWATjobLeave(leaveElement) if source == jMarker then if getElementType(leaveElement) == "player" and (leaveElement == localPlayer) then if guiGetVisible(windowjob) then guiSetVisible(windowjob,false); showCursor(false); end end end end addEventHandler("onClientMarkerLeave",getRootElement(),SWATjobLeave) function joinTeam() triggerServerEvent("setSWAT",localPlayer) guiSetVisible(windowjob, false) showCursor(false) end addEventHandler("onClientGUIClick", GUIEditor_Button[1] , joinTeam, false) function removeSWATWindow() guiSetVisible(windowjob, false) showCursor(false) end addEventHandler("onClientGUIClick", GUIEditor_Button[2] , removeSWATWindow, false) function getPlayerGang(player) return getPlayerTeam(player); end
  9. local jMarker = createMarker(1289.0939941406, -1647.5231933594, 12.546875, "Cylinder", 1.8, 0, 0, 57, 150); GUIEditor_Button = {} GUIEditor_Memo = {} GUIEditor_Label = {} function guiMyCwindow(w,h,t) local x,y = guiGetScreenSize() return guiCreateWindow((x-w)/2,(y-h)/2,w,h,t,false) end windowjob = guiMyCwindow(332,350,"SWAT") guiSetVisible(windowjob, false) GUIEditor_Button[1] = guiCreateButton(22,280,108,35,"Take job",false,windowjob) GUIEditor_Label[1] = guiCreateLabel(193,-103,5,5,"",false,windowjob) GUIEditor_Button[2] = guiCreateButton(179,280,110,36,"Cancel",false,windowjob) GUIEditor_Memo[1] = guiCreateMemo(19,33,320,200,"SWAT Team",false,windowjob) guiMemoSetReadOnly(GUIEditor_Memo[1],true) function SWATjob(hitElement) if source == jMarker then if getPlayerGang(hitElement) == "SWAT" and (hitElement == localPlayer) then if not guiGetVisible(windowjob) then guiSetVisible(windowjob,true); showCursor(true); end end end end addEventHandler("onClientMarkerHit",getRootElement(),SWATjob) function SWATjobLeave(leaveElement) if source == jMarker then if getElementType(leaveElement) == "player" and (leaveElement == localPlayer) then if guiGetVisible(windowjob) then guiSetVisible(windowjob,false); showCursor(false); end end end end addEventHandler("onClientMarkerLeave",getRootElement(),SWATjobleave) function joinTeam() triggerServerEvent("setSWAT",localPlayer) guiSetVisible(windowjob, false) showCursor(false) end addEventHandler("onClientGUIClick", GUIEditor_Button[1] , joinTeam, false) function removeSWATWindow() guiSetVisible(windowjob, false) showCursor(false) end addEventHandler("onClientGUIClick", GUIEditor_Button[2] , removeSWATWindow, false) function getPlayerGang(player) return getPlayerTeam(player); end
  10. lol local marker = createMarker(1289.0939941406, -1647.5231933594, 12.546875, "Cylinder", 1.8, 0, 0, 57, 150) GUIEditor_Button = {} GUIEditor_Memo = {} GUIEditor_Label = {} function guiMyCwindow(w,h,t) local x,y = guiGetScreenSize() return guiCreateWindow((x-w)/2,(y-h)/2,w,h,t,false) end windowjob = guiMyCwindow(332,350,"SWAT") guiSetVisible(windowjob, false) GUIEditor_Button[1] = guiCreateButton(22,280,108,35,"Take job",false,windowjob) GUIEditor_Label[1] = guiCreateLabel(193,-103,5,5,"",false,windowjob) GUIEditor_Button[2] = guiCreateButton(179,280,110,36,"Cancel",false,windowjob) GUIEditor_Memo[1] = guiCreateMemo(19,33,320,200,"SWAT Team",false,windowjob) guiEditSetReadOnly(GUIEditor_Memo[1],true) function SWATjob(hitElement) if getPlayerGang(hitElement) == "SWAT" and (hitElement == localPlayer) then if not guiGetVisible(windowjob) then guiSetVisible(windowjob, true) showCursor(true) end end end addEventHandler("onClientMarkerHit", marker, SWATjob) function SWATjobLeave(leaveElement) if getElementType(leaveElement) == "player" and (leaveElement == localPlayer) then if guiGetVisible(windowjob) then guiSetVisible(windowjob, false) showCursor(false) end end end addEventHandler("onClientMarkerLeave", marker, SWATjobleave) function joinTeam() triggerServerEvent("setSWAT",localPlayer) guiSetVisible(windowjob, false) showCursor(false) end addEventHandler("onClientGUIClick", GUIEditor_Button[1] , joinTeam, false) function removeSWATWindow() guiSetVisible(windowjob, false) showCursor(false) end addEventHandler("onClientGUIClick", GUIEditor_Button[2] , removeSWATWindow, false) function getPlayerGang(player) return getPlayerTeam(player); end
  11. .. Where is function getPlayerGang(player) --something here end please use [lua] [ /lua] tags
  12. Hello! I will sell my old panel , if you want.. contact me skype - sane4ek73 or [email protected] There, I'll tell you about the features and price This Mini Map Shop Panel[with open code] You can buy maps And use this map as next Version v0.7[see for updates on community] I repeat, this mini script is a for beginners servers Don't flood here Coming soon user panel for race (Will rename this panel) I use the standard functions and resources (such as "givePlayerMoney"/"race_toptimes") ofc you can modify it #This panel is only in the initial stage of a scripting and atm have eazy code #Please don't write comments like: haha eazy code! crap! etc.. #Write any bugs here #Write here your ideas too (might be your idea will appears in my panel) At the moment panel have: 1)Search maps function 2)It's shows your position/Gives money when you were died 3)You can buy maps 4)It's shows how many times have played on this map Planned in 0.5 1)Add rate info idea by [Hunterix] - Added 2)Add Top Times positions idea by [Yakuza] - Added Planned in 0.6 1)Add buttons like: DM FUN DD idea by [Reflex] - Added 2)Add buy the same map after 10 mins idea by [HTC] - Added Here is some images: Here is a link: https://community.multitheftauto.com/index.php?p= ... ls&id=5801
  13. why? you need there object x,y,z,rx,ry,z
  14. [don't forget to change "yourX","yourY","yourWidth","yourHeight"] i not will make all script for you
  15. TwiX!

    Refresh colours

    my bad ;D c function lightColor() if source == redBar2 or source == greenBar2 or source == blueBar2 then local car = getPedOccupiedVehicle(localPlayer); setVehicleHeadLightColor(car, guiScrollBarGetScrollPosition(redBar2) * 2.55, guiScrollBarGetScrollPosition(greenBar2) * 2.55, guiScrollBarGetScrollPosition(blueBar2) * 2.55); end end addEventHandler("onClientGUIScroll", getRootElement(), lightColor) function carColor() if source == redBar2 or source == greenBar2 or source == blueBar2 then guiLabelSetColor(nickLabel2,(guiScrollBarGetScrollPosition(redBar2)*2.55),(guiScrollBarGetScrollPosition(greenBar2)*2.55),(guiScrollBarGetScrollPosition(blueBar2)*2.55)); end end addEventHandler("onClientGUIScroll",getRootElement(),carColor); function carCol() if source == carRedBar or source == carGreenBar or source == carBlueBar then local r,g,b = guiScrollBarGetScrollPosition(carRedBar)*2.55,guiScrollBarGetScrollPosition(carGreenBar)*2.55,guiScrollBarGetScrollPosition(carBlueBar)*2.55; triggerServerEvent("changeCarColor",localPlayer,localPlayer,r,g,b); setElementData(localPlayer,"cR",r); setElementData(localPlayer,"cG",g); setElementData(localPlayer,"cB",b); guiLabelSetColor(carLabel,r,g,b); end end addEventHandler("onClientGUIScroll",getRootElement(),carCol) s function carColorChanger(thePlayer,carRedBar,carGreenBar,carBlueBar) local playerVehicle = getPedOccupiedVehicle (thePlayer); if isPedInVehicle (thePlayer) then setVehicleColor(playerVehicle,carRedBar,carGreenBar,carBlueBar,math.random(1,255),math.random(1,255),math.random(1,255)); end end addEvent("changeCarColor",true) addEventHandler("changeCarColor",getRootElement(),carColorChanger) function carLightsColorChanger(car,r,g,b) if (car) then setVehicleHeadLightColor(car,r,g,b); end end addEvent("changeLightsColor",true) addEventHandler("changeLightsColor",getRootElement(),carLightsColorChanger) function doSomethingForGuys() local colorR = tonumber(getElementData(source,"cR")) or 0; local colorG = tonumber(getElementData(source,"cG")) or 0; local colorB = tonumber(getElementData(source,"cB")) or 0; local pVeh = getPedOccupiedVehicle(source); if isPedInVehicle (source) then setVehicleColor (pVeh,colorR,colorG,colorB,math.random(1,255),math.random(1,255),math.random(1,255)); end end addEvent("onNotifyPlayerReady",true) addEventHandler("onNotifyPlayerReady",getRootElement(),doSomethingForGuys) function doSomethikngFromPickUps(number,sort,model) local pVeh = getPedOccupiedVehicle(source); if isPedInVehicle (source) then local colorR = tonumber(getElementData(source,"cR")) or 0; local colorG = tonumber(getElementData(source,"cG")) or 0; local colorB = tonumber(getElementData(source,"cB")) or 0; setVehicleColor(pVeh,tonumber(colorR),tonumber(colorG),tonumber(colorB),math.random(1,255),math.random(1,255),math.random(1,255)); end end end addEvent("onPlayerPickUpRacePickup",true) addEventHandler("onPlayerPickUpRacePickup",getRootElement(),doSomethikngFromPickUps) Added random colors(4,5,6)
  16. TwiX!

    Refresh colours

    he not want random color he wants his colors(get from guiScrollBarGetScrollPosition)
  17. TwiX!

    Refresh colours

    function doSomethikngFromPickUps(number,sort,model) local pVeh = getPedOccupiedVehicle(source); if isPedInVehicle (source) then local colorR = tonumber(getElementData(source,"cR")) or 0; local colorG = tonumber(getElementData(source,"cG")) or 0; local colorB = tonumber(getElementData(source,"cB")) or 0; setVehicleColor(pVeh,tonumber(colorR),tonumber(colorG),tonumber(colorB)); end end end addEventHandler("onPlayerPickUpRacePickup",getRootElement(),doSomethikngFromPickUps)
  18. TwiX!

    Refresh colours

    Server function carColorChanger(thePlayer,carRedBar,carGreenBar,carBlueBar) local playerVehicle = getPedOccupiedVehicle (thePlayer); if (playerVehicle) then setVehicleColor (playerVehicle,carRedBar,carGreenBar,carBlueBar); end end addEvent("changeCarColor", true) addEventHandler("changeCarColor", getRootElement(),carColorChanger) function carLightsColorChanger(car,r,g,b) if (car) then setVehicleHeadLightColor(car,r,g,b); end end addEvent("changeLightsColor",true) addEventHandler("changeLightsColor",getRootElement(),carLightsColorChanger) function doSomethingForGuys() local colorR = tonumber(getElementData(source,"cR")) or 0; local colorG = tonumber(getElementData(source,"cG")) or 0; local colorB = tonumber(getElementData(source,"cB")) or 0; local pVeh = getPedOccupiedVehicle(source); if pVeh then setVehicleColor (playerVehicle,colorR,colorG,colorB); end end addEventHandler("onNotifyPlayerReady",getRootElement(),doSomethingForGuys) Client function lightColor() if source == redBar2 or source == greenBar2 or source == blueBar2 then local car = getPedOccupiedVehicle(localPlayer); setVehicleHeadLightColor(car, guiScrollBarGetScrollPosition(redBar2) * 2.55, guiScrollBarGetScrollPosition(greenBar2) * 2.55, guiScrollBarGetScrollPosition(blueBar2) * 2.55); end end addEventHandler("onClientGUIScroll", getRootElement(), lightColor) function carColor() if source == redBar2 or source == greenBar2 or source == blueBar2 then guiLabelSetColor(nickLabel2,(guiScrollBarGetScrollPosition(redBar2)*2.55),(guiScrollBarGetScrollPosition(greenBar2)*2.55),(guiScrollBarGetScrollPosition(blueBar2)*2.55)); end end addEventHandler("onClientGUIScroll",getRootElement(),carColor); function carCol() if source == carRedBar or source == carGreenBar or source == carBlueBar then local r,g,b = guiScrollBarGetScrollPosition(carRedBar)*2.55,guiScrollBarGetScrollPosition(carGreenBar)*2.55,guiScrollBarGetScrollPosition(carBlueBar)*2.55; triggerServerEvent("changeCarColor",localPlayer,localPlayer,r,g,b); setElementData(localPlayer,"cR",r); setElementData(localPlayer,"cG",g); setElementData(localPlayer,"cB",b); guiLabelSetColor(carLabel,(guiScrollBarGetScrollPosition(carRedBar)*2.55),(guiScrollBarGetScrollPosition(carGreenBar)*2.55),(guiScrollBarGetScrollPosition(carBlueBar)*2.55)); end end addEventHandler("onClientGUIScroll",getRootElement(),carCol)
×
×
  • Create New...