Jump to content

DakiLLa

Members
  • Posts

    965
  • Joined

  • Last visited

Everything posted by DakiLLa

  1. why i have warnings in 26, 10, 11 and 12 lines when resource start ?
  2. ok..i think that element data's is not needed now, so, i deleted it. Script without data's function creating ( weapon, ammo, ammoInClip, hitX, hitY, hitZ, hitElement ) if ( not isElement ( enterMarker ) ) and ( weapon == 27 ) then enterMarker = createMarker ( hitX, hitY, hitZ, "ring", 2.0, 255, 0, 0, 150 ) outputChatBox ( "You have created a first portal!", 255, 0, 0 ) elseif ( isElement ( enterMarker ) ) then exitMarker = createMarker ( hitX, hitY, hitZ, "ring", 2.0, 0, 0, 255, 150 ) outputChatBox ( "You have created a second portal!", 255, 0, 0 ) end end addEventHandler ( "onClientPlayerWeaponFire", getRootElement(), creating ) and now, i need code for teleporting from first marker to second. I have one, but it have errors in eventHandler, like bad argument "enterMarker" and "exitMarker". I dont need to teleport from all markers, so, i didnt wrote getRootElement. function Teleporting ( thePlayer, matchingDimension ) local EnposX, EnPosY, EnPosZ = getElementPosition ( enterMarker ) setElementPosition ( thePlayer, EnposX, EnPosY, EnPosZ ) end addEventHandler ( "onClientMarkerHit", enterMarker, Teleporting ) function reteleporting ( thePlayer, matchingDimension ) local ExposX, ExPosY, ExPosZ = getElementPosition ( exitMarker ) setElementPosition ( thePlayer, ExposX, ExPosY, ExPosZ ) end addEventHandler ( "onClientMarkerHit", exitMarker, reteleporting )
  3. debugscript is clear, and it's client side and what? i have tested outputChatBox ( "1" ) without all, but nothing
  4. oops. in line 17 i mean: if ( getData == 1 ) then ... if ( getData == 2 ) then ... "onClientPlayerJoin" ye, i have forgotten to use this function in client side and all the same..i cant see a message in chatbox when i connect to the server, so, script doesnt work from first lines...
  5. Hi there! I have an idea: portal gun like in Portal game i have made some script but it doesn not work, there is errors in code i think..i dont know, but i think that i have errors in get element positions of created markers too. can you help me to realise this script? I think it can be a nice gamemode with diffrent maps in future if i'll finish this script. delay = 10000 function setDataOnJoin ( ) setElementData ( source, "playerData", 1 ) outputChatBox ( "Your data was set to 1", source, 255, 255, 0 ) end addEventHandler ( "onPlayerJoin", getRootElement (), setDataOnJoin ) function creating ( weapon, ammo, ammoInClip, hitX, hitY, hitZ, hitElement ) local getData = getElementData ( source, "playerData" ) if ( getData == 1 ) then if ( weapon == 27 ) then enterMarker = createMarker ( hitX, hitY, hitZ, "ring", 255, 0, 0 ) addEventHandler ( "onMarkerHit", enterMarker, teleporting ) setElementData ( source, "playerData", 2 ) outputChatBox ( "You have created a first portal!", source, 255, 0, 0 ) if ( getData == 1 ) then local hEhitX, hEhitY, hEhitZ = getElementPosition ( hitElement ) exitMarker = createMarker ( hEhitX, hEhitY, hEhitZ, "ring", 0, 0, 255 ) outputChatBox ( "You have created a second portal!", source, 255, 0, 0 ) setElementData ( source, "playerData", 1 ) addEventHandler ( "onMarkerHit", exitMarker, reTeleporting ) end end end setTimer ( destroyElement, delay, 1, enterMarker ) setTimer ( destroyElement, delay, 1, exitMarker ) end addEventHandler ( "onClientPlayerWeaponFire", getRootElement(), creating ) function teleporting ( thePlayer, matchingDimension ) local ExposX, ExPosY, ExPosZ = getElementPosition ( exitMarker ) setElementPosition ( thePlayer, ExposX, ExPosY, ExPosZ ) end function reTeleporting ( thePlayer, matchingDimension ) local EnposX, EnPosY, EnPosZ = getElementPosition ( enterMarker ) setElementPosition ( thePlayer, EnposX, EnPosY, EnPosZ ) end
  6. oO thx Mr.Hankey! See, it's not too difficult!
  7. i saw this function on Revolution Crew server, and I thought that is not difficult..but if it is, so, i go to learn mysql
  8. i speak about Race module in Deathmatch which based on Lua too
  9. Hi. I have two questions about Race module in Mta deathmatch: -How to make non-tight cars like in TrackMania? with this function easy to drive on map and make your own time records which i need cse we have championships on our server. -And second: Is anybody have table of records for any map? i saw it on one server, but i think it's too difficult for me to make it, so, can any help me to make simple table of records for race-maps in dm?
  10. we all know that setAccountData deletes all accounts in accounts.acl but there is difficult to find any account data base or make own, but a few people know how to make it. So, should be another ways to solve this problem. post by lil Toady: setAccountData deletes stuff if you set data on a guest account, so check if player's accounts is guest one before setting data? i use that on my server and never had problems quick fix _setAccoutData = setAccounData function setAccountData ( account, data, value ) if ( not isGuestAccount ( account ) ) then return _setAccountData ( account, data, value ) end return false end I have this: function onQuit ( account, data, value ) local account = getClientAccount ( source ) if ( account ) then if ( not isGuestAccount ( account ) ) then local playermoney = getPlayerMoney ( source ) return setAccountData ( account, "lvdm.money", playermoney ) end return false end end function onJoin ( account, data, value ) local account = getClientAccount ( source ) if ( account ) then if ( not isGuestAccount ( account )) then local playermoney = getAccountData ( account, "lvdm.money" ) if ( playermoney ) then setPlayerMoney ( source, tonumber ( playermoney ) ) end end end end addEventHandler ( "onPlayerQuit", getRootElement (), onQuit ) addEventHandler ( "onPlayerJoin", getRootElement (), onJoin ) but all the same this function deletes accounts. may be i have mistakes in this code..So, if help, guys, to find them, it will be really useful script for more people who make their own rpg game styles. If it's impossible to solve this stupid bug - hm..waiting for dp3...
  11. how to check vehicle ID when player in vehicle hits marker ? dftVehicle = { [578]=true } function MarkerHit ( player, vehicle, seat, jacked ) local OccVehicle = getPlayerOccupiedVehicle ( player ) if ( OccVehicle ) then if ( dftVehicle[getVehicleID(vehicle)] ) and source == Marker then outputChatBox ( "Checked!" ) end end end addEventHandler ( "onMarkerHit", getRootElement (), MarkerHit ) not works only warning in 'getVehicleID. correct me.
  12. DakiLLa

    GUI question

    how can i set visibility of button for all players not for only local player ? .... if ( source == ButtonOne ) then guiSetVisible ( ButtonOne, false ) this disable button only for one player, who clicked buttonOne, but how to disable this button for all players when anybody clicked on it? i think it's not possible or not?
  13. ok, i have fixed this but all the same errors: warning: bad 'player' pointer @ 'getPlayerMoney' (1) error: attempt to compare boolean with number EDIT: yea, it works, problem in this line: triggerServerEvent ( "MaxHealth", getRootElement (), getLocalPlayer () ) should be triggerServerEvent ( "MaxHealth", getLocalPlayer () ) thanks for help, Ace!
  14. I have a gui window with button: ....... if ( source == HealthButton ) then triggerServerEvent ( "MaxHealth", getRootElement () ) and i need to set max health when click on button, but have two errors: addEvent ( "MaxHealth", true ) function SetMaxHealth ( thePlayer ) local money = getPlayerMoney ( thePlayer ) if (money < 2000) then outputChatBox ( "You don't have enough money!", thePlayer, 255, 0, 0 ) else setPlayerStat ( thePlayer, 24, 999 ) outputChatBox ( "Now your health set to Max!", thePlayer, 255, 255, 0 ) end end addEventHandler ( "MaxHealth", getRootElement (), SetMaxHealth ) Warning: Bad argument @ 'getPlayerMoney' - line: 5 Error: ..line6: attempt to compare a boolean with number. can anybody help?
  15. uh, i dont remember to put some stars for a player before strike of nightstik but toggleAllControls shows Warning bad Argument in this line. and message "You are free..." shows for ALL people, not for criminal person.
  16. Guys, need help. I want to make an arrest scene. There is some script but it's not work. Can you help ? function Arrest ( attacker, weapon, bodypart ) if isElement(attacker) and getElementType(attacker) == "player" then if ( weapon == 3 and getPlayerSkin ( attacker ) >= 280 ) then if ( getPlayerWantedLevel ( source ) > 0 ) then setPlayerWantedLevel ( source, 0 ) setElementPosition ( source, -1982.1209, 130.7857, 27.6875 ) outputChatBox ( "You have been arrested.", source, 255, 0, 0 ) toggleAllControls ( source, true ) end end end setTimer ( DisableControls, 30000, 1 ) end addEventHandler ( "onPlayerDamage", getRootElement (), Arrest ) function DisableControls () toggleAllControls ( source, false ) outputChatBox ("You are free now. Please, dont become a criminal in next time.", source, 0, 255, 0 ) end
  17. try this: function countdownRec(count) if (count > 0) then outputChatBox(tostring(count), getRootElement(), 255, 255, 255) setTimer(countdownRec, 1000, 1, count-1) else outputChatBox("Go Go Go!!!", getRootElement(), 255, 255, 255) end end function countdown() countdownRec(5) end addCommandHandler("count", countdown)
  18. DakiLLa

    GUI question

    is it possible to check if gui button already clicked ?
  19. DakiLLa

    GUI question

    i solved all problems, thanks for information, Gamesnert, it helped.
  20. DakiLLa

    GUI question

    questions not ended how to make visible gui window only for player who hits the marker? addEvent ("onHit", true ) addEventHandler ("onHit", getResourceRootElement (getThisResource () ), -- ? function () ...guiCreateWindow.... end ) and how to check the vehicle without a driver in marker such as gas-trailer ? local cargoTrailer = createVehicle ( 584, -2244.660, -2569.4152, 33.003, 0, 0, 75 ) local FinishMarker = createMarker ( -56.6132, -1135.7636, 1.0781, "cylinder", 2.0, 0, 255, 0, 150 ) function TruckMarkerHit ( cargoTrailer, mathcingDimension ) if cargoTrailer == FinishMarker then destroyElement ( cargoTrailer ) end end addEventHandler ( "onMarkerHit", FinishMarker, TruckMarkerHit ) ..not works.
  21. DakiLLa

    GUI question

    yeah!! it works! thanks all for help
  22. DakiLLa

    GUI question

    uh..lol. right.. it works and when i hit marker - Warning: bad argument @ triggerClientEvent what elements i need to put into trigger ? function MarkerHit ( MyMarker, matchingDimension ) if (getMarkerType(MyMarker) == "cylinder") then triggerClientEvent ( "onHit", .... ) -- something there but i dont know what.. ? end end addEventHandler ( "onPlayerMarkerHit", getRootElement (), MarkerHit )
  23. DakiLLa

    GUI question

    and..what you mean ?
  24. DakiLLa

    GUI question

    you think right, bart, it works but another problem: when i hiting the marker nothing not occurses. function HitMarker ( TruckMarker, matchingDimension ) if ( getMarkerType ( TruckMarker ) == "cylinder" ) then triggerClientEvent ( thePlayer, "ColHit", getRootElement () ) -- may be in this line mistake ?... end end addEventHandler ( "onPlayerMarkerHit", TruckMarker, HitMarker ) addEventHandler ( "ColHit", getResourceRootElement (getThisResource() ), -- ...or in this? function TRUCK_GUI () TruckWindow = guiCreateWindow(378,251,287,114,"Job: Truck Driver",false) TruckButtonYes = guiCreateButton(0.2265,0.693,0.2334,0.2281,"Yes!",true,TruckWindow) TruckButtonNo = guiCreateButton(0.5331,0.693,0.2369,0.2281,"No!",true,TruckWindow) TruckLabel = guiCreateLabel(0.2056,0.2018,0.6655,0.2895,"Want to deliver some cargo ?",true,TruckWindow) guiLabelSetVerticalAlign(TruckLabel,"top") guiLabelSetHorizontalAlign(TruckLabel,"left",false) showCursor ( true ) end ) addEvent ( "ColHit" ) addEventHandler ( "onClientGUIClick", getResourceRootElement (getThisResource ()), function () if (source == TruckButtonYes) then triggerEvent ( "SPECIAL_EVENT", getRootElement () ) -- and this ? guiSetVisible (TruckWindow, false) showCursor (false) elseif (source == TruckButtonNo) then guiSetVisible (TruckWindow, false) showCursor (false) end end ) resource works correctly, wtihout warnings and errors but triggering events not works..but why...
×
×
  • Create New...