Jump to content

-misterX-

Members
  • Posts

    78
  • Joined

  • Last visited

Everything posted by -misterX-

  1. how do i set a spawnpoit for zombies and force them to get spawnedonly from that one?
  2. i removed all but i still have double M4
  3. i just tryied to see how it works
  4. i want it works standardly but the resource force me use only dual weapons! the only way is set a lower weapon skill
  5. hi, i downloaded this resource https://community.multitheftauto.com/ind ... ls&id=6361 but now everytime i get the m4 it gives me dual m4, i tried to fix but when i shoot the player moves too fast fixed code setWeaponProperty(31, "pro", "flags", 0x000800) setWeaponProperty(31, "pro", "flags", 0x000002) setWeaponProperty(31, "pro", "maximum_clip_ammo", 50) setWeaponProperty(31, "pro", "move_speed", 100)
  6. it reports bad argumet on all lines ((( addEventHandler("onPlayerJoin", root, function ( ) setPlayerNametagText ( thePlayer, getPlayerName ( thePlayer ) .."[".. getPlayerWantedLevel ( thePlayer ) .."]" ) end ) function updateNametagWantedLevel ( ) for index, player in ipairs ( getElementsByType ( "player" ) ) do setPlayerNametagText ( player, getPlayerName ( player ) .."[".. getPlayerWantedLevel ( player ) .."]" ) end end setTimer ( updateNametagWantedLevel, 3000, 0 )
  7. the console reports bad argument on getPlayerAccount, expected account at argument 1 got nil function arrestNumber ( source ) local playerAccount = getPlayerAccount(source) local arrest = getAccountData(playeraccount, "arrest") if not arrest then outputChatBox("you dont have any arrest",source) else outputChatBox("arrest: "..arrest,source) end end addCommandHandler ( "arrest", arrestNumber )
  8. the debugscript doesn't report anything wrong but the gui doesn't cloe and even trigger the event client windowjob = guiCreateWindow ( 0.2, 0.2, 0.25, 0.5, "Police job", true ) guiSetAlpha( windowjob, 1 ) button = guiCreateButton ( 0.5, 0.8, 0.45, 0.15, "Close", true, windowjob ) button1 = guiCreateButton ( 0.01, 0.8, 0.45, 0.15, "Accept", true, windowjob ) label = guiCreateLabel ( 0.1, 0.1, 0.9, 0.1, "Double Click Vehicle to take it.", true, windowjob ) showCursor(false) guiSetVisible( windowjob, false ) guiWindowSetSizable( windowjob, false ) guiWindowSetMovable( windowjob, false ) vehicles = { {"Officer 1", 280}, {"Officer 2", 281}, {"Traffic officer", 284}, {"Swat", 285}, } grid = guiCreateGridList(0.01, 0.2, 0.99, 0.5, true, windowjob) guiGridListAddColumn(grid, "Skins", 0.85) for i,veh in ipairs(vehicles) do row = guiGridListAddRow(grid) -- guiGridListSetItemText(grid, row, 1, tostring(veh[1]), false, false) guiGridListSetItemData(grid, row, 1, tostring(veh[2])) end function get() local row, col = guiGridListGetSelectedItem(grid) if (row and col and row ~= -1 and col ~= -1) then local model = tonumber(guiGridListGetItemData(grid, row, 1)) if model ~= "" then triggerServerEvent("setSAPD", localPlayer, model) guiSetVisible(windowjob,false) showCursor(false) end end end addEventHandler("onClientGUIClick", button1, get, false) function close() if (source == button) then guiSetVisible(windowjob,false) showCursor(false) end end addEventHandler("onClientGUIClick", button, close) function SAPDgui() guiSetVisible(windowjob,true) showCursor(true) end addEvent("SAPDgui",true) addEventHandler("SAPDgui", getRootElement(), SAPDgui) addEventHandler("onClientMarkerHit", marker, SAPDgui) addEventHandler("onClientMarkerHit", marker1, SAPDgui) addEventHandler("onClientMarkerHit", marker2, SAPDgui) function SAPDjobleave(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) addEventHandler("onClientMarkerLeave", marker1, SAPDjobleave) addEventHandler("onClientMarkerLeave", marker2, SAPDjobleave) server afText = {} myTextItem = {} function warnText ( aWText, player ) if ( myTextItem[player] ) then textDestroyTextItem ( myTextItem[player]) end afText[player] = textCreateDisplay () textDisplayAddObserver( afText[player], player ) myTextItem[player] = textCreateTextItem ( aWText, 0.22, 0.8, 2 , 255, 0, 0, 255, 3 ) textDisplayAddText ( afText[player], myTextItem[player] ) -- outputChatBox ( textA, player ) setTimer ( textDestroyTextItem, 5000, 1, myTextItem[player], player ) end createBlip ( 1552.4996337891, -1677.3264160156, 15.1953125, 30 ) createBlip ( -1604.5458984375, 712.25848388672, 12.8671875, 30 ) createBlip ( 2340.9245605469, 2456.0463867188, 13.96875, 30 ) function createSAPDTeam () SAPDteam = createTeam ("police", 100, 149, 237) end addEventHandler ("onResourceStart", resourceRoot, createSAPDTeam) function joinSAPD(source, id) setPlayerTeam(source,SAPDteam) setElementModel(source, id) giveWeapon ( source, 3 ) playeraccount = getPlayerAccount( source ) setAccountData( playeraccount, "team", "police", true ) warnText("You are now SAPD agent.",source,0,255,0) end addEvent("setSAPD", true) addEventHandler("setSAPD",root,joinSAPD) function removeSAPD() setPlayerTeam(source, 0) takeWeapon(source, 3) playeraccount = getPlayerAccount(source) if not getAccountData(playeraccount, "standardskin") then setElementModel(source, 0) else setElementModel(source,getAccountData(playeraccount,"standardskin")) end warnText("You are now an unemployed.",source,255,0,0) end addEvent("removeSAPD", true) addEventHandler("removeSAPD",root,removeSAPD) function policeJob ( attacker, attackerweapon, bodypart, loss ) if attacker and getElementType(attacker) == "player" then 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 ) warnText( "You have been jailed by "..theCop.. " for 10 seconds.", source ) warnText( "You have jailed the criminal "..theName, attacker ) local playeraccount = getPlayerAccount ( attacker ) givePlayerMoney (attacker, 100 * theWL ) setTimer ( setElementPosition, 10000, 1, source, 1544.4332275391, -1674.7698974609, 13.688399200439) setPlayerWantedLevel (source, 0) end end end end addEventHandler ("onPlayerDamage", getRootElement(), policeJob)
  9. fixed by myself, thanks for the help
  10. it says bad argument on line 5
  11. what now? function showGUIp(hitPlayer) local playerTeam = getPlayerTeam( hitPlayer ) local teamName = getTeamName( playerTeam ) if teamName == "police" then triggerClientEvent (hitPlayer,"showGUI2p",getRootElement(),hitPlayer) else warnText("vehicles for police only!",hitPlayer) end end addEventHandler("onMarkerHit",markerp,showGUIp) addEventHandler("onMarkerHit",marker2p,showGUIp) addEventHandler("onMarkerHit",marker3p,showGUIp) addEventHandler("onMarkerHit",marker4p,showGUIp)
  12. why it says bad argument line 25 and 26? markerp = createMarker( 1556.9852294922, -1608.1356201172, 12.3828125, "cylinder", 2, 0, 0, 255, 255 ) marker2p = createMarker( 1570.1909179688, -1610.1462402344, 12.3828125, "cylinder", 2, 0, 0, 255, 255 ) marker3p = createMarker( 1584.61328125, -1608.2557373047, 12.3828125, "cylinder", 2, 0, 0, 255, 255 ) marker4p = createMarker( 1595.1407470703, -1607.5220947266, 12.3828125, "cylinder", 2, 0, 0, 255, 255 ) local vehicles = {} function spawnVehP(id) local x, y, z = getElementPosition(source) if isElement(vehicles[source]) then destroyElement(vehicles[source]) end vehicles[source] = createVehicle(id, x + 1, y, z) warpPedIntoVehicle(source, vehicles[source]) end addEvent("CreVehiceP",true) addEventHandler("CreVehiceP", root, spawnVehP) addEventHandler("onPlayerQuit", root, function() if isElement(vehicles[source]) then destroyElement(vehicles[source]) vehicles[source] = nil end end) local playerTeam = getPlayerTeam( source ) local teamName = getTeamName( playerTeam ) function showGUIp(hitPlayer) if teamName == "police" then triggerClientEvent (hitPlayer,"showGUI2p",getRootElement(),hitPlayer) else warnText("You nedd to be police to get a vehicle",source) end end addEventHandler("onMarkerHit",markerp,showGUIp) function showGUIp(hitPlayer) triggerClientEvent (hitPlayer,"showGUI2p",getRootElement(),hitPlayer) end addEventHandler("onMarkerHit",marker2p,showGUIp) function showGUIp(hitPlayer) triggerClientEvent (hitPlayer,"showGUI2p",getRootElement(),hitPlayer) end addEventHandler("onMarkerHit",marker3p,showGUIp) function showGUIp(hitPlayer) triggerClientEvent (hitPlayer,"showGUI2p",getRootElement(),hitPlayer) end addEventHandler("onMarkerHit",marker4p,showGUIp)
  13. i can see hte text from everywhere, is it possible to render the text when i'm close to them?
  14. local marker = createMarker( 1552.4996337891, -1677.3264160156, 15.1953125, "Cylinder", 1.5, 0, 0, 255, 150) local marker1 = createMarker( -1604.5458984375, 712.25848388672, 12.8671875, "Cylinder", 1.5, 0, 0, 255, 150) local marker2 = createMarker( 2340.9245605469, 2456.0463867188, 13.96875, "Cylinder", 1.5, 0, 0, 255, 150) addEventHandler ( "onClientRender", root, function ( ) local x1,y1,z1 = getElementPosition ( marker ) local x2,y2,z2 = getElementPosition ( marker1 ) local x3,y3,z3 = getElementPosition ( marker2 ) local screenWidth, screenHeight = guiGetScreenSize ( ) local x1_, y1_, dis = getScreenFromWorldPosition( x1, y1, z1 ) local x2_, y2_, dis = getScreenFromWorldPosition( x2, y2, z2 ) local x3_, y3_, dis = getScreenFromWorldPosition( x3, y3, z3 ) dxDrawText("police job", x1_, y1_,screenWidth,screenHeight, tocolor ( 0, 0, 0, 255 ), 1, "arial" ) dxDrawText("police job", x2_, y2_,screenWidth,screenHeight, tocolor ( 0, 0, 0, 255 ), 1, "arial" ) dxDrawText("police job", x3_, y3_,screenWidth,screenHeight, tocolor ( 0, 0, 0, 255 ), 1, "arial" ) end )
  15. sorry my bad, it works fine! sorry, two more questions, first is it possible to put the text over the marker? cause it uder it and on one of the sides second i cans see all the thext from evreywhere, can i render them when i'm closer?
  16. doesn't even spawn the markers (
  17. no give errors in debug but nothing local x1,y1,z1 = getElementPosition ( marker ) local x2,y2,z2 = getElementPosition ( marker1 ) local x3,y3,z3 = getElementPosition ( marker2 ) local screenWidth, screenHeight = guiGetScreenSize ( ) dxDrawText("police job", x1 + 2, y1 + 2,screenWidth,screenHeight, tocolor ( 0, 0, 0, 255 ), 1, "pricedown" ) dxDrawText("police job", x2 + 2, y2 + 2,screenWidth,screenHeight, tocolor ( 0, 0, 0, 255 ), 1, "pricedown" ) dxDrawText("police job", x3 + 2, y3 + 2,screenWidth,screenHeight, tocolor ( 0, 0, 0, 255 ), 1, "pricedown" )
  18. why not work? local marker = createMarker( 1552.4996337891, -1677.3264160156, 15.1953125, "Cylinder", 1.5, 0, 0, 255, 150) local marker1 = createMarker( -1604.5458984375, 712.25848388672, 12.8671875, "Cylinder", 1.5, 0, 0, 255, 150) local marker2 = createMarker( 2340.9245605469, 2456.0463867188, 13.96875, "Cylinder", 1.5, 0, 0, 255, 150) local x1,y1,z1 = getElementPosition ( marker ) local x2,y2,z2 = getElementPosition ( marker1 ) local x3,y3,z3 = getElementPosition ( marker2 ) dxDrawText("police job", x1 + 2, y1 + 2, z1 + 2, tocolor ( 0, 0, 0, 255 ) ) dxDrawText("police job", x2 + 2, y2 + 2, z2 + 2, tocolor ( 0, 0, 0, 255 ) ) dxDrawText("police job", x3 + 2, y3 + 2, z3 + 2, tocolor ( 0, 0, 0, 255 ) )
  19. now debug report attempt ot perform arithmetical on global distance
  20. still not working local marker = createMarker( 1552.4996337891, -1677.3264160156, 15.1953125, "Cylinder", 1.5, 0, 0, 255, 150) local marker1 = createMarker( -1604.5458984375, 712.25848388672, 12.8671875, "Cylinder", 1.5, 0, 0, 255, 150) local marker2 = createMarker( 2340.9245605469, 2456.0463867188, 13.96875, "Cylinder", 1.5, 0, 0, 255, 150) local x1,y1,z1 = getElementPosition ( marker ) local x2,y2,z2 = getElementPosition ( marker1 ) local x3,y3,z3 = getElementPosition ( maker2 ) dxDrawText("police job", x1 + 2, y1 + 2, z1 + 2, tocolor(0, 0, 0, 200), 2-(distance/20), "arial", "center", "center") dxDrawText("police job", x2 + 2, y2 + 2, z2 + 2, tocolor(0, 0, 0, 200), 2-(distance/20), "arial", "center", "center") dxDrawText("police job", x3 + 2, y3 + 2, z3 + 2, tocolor(0, 0, 0, 200), 2-(distance/20), "arial", "center", "center")
  21. DOESNT REPORT ANYTHING!
×
×
  • Create New...