Jump to content

TwiX!

Members
  • Posts

    905
  • Joined

  • Last visited

Everything posted by TwiX!

  1. TwiX!

    What is bad ?

    show your all code with server/client
  2. No problems yaku you not help him lol why no problem?
  3. my code is working You can't trigger event from other resource
  4. You can't use nextmap from user panel (coz guy need admin rights for execute "nextmap" command) function buyMap(thePlayer,mapName) local playerCash = getPlayerMoney( thePlayer ) if mapIsAlreadySet == false or not getElementData (getRootElement(),"mapIsAlreadySet") == true then if not (mapName == "") then if playerCash >= mapCost then executeCommandHandler("bm", thePlayer, mapName) takePlayerMoney ( thePlayer, 5000 ) mapIsAlreadySet = true setElementData(getRootElement(),"mapIsAlreadySet",true) else outputChatBox("#FF0000* #FFFFFFYou don't have enough money to set a map!",thePlayer,255,255,255,true) end else outputChatBox("#FF0000* #FFFFFFPlease select a map from the list first!",thePlayer,255,255,255,true) end else outputChatBox("#FF0000* #FFFFFFA map is already #ff0000set #ffffffat the moment! Please try again later.",thePlayer,255,255,255,true) end end function resetMap() setElementData(getRootElement(),"mapIsAlreadySet",false) mapIsAlreadySet = false end addEventHandler("onMapStarting",getRootElement(),resetMap) racevoting_server.lua - add there this code addCommandHandler('bm', function( player, command, ... ) if not getElementData (getRootElement(),"mapIsAlreadySet") == true then --this check need for /bm, if guy bought map (/bm),not from user panel(so you can modify code for bm(take player money too)finish it local query = #{...}>0 and table.concat({...},' ') or nil if not query then if g_ForcedNextMap then outputChatBox( '#abcdefNext map is #ffffff ' .. getMapName( g_ForcedNextMap ), player, 255, 255, 255, true ) else outputChatBox( '#abcdefNext map is not set', player, 255, 255 ,255, true ) end return end local map, errormsg = findMap( query ) if not map then outputRace( errormsg, player ) return end if (isGuestAccount(getPlayerAccount(player)) == false) then g_ForcedNextMap = map outputChatBox('#FF6600* Next map set from #ABCDEF'..getPlayerName( player )..' #FFFFFF[' .. getMapName( g_ForcedNextMap ).." ]", g_Root, 0, 240, 0,true) else outputChatBox("#00ff00*[bM] #FF0000ERROR: #ffffffPlease Register or Login!",player,255,255,255,true) end else outputChatBox("#FF0000* #FFFFFFA map is already #ff0000set #ffffffat the moment! Please try again later.",player,255,255,255,true) end end ) P.S why you use nextreme code? ;D
  5. TwiX!

    SQL Question

    you are his code is work
  6. зачем тебе аттачить зону к игроку?
  7. здесь не служба знакомств вроде как
  8. на вики там всё есть, стоит быть внимательней
  9. forgot about this update
  10. Hey Ive noticed you have posted twice of the same topic, I will give you 128 slots, FTP, control panel, support, unlimited bandwidth, no limit storage (for ur game server(s) only), 1000Mb/s networking speed. This for just $8.96 per month You wouldn't find cheaper anywhere else you're crazy, i not trust you or this host will have problems or much lags, a very small price for such services
  11. server local root = getRootElement() createBlip ( 1552.4996337891, -1677.3264160156, 15.1953125, 30 ) addEventHandler("onPlayerLogin",root, function() local playeraccount = getPlayerAccount (source) local data = tonumber(getAccountData(playeraccount, "arrest")) -- you should finish it local acc = getAccountName(playeraccount) triggerClientEvent(source,"myEvent",data,acc) end ) function createSAPDTeam () SAPDteam = createTeam ("police", 100, 149, 237) end addEventHandler ("onResourceStart", resourceRoot, createSAPDTeam) function joinSAPD() if (isGuestAccount(getPlayerAccount(source)) == false) then local playeraccount = getPlayerAccount (source) if not getAccountData(playeraccount,"Occupation") == "police" then setPlayerTeam(source,SAPDteam) setElementModel(source, 280) giveWeapon ( source, 3 ) setAccountData( playeraccount, "Occupation", "police") outputChatBox("You are now policeman.",source,0,255,0) else outputChatBox("Error: You already have this work",source,255,0,0) end else outputChatBox ('Error: Please login or register!',source,255,255,255,true) end end addEvent("setSAPD", true) addEventHandler("setSAPD",root,joinSAPD) function removeSAPD() if (isGuestAccount(getPlayerAccount(source)) == false) then local playeraccount = getPlayerAccount (source) if not getAccountData(playeraccount,"Occupation") == "unemployed" then setPlayerTeam(source,0) setAccountData( playeraccount, "Occupation", "unemployed") outputChatBox("you left your job.",source,0,255,0) else outputChatBox ('Error: You not have work',source,255,255,255,true) end else outputChatBox ('Error: Please login or register!',source,255,255,255,true) end end addEvent("removeSAPD", true) addEventHandler("removeSAPD",root,removeSAPD) function policeJob ( attacker, attackerweapon, bodypart, loss ) theTeam = getPlayerTeam ( attacker ) theWL = getPlayerWantedLevel ( source ) theSkin = getElementModel ( attacker ) if (attackerweapon == 3) and (loss > 2 ) and (theWL > 0) then if getTeamName( theTeam ) == "police" or getTeamName( theTeam ) == "SWAT" or getTeamName( theTeam ) == "FBI" then setElementPosition (source, 4076.3999023438, -1788.5, 3.511967, true) theName = getPlayerName ( source ) theCop = getPlayerName ( attacker ) outputChatBox ( "You have been jailed by "..theCop.. " for 10 seconds.", source ) local playeraccount = getPlayerAccount ( attacker ) arrests = tonumber(getAccountData(playeraccount, "arrest")) setAccountData(playeraccount, "arrest", arrests + 1 ) givePlayerMoney (attacker, 100) setTimer ( setElementPosition, 10000, 1, source, 1544.4332275391, -1674.7698974609, 13.688399200439) setPlayerWantedLevel (source, 0) end end end addEventHandler ("onPlayerDamage", getRootElement(), policeJob) client local root = getRootElement() local marker = createMarker( 1552.4996337891, -1677.3264160156, 15.1953125, "Cylinder", 1.5, 0, 0, 255, 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(301,250,"police job") guiSetVisible(windowjob, false) GUIEditor_Button[1] = guiCreateButton(22,140,108,35,"Take job",false,windowjob) GUIEditor_Label[2] = guiCreateLabel(19,59,108,35,"Arrests : " ,false,windowjob) GUIEditor_Button[2] = guiCreateButton(179,200,110,36,"Close",false,windowjob) GUIEditor_Button[3] = guiCreateButton(22,200,110,36,"Quit Job",false,windowjob) GUIEditor_Memo[1] = guiCreateLabel(19,19,273,20,"are you sure you want to take this job?",false,windowjob) theTeam = getTeamFromName("police") GUIEditor_Memo[2] = guiCreateLabel(19,45,273,20,"On-duty officers : "..countPlayersInTeam(theTeam),false,windowjob) addEvent("myEvent",true) addEventHandler("myEvent",root, function(data, acc) guiSetText(GUIEditor_Label[2],"Arrests : "..data) guiSetText(GUIEditor_Label[2],"Account : "..acc) -- you need make other label, now you set text on 1 label 2 times end ) function SAPDjob(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, SAPDjob) function FBIjobleave(leaveElement) if getElementType(leaveElement) == "player" and (leaveElement == localPlayer) then if guiGetVisible(windowjob) then guiSetVisible(windowjob, false) showCursor(false) end end end addEventHandler("onClientMarkerLeave", marker, SAPDjobleave) function joinTeam() triggerServerEvent("setSAPD",localPlayer) guiSetVisible(windowjob, false) showCursor(false) end addEventHandler("onClientGUIClick", GUIEditor_Button[1] , joinTeam, false) function removeTeam() triggerServerEvent("removeSAPD",localPlayer) guiSetVisible(windowjob, false) showCursor(false) end addEventHandler("onClientGUIClick", GUIEditor_Button[3] , removeTeam, false) function removeSAPDWindow() guiSetVisible(windowjob, false) showCursor(false) end addEventHandler("onClientGUIClick", GUIEditor_Button[2] , removeSAPDWindow, false)
  12. look how work https://wiki.multitheftauto.com/wiki/SetElementParent
  13. TwiX!

    Top list

    https://wiki.multitheftauto.com/wiki/Main_Page https://community.multitheftauto.com/ https://community.multitheftauto.com/index.php?p=resources
  14. like this deco <3 nice work Pee[J]!
  15. pls stop flood here no one will make it for you, for free you can find functions here: https://wiki.multitheftauto.com/wiki/Main_Page
  16. работает с машиной не может быть, или у меня хостинг кривой или я что-то напортачил. Но я точно помню как isElementInWater тупо игнорировал транспорт. Если подвинуть транспорт на пару метров не садясь в него, срабатывает респавн транспорта, который должен быть вызван если транспорт в воде. ну незнаю, вроде бы когда тестил, работало
  17. работает с машиной что именно не получается, выкладывай код https://wiki.multitheftauto.com/wiki/GetPlayerAccount https://wiki.multitheftauto.com/wiki/SetAccountData
  18. я на понт не кого не беру, и не хвастаюсь а сказал что это возможно onClientRender https://wiki.multitheftauto.com/wiki/OnClientRender
  19. TwiX!

    Edited

    local BankEnter = createMarker(-2455.0500,503.7387,30.0776, "corona", 1.0, 255, 255, 255, 255) local BankExit = createMarker(324.01458740234, 110.85294342041, 1007.9656982422, "corona", 1.0, 255, 255, 255, 255) addEventHandler("onMarkerHit", BankEnter, function(hitElement) if (getElementType(hitElement) == "vehicle") then return end setElementFrozen ( hitElement, true ) setTimer( Unfreeze, 10000, 1, hitElement ) outputChatBox("You enter the bank", 255, 0, 0, false) setElementPosition(hitElement, 325.62298583984, 114.32950592041, 1007.9656982422, 0) --or YOur function setInPosition end) addEventHandler("onMarkerHit", BankExit, function(hitElement) if (getElementType(hitElement) == "vehicle") then return end setElementPosition(hitElement, -2452.828125, 504.38671875, 30.081373214722, 0) --or YOur function setInPosition end) function Unfreeze(thePlayer) setElementFrozen ( thePlayer, false ) end Your errors is:
×
×
  • Create New...