Jump to content

KariiiM

Members
  • Posts

    1,312
  • Joined

  • Last visited

Everything posted by KariiiM

  1. -Wiki createBrowser = This function creates a new web browser element. guiCreateBrowser = This function creates a new CEGUI web browser element. So,the difference between them is the 'CEGUI', this CEGUI exist only in guiCreateBrowser but it doesn't exist in createBrowser. For more infos about what does CEGUI mean click Here
  2. YEEES So declare the file name of the sound in the meta like that filename/sound.mp3
  3. Also check if the sound exist in file or not to declare it in the meta
  4. By the way, localPlayer == getLocalPlayer function stopMinigunDamage ( attacker, weapon, bodypart ) if weapon then --if the weapon used was the minigun local sound = playSound("hit.mp3") setSoundVolume(sound, 50) end end addEventHandler ( "onClientPlayerDamage", getLocalPlayer(), stopMinigunDamage )
  5. From where you got this argument 'player'?
  6. function buyHouse () takePlayerMoney ( source, 100000 ) end addEvent("bought", true) addEventHandler("bought", getRootElement(), buyHouse)
  7. You're welcome my friend
  8. Hello zacknope, Each event has some parameters those parameters can be bool , element (player,vehicle,objects..etc) , string, float, integer, account..etc I will give you an example with the event onMarkerHit, i'm sure you will understand it just follow me step by step Let's start with onMarkerHit or onClientMarkerHit they're with the same parameters the different between those two events the first one is server sided and the second one is client sided so the server sided one can't be used in client side and the same thing to other one. So as i said, onMarkerHit / onClientMarkerHit or onMarkerLeave / onClientMarkerLeave are with two parameters let's defines them! Those two parameters are: hitElement and dimension, hitElement mean the element that hit the marker it can be player or vehicle...etc dimension mean if the element is in the same as the marker's dimension then it will return true else it will return false Now after defining those parameters let's do some practice: function onPlayerHitMarker (hitElement, dimension) --Let's enter the two arguments of our event 'onMarkerHit' if getElementType( hitElement ) == "player" then --Let's exist our element type and check if it's a player outputChatBox(getPlayerFromName(hitElement).. " hit the marker.",getRootElement(),255,0,0) end --end of if end --end of the function addEventHandler("onMarkerHit",markerName,onPlayerHitMarker) ~Regards,KariM
  9. You can use this function to check if the player is in a vehicle or not isPlayerInVehicle
  10. Yeah it will fit dayz servers
  11. @Toni you're wrong, it's server side look at 'onMarkerHit' event so localPlayer won't works there
  12. local out = createMarker ( 418.794921875, -84.074752807617, 1001.8046875, "arrow", 1.5, 236, 229, 30 ) function outside(hitElement,matchingDim) if (hitElement and matchingDim and getElementType(hitElement) == "player") then setElementInterior ( hitElement, 3, 418.794921875, -84.074752807617, 1001.8046875 ) setElementInterior( getPlayerFromName("nope") , 0, 209, -63 , 2 ) end end addEventHandler ( "onMarkerHit", out , outside )
  13. for _,mark in pairs(getElementsByType("marker")) do if getElementData(mark,"ID") then outputChatBox(ID,getRootElement()) end end You can't get the string "ID" inside getElementData without defining it
  14. You need two different targets to do that, As i see you're repeating one target two time setCameraMatrix(px,py,pz,px,py,pz)
  15. Yeah you're right, i just tested two ways to see the results,so decomplier can't decomplie scripts who are complied here luac.multitheftauto.com not like normal compliers you can decomplie them successfully as i did in the first test
  16. First of all there's a part of your code not used at all so there's no sense to keep it MyGUI = { button = {}, window = {} } Second thing, i'm going to answer your main problem,follow me step by step! -Server-side: addEventHandler("onResourceStart",resourceRoot, --On the resource start all the data inside this function will be created automaticly. function () local marker = createMarker(0, 0, 0, "cylinder", 2, 255, 0, 0, 250) -- We create our marker by this function 'createMarker'. local blip = createBlipAttachedTo(marker, 1) --Attaching our blip on the marker to know where the marker exist. setElementInterior(marker, 0) --Setting interior of the marker to default. setElementDimension(marker, 0) --Setting dimension of the marker to default. addEventHandler("onMarkerHit",marker,onMarkerHit) --We putting the event 'onMarkerHit' inside this function because marker is defined inside it. end) function onMarkerHit(hitPlayer, matchingDimension) --There're two arguments for this event,the element who hit the marker and the dimension! if not matchingDimension then return end --Checking if player is in the same dimension as the marker or not if not it will return false. if ( getElementType (hitPlayer) == 'player' ) then --Checking if the element who hit the marker is a player not something else. triggerClientEvent(hitPlayer,"showGUI",hitPlayer) --We use this function to send data from server to client side. end end -Client side: local window1 = guiCreateWindow(81, 102, 631, 447, "TheShop", false) guiWindowSetSizable(window1, false) guiSetVisible(window1,false) local button1 = guiCreateButton(13, 54, 140, 29, "MyGuns", false, window1) addEvent("showGUI",true) addEventHandler("showGUI",getRootElement(), function () if ( guiGetVisible(window1) == nil ) then --If the windows isn't visible then we will make it visible when the player hit marker guiSetVisible(window1,true) showCursor(true) end end) ~Regards,KariM
  17. Hello community, Today i'm asking about does MTA has an abilities to protect complied codes from being decomplied? Because just yesterday i tested a decomplier programe and it worked successfully.. Also i wanted to suggest something, as you knows most of new servers forget to make an compilation to their client scripts,so why not MTA team make the downloaded client scripts complied automatically like that most of new servers will prevent this problem. ~Regards,KariM
  18. Make the radar visible when the player login use this event onPlayerLogin and invisible if the player still guest, use this event onPlayerJoin
  19. KariiiM

    HELP

    Yes you're right, i just tested an decomplier programe and it do the same, with undefined arguments @kewi, there's no ways learn or leave from that
  20. KariiiM

    HELP

    It's not a full code
  21. KariiiM

    HELP

    You have nothing to do without server side
  22. KariiiM

    HELP

    It's leaked script
  23. KariiiM

    HELP

    _UPVALUE0_ and _UPVALUE1_ are not defined also it look a leaked script
×
×
  • Create New...