Jump to content

Ride1234

Members
  • Posts

    31
  • Joined

  • Last visited

Everything posted by Ride1234

  1. It looks like what i need, i'll try it soon, thank you
  2. look what i need: i need to calculate the angle, and do not find players current rotation.
  3. i need to rotate the whole player, not only his head
  4. I've tried math.abs(90+ math.deg( math.acos( math.abs(yvalbig-yvalsm)/(math.sqrt( (math.abs(xvalbig-xvalsm))^2 +(math.abs(yvalbig-yvalsm))^2))))) result - rotation is wrong.
  5. Good day, scripters First, i know about setPedRotation and about wiki.multitheftauto.com too. I want to rotate my ped to some point and make him look straight at it, but dont know how to calculate the angle of rotation. Can anyone help me? P.S. I want to make a universal function that calculates rotation for any coordinates, so calculate rotation manually isn't a variant.
  6. Thanka, it works. My code: setTimer(toggleControl,1000,1,source, "fire", false) setTimer(toggleControl,1000,1,source, "enter_exit", false)
  7. Hello, i'm writing a script and have problems. How to disable fighting animations (e.g. like in BaseMode's lobby)?
  8. Yes it is.. btw, i solved the problem by moving my map to san andreas'es boundaries. it was about -3500 on X and now its about -1600.
  9. Hello, i have a problem with melee weapons. When i'm in the interior (lobby in my script) they works fine, but when i'm on the my map (created using mta editor) melee weapons doesn't work (there is animation, but no damage). Other weapons such as pistols, machineguns, shotguns, flamethorews, etc works fine. There are no canceled events in my code. Why its happens? Here is my onPlayerSpawn code: if(started == true) then if(skin[source] == 0 and var3[player] == nil ) then setElementPosition(source,x,y,z) setElementModel(source,skin1) else setElementPosition(source,x,y,z) setElementModel(source,skin2) end if(var3[source] ~= nil) then -- pb var3 if(var3[source] == 1) then setElementPosition(source,x,y,z) setElementModel(source,model2) setTimer(giveWeapon,1000,1,source,9,1,true) elseif(var3[source] == 2) then setElementPosition(source,x,y,z) setElementModel(source,model2) setTimer(giveWeapon,1000,1,source,8,1,true) elseif(var3[source] == 3) then setElementPosition(source,x,y,z) setElementModel(source,model2) setTimer(giveWeapon,1000,1,source,36,50000,true) end triggerClientEvent(source,"dxSpawnText",getRootElement()) setElementData(source, "status", "In Game") end setElementInterior(source,0) else -- not started (lobby) if(skin[source] == 0) then setElementPosition(source,x,y,z) setElementModel(source,skin1) else setElementPosition(source,x,y,z) setElementModel(source,skin2) end setElementInterior(source,3) setElementData(source, "status", "In Lobby") end setPlayerNametagShowing(source, false) setCameraTarget(source) setPedFrozen(source,false) toggleAllControls (source, true)
  10. is it possible to play custom sound loaded from mp3 file for all clients?
  11. Hello, it may be stupid question, but can anyone tell me how to freeze game clock? I set time using setTime, and set a veeeery long minute ( setMinuteDuration(6000000) ) But is it possible to completely freeze it?
  12. Hello Is it possible to send a message to all players from client side without triggering a server side? outputChatBox("#FFFFAA> Plater "..getPlayerName(player).." is bla bla bla #FFFFFF"..place.."bla #FFFFAA bla bla bla", 0, 0, 0, true) of course this code sends message only to me.
  13. Thank you, and all guys who helped me. It's works with colshapes.
  14. I tried, but when one player pick ups the pickup it destroys for all players. Code: server side: triggerClientEvent(val,"createKeys",getRootElement()) client side: function createKeys2() key[1] = createPickup (-3231.484131,-2383.058105,81.289009,3,1272,9999999999) cls[1] = createColCircle ( -3231.484131,-2383.058105, 2.5 ) end addEvent("createKeys",true) addEventHandler( "createKeys", getRootElement(), createKeys2 ) function onClientColShapeHit() if(source == cls[1]) then outputChatBox("1",getLocalPlayer()) destroyElement(key[1]) destroyElement(cls[1]) end end addEventHandler("onClientColShapeHit",getRootElement(),onClientColShapeHit) pickup and colshape destroys for all players, and message sends too.
  15. I tried to destroy picked up pickup then create it again and hide to player, who picked up, bit it didn't work . Here is my code: function onPickupPickup(player) if(source == pickup[1]) then --[[ here is pickup's actions ]] destroyElement(pickup[1]) pickup[1] = createPickup (-3381.484131,-1083.058105,95.289009,3,1272,99999999999) -- i created the same pickup like it was setElementVisibleTo(pickup[1], getRootElement(), true) setElementVisibleTo(pickup[1], player, false) -- and hided it to player , who picked it up end end Pick up appeared again , but was not pickupable.. So i guess mta doesn't support per-player pickups..
  16. Hello, I create pickups and have some problem with it. When I create pickup using server function createPickup it creates and works great, but if someone pick it up , it disappears on the all players. But I want, that every player can pick ip up, and these pickup wouldn't disappear on the other players. I mean, that each player can pick it up only one time. How to do it? p.s. if create pickup on client side it doesn't pick up.
  17. create it client side, this me one time Thanks, Ill try.
  18. setElementVisibleTo doesn't work with objects, but how to create object, visible only to selected players?
  19. Hi again, I have a little problem with setPedFrozen function. I try to freeze ny player: setPedFrozen(player,true) He freezes, but... can shoot, jump etc, but he cant change his coordinates.. Its looks like he is in box or someting. Is it a bug or a MTA feature?
  20. Thanks everyone for help. So here is small manual for beginners like me. Create an array: playerBlips = { } and put this code in the function you need (or maybe create timer) for index,value in ipairs(getElementsByType("player")) do if( playerBlips [ value ] ) then destroyElement( playerBlips[ value ] ) playerBlips [ value ] = nil end playerBlips[ value ] = createBlipAttachedTo ( value, 59 ) setElementVisibleTo(playerBlips[value],getRootElement( ),false) if(getTeamName(getPlayerTeam(value)) == "Terrorists") then for index1,value1 in ipairs(getElementsByType("player")) do if(getTeamName(getPlayerTeam(value1)) == "Terrorists") then setElementVisibleTo(playerBlips[value],value1,true) end end elseif(getTeamName(getPlayerTeam(value)) == "Cops") then for index1,value1 in ipairs(getElementsByType("player")) do if(getTeamName(getPlayerTeam(value1)) == "Cops") then setElementVisibleTo(playerBlips[value],value1,true) end end end end and of course you need to delete blip when player exit or die, using this code: if (playerBlips[source]) then destroyElement(playerBlips[source]) playerBlips[source] = nil end It works fine with me. P.S. And sorry for my bad english
  21. I create a blip, it's visible by all players: icons[source] = createBlipAttachedTo(source,58) then in other functuion (it invokes be typing command) i try to set blip visible to selected players: for idx,value in ipairs(getElementsByType("player")) do if(getTeamName(getPlayerTeam(value)) == "Terrorists") then setElementVisibleTo ( icons[value], getRootElement ( ), false ) setElementVisibleTo( icons[value], getPlayerTeam(value),true) elseif (getTeamName(getPlayerTeam()) == "Cops") then setElementVisibleTo ( icons[value], getRootElement ( ), false ) setElementVisibleTo( icons[value], getPlayerTeam(value),true) end end And... it doesn't work. Where is my fail?
  22. Hi, I'm making tdm mode, and try to create blips on the radar which will be visible only to player's team (so, player can see on the radar only his team-mates), but when I try to make blip visible to player's team, the blip don't wants to create. There are no errors or warnings in server's log. My code (it's it onPlayerSpawn event): if(getTeamName(getPlayerTeam(source)) == "Terrorists") then icons[source] = createBlipAttachedTo(source,59,0,255,0,0,255,0,99999.0,getPlayerTeam(source)) elseif (getTeamName(getPlayerTeam()) == "Cops") then icons[source] = createBlipAttachedTo(value,61,1,0,0,255,255,0,99999.0,getPlayerTeam(source)) end if I create blip without last argument, it creates, but visible to all players. Can anyone help me?
×
×
  • Create New...