Jump to content

WhoAmI

Members
  • Posts

    1,248
  • Joined

  • Last visited

Everything posted by WhoAmI

  1. function invisible ( ) if ( getElementModel ( localPlayer ) == 179 ) then local n = ( getElementAlpha ( localPlayer ) > 0 ) and 0 or 255; setElementAlpha ( localPlayer, n ); end end addCommandHandler ( "invisible", invisible ) Use it client
  2. Which code do you use and in what side (client/server)?
  3. function invisible ( player ) if ( getElementModel ( player ) == 179 ) then local n = ( getElementAlpha ( player ) > 0 ) and 0 or 255; setElementAlpha ( player, n ); end end addCommandHandler ( "invisible", invisible )
  4. Leave your script s-side and use this c-side: addEventHandler ( "onClientPlayerWeaponFire", root, function ( ) setElementAlpha ( source, 255 ); end );
  5. He won't. I've done one thing, look properly. After first frame he will calculate only once, and then if statemant won't run again. @EDIT. My bad, didn't notice that value will reset after each frame, tho. Up user's solution is good.
  6. Your solution is good, but mine is a bit simpler.
  7. px,py = guiGetScreenSize() function dxDrawProgressBar(BGW,BGH,PBW,PBH,BGcolor,PBcolor,progress) if BGW > PBW and BGH > PBH then local BGstartx, BGstarty, PBstartx, PBstarty, percent, executed; if not executed then executed = true BGstartx = math.floor((px - BGW) / 2) BGstarty = math.floor((py - BGH) / 2) PBstartx = math.floor((px - PBW) / 2) PBstarty = math.floor((px - PBH) / 2) percent = math.floor(PBW / 100) end local drawprogress = math.floor(progress * percent) dxDrawRectangle(BGstartx,BGstarty,BGW,BGH,BGcolor,true) dxDrawRectangle(PBstartx,PBstarty,drawprogress,PBH,PBcolor,true) end end
  8. Rx,Ry = guiGetScreenSize ( ); function renderCursor ( ) local cursorX,cursorY = getCursorPosition( ) posX = math.floor(cursorX * Rx) posY = math.floor(cursorY * Ry) dxDrawImage(posX,posY,32,32,"cursor.png",0,0,0,tocolor(255,255,255,255),true) end function drawCursor(status) if status then showCursor(true) setCursorAlpha(0) addEventHandler("onClientPreRender",root,renderCursor) else removeEventHandler("onClientPreRender",root,renderCursor) showCursor(false) end end
  9. viewtopic.php?f=108&t=73561
  10. It isn't. triggerEvent calling an event, which can be attached to function.
  11. triggerEvent is for creating custom events, that's completely different thing than calling a function.
  12. Change 'player' to 'source'.
  13. WhoAmI

    Paintjobs

    You can do it by shaders.
  14. Skrypt jest napisany bardzo niezoptymalizowanie. Spróbuj użyć tego viewtopic.php?f=108&t=45441
  15. I fixed it somehow. Don't ask me how, because I don't really know.
  16. Yea I know. Dunno why it doesn't work for me. Something changing. ped's position.
  17. addEventHandler ( "onClientResourceStart", resourceRoot, function ( ) local ped = createPed ( 0, 1727.98, -1632.4, 20.2 ); ped:setID ( "s-ped" ); end ); [lua]local xxx, yyy, zzz = getElementPosition ( ped ); outputChatBox ( xxx .. ", " .. yyy .. ", " .. zzz ); Output 1727.9799804688, -1632.4000244141, 20.200000762939 http://i.snag.gy/xAQ3l.jpg
  18. It's kinda strange, because i'm checking what the position of ped is, and it returns me correct xyz. What's more I still can't see the ped on this position.
  19. I need to create it clientside.
  20. What can I do with that function? Ped is spawning in completely different position.
  21. It means that MySQL on your local IP isn't turned on. Check if it is working. If it really is, check if you gave script correct data to connect.
  22. Hello. I have very, veryw weird problem. I'm using this code createPed ( skins[characterList[id]["sex"]][1], 1727.98, -1632.4, 20.2 ); Of couse 'skins[characterList[id]["sex"]][1]' returns good value. Ped is created, but in different position. I'm sure that xyz is correct. I have even made camera looking at this xyz and it looks in good place, but ped still is created in different position. Can someone explain me what's the problem? Code is clientside.
  23. getElementDimension, getElementPosition, getElementInterior
×
×
  • Create New...