Jump to content

S3M

Members
  • Posts

    64
  • Joined

  • Last visited

Everything posted by S3M

  1. S3M

    outputChatBox

    What do i wrong. Why not outputchat working? i see no errors in console. function nightstick(thePlayer) local skin = getElementModel ( thePlayer ) if skin == 280 or skin == 281 or skin == 282 or skin == 283 or skin == 284 or skin == 285 or skin == 286 or skin == 288 then giveWeapon(thePlayer, 3, 100, 1) else outputChatBox("You take the nightstick!", thePlayer, 255, 0, 0) end end addCommandHandler("stick", nightstick) Thx.
  2. Is it possible to use the vehicle in which a player is to glue on a moving object? like the resource: player on vehicle glued https://community.multitheftauto.com/index.php?p=profile&id=502 Need it for fix this: grtz
  3. S3M

    In search of

    Yes!! i go look that script. and thx again.
  4. S3M

    In search of

    some truck trailer job/mission. to bring trailer to other location for the money. Mission starts on wen trailer attached and ends on unhook trailer on a marker location, somethging like that. ThX
  5. S3M

    In search of

    Do you also know if there is an existing resource with a trailer job? ThX
  6. Hi, Is it possible or is there a functie tot quit the job? Thx.
  7. S3M

    In search of

    YES!!!!! this is the one THX
  8. S3M

    In search of

    A few years ago I had a resource which the player sometimes eat for health, otherwise he died. Does anyone know what this resource was? Thx
  9. Yes the script was working fine for me, only wanna change are invisible checkpoints. https://community.multitheftauto.com/index.php?p=resources&s=details&id=2053 thx.
  10. Hi, About rrtaxi job script. I use a rrtaxi script and i trying and trying to make the checkpoint invisible, but it is still not succeeded. i try to use: setMarkerColor(marker,r,g,b, 0) and setElementAlpha(marker,0) etc, but it still visible yellow checkpoints. i want set it invisible becouse it's so ugly and the blip on the radar is sufficient enough. I do not get it, so many markers on my scripts i make invisible markers but in this script, I manage not. Can any make me happy? addEventHandler("onResourceStart", getResourceRootElement(getThisResource()), function() chauffeurSkins = { [253]=true, [255]=true, [165]=true } taxis = { [420]=true, [438]=true } playerClients = { } playerCols = { } playerBlips = { } jobClients = { } playerJobLocation = { }; local XMLTaxiLocations = xmlLoadFile ( "XML\\taxi_locations.xml" ) if ( not XMLTaxiLocations ) then local XMLTaxiLocations = xmlCreateFile ( "XML\\taxi_locations.xml", "taxi_locations" ) xmlSaveFile ( XMLTaxiLocations ) end local taxi_locations = xmlNodeGetChildren(XMLTaxiLocations) taxiLocations = {} for i,node in ipairs(taxi_locations) do taxiLocations[i] = {} taxiLocations[i]["x"] = xmlNodeGetAttribute ( node, "posX" ) taxiLocations[i]["y"] = xmlNodeGetAttribute ( node, "posY" ) taxiLocations[i]["z"] = xmlNodeGetAttribute ( node, "posZ" ) taxiLocations[i]["r"] = xmlNodeGetAttribute ( node, "rot" ) end xmlUnloadFile ( XMLTaxiLocations ) end ) function enterVehicle ( thePlayer, seat, jacked ) if ( taxis[getElementModel ( source )] ) and ( not chauffeurSkins[getElementModel ( thePlayer )] ) and (seat == 0) then cancelEvent() outputChatBox ( "only taxi drivers can enter!", thePlayer ) end end addEventHandler ( "onVehicleStartEnter", getRootElement(), enterVehicle ) function startJob ( playerSource ) local x, y, z = getElementPosition ( playerSource ) if ( chauffeurSkins[getElementModel ( playerSource )] ) then if not playerClients[ playerSource ] then local numLocations = #taxiLocations if ( numLocations > 0 ) then repeatCount = 0; repeat local pickupPoint = math.random(numLocations) pickupx = taxiLocations[pickupPoint]["x"] pickupy = taxiLocations[pickupPoint]["y"] pickupz = taxiLocations[pickupPoint]["z"] pickupr = taxiLocations[pickupPoint]["r"] local jobDistance = getDistanceBetweenPoints3D ( x, y, z, pickupx, pickupy, pickupz ); repeatCount = repeatCount+1 until jobDistance > 100 and jobDistance < 800 + repeatCount*100 repeat local id = math.random( 10, 270 ) ped = createPed( tonumber( id ), pickupx, pickupy, pickupz ) setPedRotation ( ped, pickupr ) until ped playerClients[ playerSource ] = { }; table.insert( playerClients[ playerSource ], ped ); table.insert( jobClients, ped ); local pedBlip = createBlipAttachedTo ( ped, 56, 2, 255, 0, 0, 255, 1, 99999.0, playerSource) playerBlips[ playerSource ] = { }; table.insert( playerBlips[ playerSource ], pedBlip ); pedMarker = createMarker ( pickupx, pickupy, 0, cylinder, 5.0, 255, 255, 0, 10, playerSource) playerCols[ playerSource ] = { }; table.insert( playerCols[ playerSource ], pedMarker ); addEventHandler( "onMarkerHit", pedMarker, arrivePickup ) outputChatBox ( "pickup the passenger located at the yellow blip.", playerSource ); else outputChatBox ( "no passenger pickup points specified, contact an admin!", playerSource ); end else outputChatBox ( "you allready have an assignment!", source ); end else outputChatBox ( "you don't have a job!", source ); end end addCommandHandler ("startjob", startJob); function arrivePickup ( playerSource ) if playerClients[ playerSource ] then for k, ped in pairs( playerClients[ playerSource ] ) do if ped then local x,y,z = getElementPosition(ped); local tx,ty,tz = getElementPosition(playerSource); setPedRotation(ped, findRotation(x,y,tx,ty) ); local numLocations = #taxiLocations if ( numLocations > 0 ) then local playerVehicle = getPedOccupiedVehicle ( playerSource ); if playerVehicle and taxis[getElementModel ( playerVehicle )] then local speedx, speedy, speedz = getElementVelocity ( playerSource ); local actualspeed = (speedx^2 + speedy^2 + speedz^2)^(0.5); if actualspeed < 0.25 then local occupants = getVehicleOccupants(playerVehicle); local seats = getVehicleMaxPassengers(playerVehicle); local freeSeats = 0; for seat = 0, seats do local occupant = occupants[seat]; if not occupant and tonumber(freeSeats) == 0 then freeSeats = freeSeats + 1; warpPedIntoVehicle ( ped, playerVehicle, seat ); if playerBlips[ playerSource ] then for k, blip in pairs( playerBlips[ playerSource ] ) do if blip then destroyElement( blip ); playerBlips[ playerSource ] = nil; end end end if playerCols[ playerSource ] then for k, col in pairs( playerCols[ playerSource ] ) do if col then destroyElement( col ); playerCols[ playerSource ] = nil; end end end playerJobLocation[ playerSource ] = { }; playerJobLocation[ playerSource ] = { ["x"]=x, ["y"]=y, ["z"]=z }; repeat local dropOffPoint = math.random(numLocations) dropOffx = taxiLocations[dropOffPoint]["x"] dropOffy = taxiLocations[dropOffPoint]["y"] dropOffz = taxiLocations[dropOffPoint]["z"] local jobDistance = getDistanceBetweenPoints3D ( x, y, z, dropOffx, dropOffy, dropOffz ); until jobDistance > 1000 and jobDistance < 35000 local dropOffBlip = createBlip ( dropOffx, dropOffy, dropOffz, 56, 2, 255, 0, 0, 255, 1, 99999.0, playerSource) playerBlips[ playerSource ] = { }; table.insert( playerBlips[ playerSource ], dropOffBlip ); pedMarker = createMarker ( dropOffx, dropOffy, 0, arrow, 3.5, 255, 255, 0, 1, playerSource) playerCols[ playerSource ] = { }; table.insert( playerCols[ playerSource ], pedMarker ); addEventHandler( "onMarkerHit", pedMarker, arriveDropOff ) outputChatBox ( "drive your passenger to the yellow destination blip.", playerSource ); end end if tonumber(freeSeats) == 0 then outputChatBox ( "You don't have an empty seat for the passenger!", playerSource ); end else outputChatBox ( "slow down to pick up the passenger!", playerSource ); end else outputChatBox ( "you do not have a taxi vehicle!", playerSource ); end else outputChatBox ( "no passenger pickup points specified, contact an admin!", playerSource ); end end end end end function arriveDropOff ( playerSource ) if playerClients[ playerSource ] then for k, ped in pairs( playerClients[ playerSource ] ) do if ped then local pedVehicle = getPedOccupiedVehicle ( ped ); local playerVehicle = getPedOccupiedVehicle ( playerSource ); if playerVehicle and taxis[getElementModel ( playerVehicle )] then if pedVehicle == playerVehicle then local speedx, speedy, speedz = getElementVelocity ( playerSource ); local actualspeed = (speedx^2 + speedy^2 + speedz^2)^(0.5); if actualspeed < 0.15 then removePedFromVehicle ( ped ); if playerClients[ playerSource ] then for k, ped in pairs( playerClients[ playerSource ] ) do if ped then destroyElement( ped ); playerClients[ playerSource ] = nil; end end for k, blip in pairs( playerBlips[ playerSource ] ) do if blip then destroyElement( blip ); playerBlips[ playerSource ] = nil; end end for k, col in pairs( playerCols[ playerSource ] ) do if col then destroyElement( col ); playerCols[ playerSource ] = nil; end end dx = tonumber(playerJobLocation[ playerSource ]["x"]); dy = tonumber(playerJobLocation[ playerSource ]["y"]); dz = tonumber(playerJobLocation[ playerSource ]["z"]); local tx,ty,tz = getElementPosition(playerSource); local jobDistance = getDistanceBetweenPoints3D ( dx, dy, dz, tx, ty, tz ); local jobDistanceKM = round(jobDistance/1000,2); local jobReward = round(10+(jobDistanceKM^0.75)*30); givePlayerMoney ( playerSource, jobReward ); for k, jobLocation in pairs( playerJobLocation[ playerSource ] ) do if jobLocation then playerJobLocation[ playerSource ] = nil; end end outputChatBox ( "job succesful, you earned "..jobReward.." dollar.", playerSource ); end else outputChatBox ( "slow down to drop off the passenger!", playerSource ); end else outputChatBox ( "you have lost your passenger!", playerSource ); end else outputChatBox ( "you do not have a taxi vehicle!", playerSource ); end end end end end function quitJob ( playerSource ) if playerClients[ playerSource ] then for k, ped in pairs( playerClients[ playerSource ] ) do if ped then destroyElement( ped ); playerClients[ playerSource ] = nil; end end for k, blip in pairs( playerBlips[ playerSource ] ) do if blip then destroyElement( blip ); playerBlips[ playerSource ] = nil; end end for k, col in pairs( playerCols[ playerSource ] ) do if col then destroyElement( col ); playerCols[ playerSource ] = nil; end end if playerJobLocation[ playerSource ] then for k, jobLocation in pairs( playerJobLocation[ playerSource ] ) do if jobLocation then destroyElement( jobLocation );
  11. S3M

    Hello there

    createBlip ( 2480.8781738281,-1536.7038574219,24.189489364624, 60 ) local MarkerTaxi2 = createMarker( 2478.3999023438, -1513.6999511719, 23.10000038147, "cylinder", 4, 255, 255, 255, 15) local Taxigate1 = createObject(994, 2475.3000488281, -1514.4000244141, 23) function MarkerHit1(hitElement, matchingDimension) if getElementType(hitElement) == "player" then local vehicle = getPedOccupiedVehicle ( player ) if vehicle or not vehicle then local skin = getElementModel ( player ) if skin == 255 then moveObject(Taxigate1, 3000, 2475.3000488281, -1514.4000244141, 22.1 ) end end end end addEventHandler ( "onMarkerHit", MarkerTaxi2, MarkerHit1 ) function MarkerLeave1(leaveElement, matchingDimension) if getElementType(hitElement) == "player" then local vehicle = getPedOccupiedVehicle ( player ) if vehicle or not vehicle then local skin = getElementModel ( player ) if skin == 255 then moveObject(Taxigate1, 3000, 2475.3000488281, -1514.4000244141, 23) end end end end addEventHandler ( "onMarkerLeave", MarkerTaxi2, MarkerLeave1 ) What i do wrong? The gates want go down iff player have driver skin 255
  12. S3M

    Hi all

    Sorry yes i mean with 50p bank system.
  13. S3M

    Hi all

    Hi all. Is it possible to make a rank bankmoney top 5 that views which player have the most bankmoney on screen?. See image. Which way on wiki would i be looking? or are there is already a usable resource for this kind of scoreboard on screen? Thx.
  14. Yes everyone incl me are registed and logged in Very pity that I can not start without that resource gives problems. Axel? you use the vehiclesystemcarshops? if yes? wich gamemode you using?
  15. Hi all, I want use the vehiclesystemcarshops resource(https://community.multitheftauto.com/index.php?p=resources&s=details&id=2604) on the server, but unfortunately it give a problem. Wen i start this resource then the existing vehicles on the map don't respawn anymore. It give this 3 warnings on console: - after a vehicle on map explode: WARNING: vehiclesystemcarshops\guiS.lua:71: Bad argument @ 'getPlayerAccount' [Expected element at argument 1, got boolean] WARNING: vehiclesystemcarshops\guiS.lua:71: Bad argument @ 'getAccountName' [Expected account at argument 1, got boolean] - if time for respawn then is says on console: WARNING: Bad 'element' pointer @ 'respawnVehicle'(1) I try other gamemodes, like play, hay, and cdm. but the problem stays the same. Someone knows this problem?
  16. S3M

    Show bank money

    Ohw yeah!!!! ThX you very very much toooooooo
  17. S3M

    Show bank money

    yes! like if player typ /money then al players see "playername $money" Thx
  18. S3M

    Show bank money

    Whaaaa!!! ThX m8.... Now wen i typ /money then al players on server see this? then it is good
  19. S3M

    Show bank money

    Hi there, I using bank system made by 50p on server. Now i want that is shows al player bankmoney in chat wen player typ /money Someone can make this code for me? THX
  20. S3M

    Timer problem?

    Hi there, A have one problem on this safezone lua code. Wen a player is in safezone and he goes logout then i get this warrnig in server console: WARNING: Bad 'element' pointer @ 'setPedArmor'(1) WARNING: Bad 'element' pointer @ 'setElementHealth'(1) Where is the problem? local timers = { } -- somewhere at the top of script function Place(name) if name ~= getThisResource() then return else local marker = createMarker ( 2025.0999755859, -1423, -14, "cylinder", 55, 255, 0, 0, 25 ) end end function Health( hitElement, matchingDimension) if ( getElementType ( hitElement ) == "player" ) then timers[ hitElement ] = setTimer( setElementHealth, 350, 0, hitElement, 100 ) timers[ hitElement ] = setTimer( setPedArmor, 350, 0, hitElement, 100 ) toggleControl (hitElement, "fire", false) toggleControl (hitElement, "next_weapon", false) toggleControl (hitElement, "previous_weapon", false) toggleControl (hitElement, "aim_weapon", false) toggleControl (hitElement, "vehicle_fire", false ) showPlayerHudComponent (hitElement, "ammo", false) showPlayerHudComponent (hitElement, "weapon", false) triggerClientEvent (hitElement, "enableGodMode", hitElement) outputDebugString (getPlayerName(hitElement) .. " has entered the safezone") end end function health_stop (leaveElement, matchingDimension) if ( getElementType ( leaveElement ) == "player" ) then -- not really needed. just to prevent killing non-existing timers killTimer( timers[ leaveElement ] ) toggleControl (leaveElement, "fire", true) toggleControl (leaveElement, "next_weapon", true) toggleControl (leaveElement, "previous_weapon", true) toggleControl (leaveElement, "aim_weapon", true) toggleControl (leaveElement, "vehicle_fire", true ) showPlayerHudComponent (leaveElement, "ammo", true) showPlayerHudComponent (leaveElement, "weapon", true) triggerClientEvent (leaveElement, "disableGodMode", leaveElement) outputDebugString (getPlayerName(leaveElement) .. " has left the safezone") end end Col = createColSphere ( 2030.0999755859, -1417, -14, 45.0 ) addEventHandler ( "onColShapeHit", Col, Health ) addEventHandler ( "onColShapeLeave", Col, health_stop) addEventHandler ( "onResourceStart", getRootElement(), Place)
  21. S3M

    Looking 4

    but its spawn the player who's in table too. if i use resource cdm/play then first it use the table, after team choice/enter to join, the player in table goes to the spawnpoint too, to the spawnpoint what is set in the cdm/play resource. i hope you understand my explanation. maybe you must try this code/script on play/cdm mode
  22. S3M

    Looking 4

    THX Solidsnake14 this works ... only now a problem with the spawnpoint that i have in resource cdm or play. Maybe i must only use this, but then i mis the player spawnpoint who not this table you made. you ( Solidsnake14) know a solution for this?
  23. S3M

    Looking 4

    Searching for the solution, try and try again, but I get this spawn points idea is not good. For 4 years ago was to make a script easier. Is there something changed in mta: sa causing some command no longer function? or am I so stupid and forgetful. Meanwhile I have found this script, it's almost the same idea that I want, I just want some player their own position / spawn point without a vehicle. vehicle1 = createVehicle ( 506, 2506.3994140625, -1651.6337890625, 13.603052139282 ) --here you can change car model and car's coordinates (where it's gonna be) --addVehicleUpgrade ( vehicle1, 1010 ) -- if you want to add an upgrade to certain vehicle setVehicleColor ( vehicle1, 0, 0, 0, 0 ) -- for changing vehicle colour, first '0' is for main vehicle colour setElementData(vehicle1, "owner", "S3M") --"account" replace with player's account name function onLockedVehicleEnter ( player, seat, jacked ) if getElementData(source, "owner") and getElementData(source, "owner" ) ~= getAccountName(getPlayerAccount(player)) and ( seat == 0 ) then outputChatBox ("* VEHICLE * You may not use this vehicle as it belongs to: "..tostring(getElementData(source, "owner" )), player, 255, 0, 0) cancelEvent() end end addEventHandler ( "onVehicleStartEnter", getRootElement(), onLockedVehicleEnter ) How do i change this to only with player spawnpoint on name, onjoin, and onplayerdie.
×
×
  • Create New...