Jump to content

Monty

Members
  • Posts

    167
  • Joined

  • Last visited

Everything posted by Monty

  1. is it possible to block the chat (main and team) when this gui is open? GUIEditor_Window = {} GUIEditor_Button = {} GUIEditor_Label = {} GUIEditor_Edit = {} GUIEditor_Window[1] = guiCreateWindow(255,131,359,185,"Play Sound From URL",false) guiSetVisible(GUIEditor_Window[1],false) guiWindowSetSizable(GUIEditor_Window[1],false) URLE = guiCreateEdit(16,72,328,38,"",false,GUIEditor_Window[1]) GUIEditor_Label[1] = guiCreateLabel(21,44,75,18,"Sound URL :",false,GUIEditor_Window[1]) GUIEditor_Label[2] = guiCreateLabel(11,116,330,20,"* File Extensions : mp3 , wav, ogg, riff , mod, xm, it , s3m",false,GUIEditor_Window[1]) guiLabelSetColor(GUIEditor_Label[2],255,0,0) PlayStop = guiCreateButton(204,140,127,36,"Play",false,GUIEditor_Window[1]) guiLabelSetColor(GUIEditor_Label[4],255,0,0) GUIEditor_Label[5] = guiCreateLabel(97,25,47,16,"Speed :",false,GUIEditor_Window[1]) sup = guiCreateButton(161,24,27,23,"+",false,GUIEditor_Window[1]) sdown = guiCreateButton(189,24,27,23,"-",false,GUIEditor_Window[1]) sn = guiCreateLabel(144,26,16,18,"0",false,GUIEditor_Window[1]) guiLabelSetColor(sn,0,255,0) GUIEditor_Label[7] = guiCreateLabel(220,26,50,18,"Volume :",false,GUIEditor_Window[1]) sv = guiCreateLabel(272,28,18,21,"0",false,GUIEditor_Window[1]) guiLabelSetColor(sv,255,255,0) vup = guiCreateButton(292,24,27,23,"+",false,GUIEditor_Window[1]) vdown = guiCreateButton(322,24,26,23,"-",false,GUIEditor_Window[1]) --[[ local volume = true local speed = true --]] local sound = true function onGuiClick (button, state, absoluteX, absoluteY) if (source == PlayStop) then if sound == true then local URL = guiGetText ( URLE ) sp = playSound(URL) outputChatBox ( "Sound loading maybe take time ...", getLocalPlayer(), 255, 0, 0, true ) outputChatBox ( "Sound starting !", getLocalPlayer, 255, 0, 0, true ) guiSetText(PlayStop,"Stop") sound = false else stopSound(sp) guiSetText(PlayStop,"Play") outputChatBox ( "Sound stopped !", getLocalPlayer(), 255, 0, 0, true ) guiSetText(sn,"1") guiSetText(sv,"1") sound = true end end end addEventHandler ("onClientGUIClick", getRootElement(), onGuiClick) function GuiClick (button, state, absoluteX, absoluteY) if (source == sup) then local ss = getSoundSpeed(sp)+1 while not setSoundSpeed ( sp, ss ) do ss = ss + 1 end guiSetText(sn,""..ss.."") elseif (source == sdown) then local ss = getSoundSpeed(sp)-1 while not setSoundSpeed ( sp, ss ) do ss = ss - 1 end guiSetText(sn,""..ss.."") elseif (source == vup) then local svol = getSoundVolume(sp)+1 while not setSoundVolume ( sp, svol ) do svol = svol + 1 end guiSetText(sv,""..svol.."") elseif (source == vdown) then local svol = getSoundVolume(sp)-1 while not setSoundVolume ( sp, svol ) do svol = svol -1 end guiSetText(sv,""..svol.."") end end addEventHandler ("onClientGUIClick", getRootElement(), GuiClick) function show() if guiGetVisible(GUIEditor_Window[1]) == true then guiSetVisible(GUIEditor_Window[1],false) showCursor(false) else guiSetVisible(GUIEditor_Window[1],true) showCursor(true) end end addCommandHandler("su",show)
  2. what's wrong in this? addEventHandler( "onPlayerWasted", getRootElement( ), function() setTimer( spawnPlayer, 4000, 1, source, 1177.5682373047, -1323.2587890625, 14.077121734619,0, getElementModel(source), getPlayerTeam(source) ) ) end )
  3. is it possible to seva the team after the dead... here's a part of a code addEventHandler( "onPlayerWasted", getRootElement( ), function() setTimer( spawnPlayer, 4000, 1, source, 1177.5682373047, -1323.2587890625, 14.077121734619,0, getElementModel(source) ) end )
  4. Monty

    legalsystem

    hi i found this resource on community https://community.multitheftauto.com/ind ... ils&id=292 ... bu when i start it i don't see new teams or makers... help
  5. Monty

    spawning player

    can you give me the full code?
  6. Monty

    hospital problem

    thanks everybody! it works!
  7. hi i downloaded this login panel... is it possible to spawn the player at the position when he left the game? the code server function passwordHandler(player, oldpassword, newpassword) local account = getPlayerAccount(player) if (account) then if (isGuestAccount(account)) then outputChatBox("You must be logged in to change your password.", player) return end local playerName = getPlayerName(player) local password_check = getAccount(playerName, oldpassword) if (password_check ~= false) then if (string.len(newpassword) >= 5) then setAccountPassword(account, newpassword) triggerClientEvent(player, "hidePasswordWindow", getRootElement()) else outputChatBox("Your new password must be at least 5 characters long!", player) end else outputChatBox("Old password invalid.", player) end end end function loginHandler(player, username, password, thePlayer) local account = getAccount(username, password) if (account ~= false) then if (logIn(player, account, password) == true) then setTimer( spawnPlayer, 2000,1,player, 1574.5, -1246,279.5) fadeCamera ( player, false, 1.0, 0, 0, 0 ) setTimer ( fadeCamera, 5000, 1, player, true, 0.5 ) setElementFrozen(player, false) setTimer( setCameraTarget,3200,1,player) triggerClientEvent (player, "hideLoginWindow1", getRootElement()) else triggerClientEvent (player, "unknownError", getRootElement()) end else triggerClientEvent (player, "loginWrong", getRootElement()) end end function registerHandler(player, username, password) local account = getAccount(username, password) if (account ~= false) then triggerClientEvent(player, "registerTaken", getRootElement()) else account = addAccount(username, password) if (logIn(player, account, password) == true) then triggerClientEvent(player, "hideLoginWindow", getRootElement()) showPlayerHudComponent ( player, "radar", false ) setTimer ( fadeCamera, 50, 1, player,false, 1 ) setTimer ( fadeCamera, 3000, 1, player,true, 3 ) setTimer( spawnPlayer, 2250,1,player, 806.7,-1350,-0.4) setTimer(setCameraMatrix,1500,1,player, 808,-1351,-0.4,-1000,0,0,0,0) --setTimer(setElementPosition,2000,1,player, 806.7,-1350,-0.4) setTimer(setElementRotation,2251,1,player,0,0,220) else triggerClientEvent(player, "unknownError", getRootElement()) end end end function setCameraOnPlayerJoin() fadeCamera(source, true, 5) setTimer ( fadeCamera, 5000, 1, source, true, 0.5 ) setCameraMatrix(source, 1000.8785400391, -919.25317382813, 100.153465271, 1468.388671875, -918.42474365234, 99.881813049316) end addEventHandler("onPlayerJoin", getRootElement(), setCameraOnPlayerJoin) function hudChangerOnJoin () showPlayerHudComponent ( source, "radar", false ) showChat( source, false) end addEventHandler ( "onPlayerJoin", getRootElement(), hudChangerOnJoin ) function hudChangerOnLogin () showPlayerHudComponent ( source, "radar", true ) end addEventHandler ( "onPlayerLogin", getRootElement(), hudChangerOnLogin ) function logoutHandler()--We define a function name local accountname = getAccountName (getPlayerAccount(source))--we get an account if (isGuestAccount(getPlayerAccount(source)) == true) then cancelEvent()--then cancelEvent --triggerClientEvent("logOutOp", getRootElement())--output him to chatbox that logout is not allowed end end addEventHandler("onPlayerLogout",getRootElement(),logoutHandler)--we add a event handler which will handle the funciton function setCameraRegister(player, thePlayer) setTimer(setElementPosition,1000,1,source, 1574.5,-1246,279.5) setTimer( setCameraTarget,1200,1, source ) setTimer ( fadeCamera, 50, 1, source,false, 1 ) setTimer ( fadeCamera, 3000, 1, source,true, 3 ) setElementFrozen ( source, false ) showPlayerHudComponent ( source, "radar", true ) showChat(source, true) end addEvent("setCameraRegister", true) addEvent("submitChangepw", true) addEvent("submitLogin", true) addEvent("submitRegister", true) addEventHandler("submitChangepw", root, passwordHandler) addEventHandler("submitLogin", root, loginHandler) addEventHandler("submitRegister", root, registerHandler) addEventHandler("setCameraRegister", root, setCameraRegister) client local localPlayer = getLocalPlayer() local playerName = getPlayerName(localPlayer) local sx,sy = guiGetScreenSize() wnd_window = {} local guiSkinShop = guiCreateWindow(0.37*sx,0.80*sy,0.3*sx,0.15*sy,"Choose a skin!",false) done = guiCreateButton(0.25,0.60,0.50,0.30,"Done",true,guiSkinShop) left = guiCreateButton(0.07,0.60,0.15,0.30,"<-",true,guiSkinShop) right = guiCreateButton(0.78,0.60,0.15,0.30,"->",true,guiSkinShop) guiWindowSetSizable(guiSkinShop,false) guiSetVisible(guiSkinShop, false) --label skinLabel = guiCreateLabel(0.05,0.30,0.90,0.17,"Skins can be bought once ingame",true,guiSkinShop) guiSetAlpha(skinLabel,1) guiLabelSetColor(skinLabel,255,255,255) guiCreateStaticImage( 0.0001, 0.49, 0.99, 0.02, "red.png", true, guiSkinShop ) guiCreateStaticImage( 0.0001, 0.25, 0.99, 0.02, "red.png", true, guiSkinShop ) guiLabelSetHorizontalAlign(skinLabel,"center",false) guiSetFont(skinLabel,"default-bold-small") function createLoginWindow(title, logo, content) local xml = xmlLoadFile( "server.xml" ) local content = xmlNodeGetValue( xml ) windowLogin = guiCreateWindow(0.02*sx,0.05*sy,0.8*sx,0.8*sy,"LOG-IN",false) guiSetSize(windowLogin, 270, 400, false) guiWindowSetSizable(windowLogin,false) guiCreateMemo(01,170,500,220,content,false,windowLogin) guiSetAlpha(windowLogin,1) labelUsername = guiCreateLabel(10,52,59,24,"Username:",false,windowLogin) guiSetAlpha(labelUsername,1) guiLabelSetColor(labelUsername,255,255,255) guiLabelSetVerticalAlign(labelUsername,"center") guiLabelSetHorizontalAlign(labelUsername,"left",false) labelPassword = guiCreateLabel(10,86,59,24,"Password:",false,windowLogin) guiSetAlpha(labelPassword,1) guiLabelSetColor(labelPassword,255,255,255) guiLabelSetVerticalAlign(labelPassword,"center") guiLabelSetHorizontalAlign(labelPassword,"left",false) labelInfo = guiCreateLabel(10,26,250,17,"Please login or register.",false,windowLogin) guiSetAlpha(labelInfo,1) guiLabelSetColor(labelInfo,255,255,255) guiLabelSetVerticalAlign(labelInfo,"top") guiLabelSetHorizontalAlign(labelInfo,"center",false) guiSetFont(labelInfo,"default-bold-small") editUsername = guiCreateEdit(79,52,181,25,"",false,windowLogin) guiSetAlpha(editUsername,1) guiEditSetMaxLength(editUsername, 50) editPassword = guiCreateEdit(79,86,181,25,"",false,windowLogin) guiSetAlpha(editPassword,1) guiEditSetMasked(editPassword, true) guiEditSetMaxLength(editPassword, 50) buttonLogin = guiCreateButton(10,121,117,21,"Log in",false,windowLogin) guiSetAlpha(buttonLogin,1) buttonRegister = guiCreateButton(149,121,117,21,"Register",false,windowLogin) guiSetAlpha(buttonRegister,1) newsLabel = guiCreateLabel(0.35,0.372,0.300,0.17,"Server News",true,windowLogin) guiSetAlpha(newsLabel,1) guiLabelSetColor(newsLabel,255,255,255) guiCreateStaticImage( 0.0001, 0.11, 0.99, 0.006, "red.png", true, windowLogin ) guiCreateStaticImage( 0.0001, 0.06, 0.99, 0.006, "red.png", true, windowLogin ) guiLabelSetHorizontalAlign(newsLabel,"center",false) guiSetFont(newsLabel,"default-bold-small") guiSetVisible(windowLogin, false) showChat(false) addEventHandler("onClientGUIClick", buttonLogin, clientSubmitLogin, false) addEventHandler("onClientGUIClick", buttonRegister, showReg, false) end regMenu = guiCreateWindow(0.357*sx,0.05*sy,0.33*sx,0.3*sy,"Register Menu",false) guiCreateStaticImage( 0.0001, 0.13, 0.99, 0.010, "red.png", true, regMenu ) guiCreateStaticImage( 0.0001, 0.25, 0.99, 0.010, "red.png", true, regMenu ) guiWindowSetSizable(regMenu,false) guiSetAlpha(regMenu,1) regUsername = guiCreateLabel(10,52,59,24,"Username:",false,regMenu) guiSetAlpha(regUsername,1) guiLabelSetColor(regUsername,255,255,255) guiLabelSetVerticalAlign(regUsername,"center") guiLabelSetHorizontalAlign(regUsername,"left",false) editRegUsername = guiCreateEdit(70,52,181,25,"",false,regMenu) guiSetAlpha(editRegUsername,1) guiEditSetMaxLength(editRegUsername, 50) regPassword = guiCreateLabel(10,86,59,24,"Password:",false,regMenu) guiSetAlpha(regPassword,1) guiLabelSetColor(regPassword,255,255,255) guiLabelSetVerticalAlign(regPassword,"center") guiLabelSetHorizontalAlign(regPassword,"left",false) --editRegPassword = guiCreateEdit(79,86,181,25,"",false,regMenu) editRegPassword = guiCreateEdit(70,86,181,25,"",false,regMenu) guiSetAlpha(editRegPassword,1) guiEditSetMasked(editRegPassword, true) guiEditSetMaxLength(editRegPassword, 50) regComPassword = guiCreateLabel(10,122,59,24,"*Email:",false,regMenu) guiSetAlpha(regComPassword,1) guiLabelSetColor(regComPassword,255,255,255) guiLabelSetVerticalAlign(regComPassword,"center") guiLabelSetHorizontalAlign(regComPassword,"left",false) editEmail = guiCreateEdit(70,120,181,25,"",false,regMenu) --editEmail = guiCreateEdit(60,120,190,25,"",false,regMenu) guiSetAlpha(editEmail,1) guiEditSetMasked(editEmail, true) guiEditSetMaxLength(editEmail, 50) buttonReg = guiCreateButton(10,150,120,21,"Register",false,regMenu) guiSetAlpha(buttonReg,1) buttonCan = guiCreateButton(143,150,117,21,"Cancel",false,regMenu) guiSetAlpha(buttonCan,1) labelRegister = guiCreateLabel(10,26,250,17,"Register with a user and pass here.",false,regMenu) guiSetAlpha(labelRegister,1) guiLabelSetColor(labelRegister,255,255,255) guiLabelSetVerticalAlign(labelRegister,"top") guiLabelSetHorizontalAlign(labelRegister,"center",false) guiSetFont(labelRegister,"default-bold-small") guiSetVisible(regMenu, false) function cancelWindow() guiSetVisible(regMenu, false) end function resourceStart() createLoginWindow() if (windowLogin ~= nil) then guiSetVisible(windowLogin, true) else outputChatBox("An error has occurred.") end showCursor(true) guiSetInputEnabled(true) end function changePw() createPasswordWindow() guiSetVisible(windowChangepw, true) showCursor(true) guiSetInputEnabled(true) end function clientSubmitLogin(button, state) if button == "left" and state == "up" then local username = guiGetText(editUsername) local password = guiGetText(editPassword) if username and password then showChat(true) triggerServerEvent("submitLogin", getRootElement(), localPlayer, username, password) else guiSetText(labelInfo, "Enter username and password.") end end end function showReg(button, state) guiSetVisible(regMenu, true) --if button == "left" and state == "up" then -- local username = guiGetText(editUsername) -- local password = guiGetText(editPassword) -- if username and password then --showChat(false) -- -- -- triggerServerEvent("submitRegister", getRootElement(), localPlayer, username, password) -- else -- guiSetText(labelInfo, "Enter username and password.") -- end --end end function clientSubmitRegister(button, state) if button == "left" and state == "up" then local username = guiGetText(editRegUsername) local password = guiGetText(editRegPassword) if username and password then showChat(false) triggerServerEvent("submitRegister", getRootElement(), localPlayer, username, password) else -- guiSetText(labelRegister, "User/pass in use.") end end end function clientSubmitChangepw(button, state) if button == "left" and state == "up" then local oldpassword = guiGetText(editOldpw) local newpassword = guiGetText(editNewpw) if oldpassword and newpassword then triggerServerEvent("submitChangepw", getRootElement(), localPlayer, oldpassword, newpassword) else outputChatBox("Enter old and new password.") end end end function hideLoginWindow() guiSetInputEnabled(false) guiSetVisible(windowLogin, false) showCursor(false) guiSetVisible(regMenu, false) setTimer(guiSetVisible, 3100, 1, guiSkinShop, true) showCursor(true) end function hideLoginWindow1() guiSetInputEnabled(false) guiSetVisible(windowLogin, false) showCursor(false)
  8. hi... this script should respawn player at the hospital... but everytime my skin get set to CJ... is it possible to set the model as the one before the dead? addEventHandler( "onPlayerWasted", getRootElement( ), function() setTimer( spawnPlayer, 4000, 1, source, 1177.5682373047, -1323.2587890625, 14.077121734619 ) outputChatBox ( getPlayerName ( source ).." died and was transported at All Saints Hospital.") end )
  9. "Xeno" version="1" type="script" name="LoginSys" description="Xeno's Login System!" /> why does it say couldent parse meta.xml?
  10. Monty

    online stats

    https://community.multitheftauto.com/ind ... ls&id=1691 in the file i have to type a username and a password.... are the same that i ue for ftp? and in the parametre 'server' i have to type the url like http://www.myurl.com ?
  11. nella resource interiors... e poi mi sa che devi installare il mySql
  12. hi i downloaded this resource https://community.multitheftauto.com/ind ... ls&id=1691 ... i read that i can add the same on my website... the problem is that the link to PHP part doesn't work can someone give me a working link?
  13. dentro una cartella in [...]\MTA San Andreas\server\mods\deathmatch\resources\nomecartellaresouce
  14. prova a specificare le exported functions nel mta.xml
  15. Monty

    weapon animtion

    i mean the animation of the skills
  16. i saw that when i take m4 the animation is always the one that it's used for max skills, is it possible to change it?
  17. Monty

    trucker error

    the blip of the destination doesn't get created server createBlip ( 2751.2885742188, -2435.689453125, 12.6484375, 51 ) function createMedicTeam () truckerTeam = createTeam ("Trucker", 255, 255, 0) end addEventHandler ("onResourceStart", resourceRoot, createMedicTeam) function joinMedic() setPlayerTeam(source,truckerTeam) setElementModel(source,261) setElementData( source, "Occupation", "Trucker", true ) outputChatBox("You are now a Trucker.",source,0,255,0) end addEvent("setMedic", true) addEventHandler("setMedic",root,joinMedic) addEvent ( "givePlayerPay", true ) function givePlayerRobPay () money = math.random ( 350, 1020 ) givePlayerMoney ( source, money ) outputChatBox ( "You succesfully robbed the house and made $" ..money, source ) fadeCamera ( source, false, 1, 0, 0, 0 ) setTimer ( fadeCamera, 1000, 1, source, true, 1 ) end addEventHandler ( "givePlayerPay", root, givePlayerRobPay ) client addEventHandler ( "createHouseEvent", root, createHouses ) addEventHandler ( "onClientMarkerHit", root, function ( hitElement ) if ( source == robhouseMarker and not isPedInVehicle ( localPlayer ) and hitElement == localPlayer ) then triggerServerEvent ( "givePlayerPay", localPlayer ) destroyElement ( robhouseMarker ) destroyElement ( robhouseBlip ) triggerEvent ( "createHouseEvent", localPlayer ) playSound ( "files/cash.mp3", false ) end end ) function triggerServer () triggerEvent ( "createHouseEvent", localPlayer ) triggerServerEvent ( "setMedic", localPlayer ) end --- local marker = createMarker( 2751.2885742188, -2435.689453125, 12.6484375, "Cylinder", 2, 255, 255, 0, 153) 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(301,250,"trucker job") guiSetVisible(windowjob, false) GUIEditor_Button[1] = guiCreateButton(22,200,108,35,"Take job",false,windowjob) GUIEditor_Label[1] = guiCreateLabel(193,-103,5,5,"",false,windowjob) GUIEditor_Button[2] = guiCreateButton(179,200,110,36,"Cancel",false,windowjob) GUIEditor_Memo[1] = guiCreateMemo(19,33,273,100,"To take medic job, press Take job.\n\nIf you don't want to, press Cancel.",false,windowjob) guiEditSetReadOnly(GUIEditor_Memo[1],true) function Medicjob(hitElement) if getElementType(hitElement) == "player" and (hitElement == localPlayer) then if not guiGetVisible(windowjob) then guiSetVisible(windowjob, true) showCursor(true) end end end addEventHandler("onClientMarkerHit", marker, Medicjob) function Medicjobleave(leaveElement) if getElementType(leaveElement) == "player" and (leaveElement == localPlayer) then if guiGetVisible(windowjob) then guiSetVisible(windowjob, false) showCursor(false) end end end addEventHandler("onClientMarkerLeave", marker, Medicjobleave) function joinTeam() triggerServerEvent("setMedic",localPlayer) guiSetVisible(windowjob, false) showCursor(false) end addEventHandler("onClientGUIClick", GUIEditor_Button[1] , joinTeam, false) function removeMedicWindow() guiSetVisible(windowjob, false) showCursor(false) end addEventHandler("onClientGUIClick", GUIEditor_Button[2] , removeMedicWindow, false)
  18. the gui doesn't get created
  19. hi i made this script, but no marker spawned client local marker = createMarker( 1037.8309326172, -1029.5063476563, 31.1015625, "Cylinder", 1.5, 255, 153, 0, 150) --- marker createMarker ( float x, float y, float z, [string theType, float size, int r, int g, int b, int a] ) 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(301,250,"Mchanic job") guiSetVisible(windowjob, false) GUIEditor_Button[1] = guiCreateButton(22,200,108,35,"Mechanic job",false,windowjob) GUIEditor_Label[1] = guiCreateLabel(193,-103,5,5,"",false,windowjob) GUIEditor_Button[2] = guiCreateButton(179,200,110,36,"Cancel",false,windowjob) GUIEditor_Memo[1] = guiCreateMemo(19,33,273,100,"To take mechanic job, press Take job.\n\nIf you don't want to, press Cancel.",false,windowjob) guiMemoSetReadOnly(GUIEditor_Memo[1],true) --It's a memo not an edit function Mecjob(hitElement) if getElementType(hitElement) == "player" and (hitElement == localPlayer) then if not guiGetVisible(windowjob) then guiSetVisible(windowjob, true) showCursor(true) end end end addEventHandler("onClientMarkerHit", marker, Mecjob) function Mecjobleave(leaveElement) if getElementType(leaveElement) == "player" and (leaveElement == localPlayer) then if guiGetVisible(windowjob) then guiSetVisible(windowjob, false) showCursor(false) end end end addEventHandler("onClientMarkerLeave", marker, Mecjobleave) function joinTeam() triggerServerEvent("setMec",localPlayer) guiSetVisible(windowjob, false) showCursor(false) end addEventHandler("onClientGUIClick", GUIEditor_Button[1] , joinTeam, false) function removeMedicWindow() guiSetVisible(windowjob, false) showCursor(false) end addEventHandler("onClientGUIClick", GUIEditor_Button[2] , removeMedicWindow, false) addEventHandler("onClientPlayerDamage",root,function()function(attacker, weapon, bodypart, loss) local localVehicle = getPedOccupiedVehicle(source) team = getPlayerTeam(attacker) if (attacker and getElementType(attacker) == "player" and weapon == 42 and team and getTeamName(team) == "Mechanic") then cancelEvent() -- Cancels the damage cause by the spray if (not isTimer(pause)) then if (health <= 99) then triggerServerEvent("mechanic:repair", localVehicle, attacker) -- Calls the Server Event pause = setTimer(function() end, 1000, 1) -- Makes a timer for the function so it won't fully heal in the first time end end end end) server createBlip ( 1036.1654052734, -1027.8570556641, 32.1015625, 27 ) function createMechanicTeam () mecTeam = createTeam ("Mechanic", 255, 153, 0) end addEventHandler ("onResourceStart", resourceRoot, createMechanicTeam) function joinMec() setPlayerTeam(client,mecTeam) setElementModel(client, 50) giveWeapon ( client, 42, 999 ) setElementData( client, "Occupation", "Mechanic") outputChatBox("You are now a Mechanic.",client,0,255,0) end addEvent("setMec", true) addEventHandler("setMec", root, joinMec ) addEvent("mechanic:repair", true) addEventHandler("mechanic:repair", root,function(mechanic) if (getElementHealth(source) < 100) then local Heal = getElementHealth(source) + 10 -- New health setElementHealth(source, Heal) if (Heal > 100) then setElementHealth(source, 1000) end givePlayerMoney(mechanic, 1000) -- Gives 100$ to the medic each time the function is executed end end) meta.xml <meta> <info author="stolka" name="mec" version="1.0" type="script"/> <script src="mecc.lua" type="client"/> <script src="mecs.lua" type="server"/> </meta>
  20. what's wrong? function createFBITeam () ARMYTeam = createTeam ("ARMY", 0, 102, 0) end addEventHandler ("onResourceStart", resourceRoot, createFBITeam) function joinARMY() local gang = exports [ 'ROADgang' ]:getAccountGang ( getAccountName ( getPlayerAccount ( client ) ) ) --changed source to client (for safety reasons) if ( gang == "ARMY" ) then setPlayerTeam(source,ARMYTeam) local acc = getAccountName( source ) if acc == "stolka" then setElementModel(source,73) esle setElementModel(source,287) giveWeapon ( source, 31, 120 ) setElementData( source, "Occupation", "ARMY", true ) outputChatBox("You are now an ARMY soldier.",source,0,255,0) end end end addEvent("setARMY", true) addEventHandler("setARMY",root,joinARMY)
×
×
  • Create New...