Jump to content

smw94

Members
  • Posts

    26
  • Joined

  • Last visited

Everything posted by smw94

  1. change getRootElement() to player element you want to display
  2. smw94

    Help MTA Browser

    it's exactly what i wanted, thanks for the suggestion, and it now working
  3. smw94

    Help MTA Browser

    how you use that ? i use this, and still not working function onCursorMove ( relativeX , relativeY , absoluteX , absoluteY ) if webAppsWdw then injectBrowserMouseMove ( webAppsWdw , absoluteX , absoluteY ) end end addEventHandler ( "onClientCursorMove" , root , onCursorMove )
  4. smw94

    Online GUI-Editor

    hi, i can support providing web server for this, contact me if you are interested
  5. smw94

    Help MTA Browser

    problem is not solved yet, any help ?
  6. smw94

    Help MTA Browser

    still doesnt work, when i click the videos, it wont play .. but if i set the browser property non mobile, when i click the videos, it play ..
  7. smw94

    Help MTA Browser

    hmm, no i dont, if i load youtube as a normal browser, without mobile property enabled i can play the videos normally ..
  8. i have a problem, i created a browser, that load youtube, i set the browser property, "mobile" into "1" (enabled) but i cant play youtube videos, if i disabled mobile property, i can play videos, any help ? thanks here's some my code: theBrowser = guiCreateBrowser(24, 80, sizeX, sizeY, false, false, false, wPhoneMenu) setBrowserProperty(guiGetBrowser(theBrowser),"mobile","1")
  9. smw94

    solid water

    thank you man) you're welcome ~
  10. that error and warning message, how u do that ? displaying in game
  11. smw94

    solid water

    viewtopic.php?f=91&t=69189
  12. its not working, its working perfectly on localplayer, but not on remote player, any idea how to sync this ?
  13. can anyone help with sync ing setPedLookAt ? this is my code, other player always look to the north, while local player work perfectly, thanks before client side local sx, sy = guiGetScreenSize () -- addEventHandler("onClientPreRender", getRootElement(), -- function() function rotateOwnHead() -- body if getElementHealth(localPlayer) >= 1 then local lx, ly, lz = getWorldFromScreenPosition ( sx/2, sy/2, 10 ) triggerLatentServerEvent("moveHeadSync",1000,true,localPlayer,lx,ly,lz) end end addEventHandler("onClientResourceStart",root, function () setTimer(rotateOwnHead, 200, 0 ) end) -- end) function rotateHead(x,y,z) setPedAimTarget(source, x,y,z) setPedLookAt(source, x,y,z, -1, 0) end addEvent("rotateHead",true) addEventHandler("rotateHead",getRootElement(),rotateHead) server side function moveHeadSync(x,y,z) -- outputDebugString(tostring(getPlayerName(source)..": X : "..x)) triggerLatentClientEvent(root, "rotateHead",1000,true, source,x,y,z) end addEvent("moveHeadSync",true) addEventHandler("moveHeadSync",getRootElement(),moveHeadSync)
  14. i'm not sure seasparrow minigun is triggering onClientPlayerHitByWaterCanon, i've try, and it doesnt work, its triggered by fire truck or SWAT van water canon, anything to try ?
  15. thanks it work, but another problem is, where should it trigger when killing by sea sparrow gun ? it doesnt trigger onPlayerWasted ..
  16. is event onPlayerWasted is triggered when a player death caused by heli blades / car ram ? i try debuging it, by killing player with both method but none of them triggered onPlayerWasted, i dont get any error, but the player wont respawn after death by heli blades / car ram, so where should it triggered when player death by heli blades or car ram ? thanks ..
  17. smw94

    bone_attach help

    no its running, if i put exports.bone_attach:attachElementToBone(objectTable.objBone[thePlayer][bone],thePlayer,bone,x,y,z,rx,ry,rz) client side, its working, i read the resource documentation, its both client and server function, so whats wrong ?
  18. i'm working on toys resource (something that player can wear but not clothes) like helmet, mask etc, and im using resource bone_attach, but every times i tried to attach the object, its always return "attemp to call a nil value" and "ERROR: toys\s_toys.lua:18: call: failed to call 'bone_attach:attachElementToBone' " here is part of my code local objectTable = { objBone={} } function createToyModel(thePlayer, model, bone, x, y, z, rx, ry, rz, scale, doublesided) objectTable.objBone[thePlayer] = {} if not objectTable.objBone[thePlayer][bone] then objectTable.objBone[thePlayer][bone] = createObject(model,0,0,0,0,0,0) if not objectTable.objBone[thePlayer][bone] then outputChatBox("failed",thePlayer) else setObjectScale ( objectTable.objBone[thePlayer][bone], scale) if doublesided then setElementDoubleSided(objectTable.objBone[thePlayer][bone], true) end setElementInterior(objectTable.objBone[thePlayer][bone],getElementInterior(thePlayer)) setElementDimension(objectTable.objBone[thePlayer][bone],getElementDimension(thePlayer)) exports.bone_attach:attachElementToBone(objectTable.objBone[thePlayer][bone],thePlayer,bone,x,y,z,rx,ry,rz) end end end i double checked every variables, but none of them are nil, so whats possibly causing this ? thanks before
  19. on my way you can just get the object like this; local radarArea = getElementData ( source, "areaObj" ); getElementData ( radarArea, "turfId" ); -- etc Using a table can be done on an easy way too, check this magical moment out; local tblTurfs = { }; function addTurf ( id, x, y, z, sizeX, sizeY, r, g, b, owner ) if ( not owner ) then owner = 0; end local col = createColCuboid ( x, y, z - 30, sizeX, sizeY, z + 30 ); local rArea = createRadarArea ( x, y, sizeX, sizeY, r, g, b, 130 ); tblTurfs [ col ] = col; -- storing it in the table setElementData ( col, "owner", owner ); setElementData ( col, "turfId", id ); setElementData ( col, "posx", x ); setElementData ( col, "posy", y ); setElementData ( col, "areaObj", rArea ); end addEventHandler ( "onColShapeHit", root, function () if ( tblTurfs [ source ] ) then -- checking if it's in your table -- onTurfEnter() end end ); addEventHandler ( "onColShapeLeave", root, function () if ( tblTurfs [ source ] ) then -- checking if it's in your table -- onTurfLeave() end end ); okay, thanks for your help, i got it now
  20. thanks for your help, if you dont mind, i'd very appreciated if you want to give some example how to store the area location into tables, and cmiiw, if i store it to table, then i need too loop all over table to add oncolshapehit for each area right ? oh because i dont know how to get area value of the col , so i added double values, i think i much easier to get element value of each col and area ..
  21. is creating colshape like this is safe ? it's working perfectly on my server, but after a few hours after my server start, all of colshape element in my server get error, isElementWithinColShape error expected colshape at argument 2, then OnColShapeHit and OnColShapeLeave isn't triggerd anymore, its just like, all colshape in my server just disappear, all of them. but when i stop this resource, the colshape is normal again, thanks before, i'd appreciate anyone you help solving this. here is the script : function addTurf(id,x,y,z,sizeX,sizeY,red,green,blue,owner) -- Load all turfs if not owner then owner = 0 end local colCuboid = createColCuboid( x, y, z-30, sizeX, sizeY, z+30 ) local radArea = createRadarArea( x, y, sizeX, sizeY, red, green, blue, 130 ) addEventHandler( "onColShapeHit", colCuboid, onTurfEnter ) addEventHandler( "onColShapeLeave", colCuboid, onTurfLeave ) setElementData( colCuboid, "owner", owner ) setElementData( radArea, "owner", owner ) setElementData( colCuboid, "turfId", id ) setElementData( radArea, "turfId", id ) setElementData( radArea, "posx", x ) setElementData( radArea, "posy", y ) setElementData( colCuboid, "posx", x ) setElementData( colCuboid, "posy", y ) setElementData( colCuboid, "area", radArea ) end
  22. why this is normal ? any explanation why the debugscript gave that warning ?
  23. hi, i always get this error from server console after a few hour i started my server, [expected colshape at argument 2] i dont know what causing this error, i double check the script, there's nothing wrong with the colshape, it always appear after a few hours, if i restart my server, its normal again, but after few hours, it appear again, is there any limitation of colshape maybe ?
×
×
  • Create New...