Jump to content

xXMADEXx

Members
  • Posts

    2,718
  • Joined

  • Last visited

Everything posted by xXMADEXx

  1. Hello everybody. So, recently I have started to learn the C++ programming language and I decided I wanted to make just a basic personal module that outputs stuff to the console... The problem is I don't really know where to start on how to make a module. Is there something that the code must have, or something like that? Thanks.
  2. Client's have nothing to do with the server-side scripting. That all stays within the servers RAM.
  3. Don't be so impatient... I would think that SMF uses sha256 encryption, but I'm not 100% sure about it. According to this, they do use sha256, but they could've changed it.
  4. Looks interesting, nice job.
  5. Thank you! Uploaded introduction to events
  6. This is how I would do it (I didn't test it, so you might get an error) local g_Cameras = { { -2800.7409667969, 1223.7073974609, 21.463973999023, -2810.4326171875, 1124.2016601563, 23.62508392334 }; { -2667.4091796875, 375.99395751953, 10.6223487854, -2767.3198242188, 376.38967895508, 6.4156184196472 }; } local playerCameras = { } local playerTimers = { } addEventHandler("onPlayerJoin", root, function( ) loadPlayerCamera ( source ) playerTimers[source] = setTimer ( function ( p ) if ( not isGuestAccount ( getPlayerAccount ( p ) ) ) then killTimer ( playerTimers[p] ) return end loadPlayerCamera ( p ) end, 8000, 0, source ) end ) function loadPlayerCamera ( p ) if ( not playerCameras [ p ] ) then playerCameras [ p ] = 1 else while ( i == playerCameras [ p ] ) do i = math.random ( #g_Cameras ) end playerCameras[p] = i end fadeCamera ( p, false ) setTimer ( function ( p, i ) fadeCamera ( p, true ) setCameraMatrix( p, unpack ( g_Cameras [ i ] ) ) end, 1500, 1, p, i ) end
  7. Post your whole code (server and client)
  8. Try using this: setControlState
  9. xXMADEXx

    TaxiHelp

    Tell me if debugscript says anything (if it does, take a screenshot and upload the error to http://imgur.com) (Debug: /debugscript 3)
  10. xXMADEXx

    Ports closed

    Then you didn't port forward correctly...
  11. xXMADEXx

    TaxiHelp

    dxDrawText is a really basic function, once you start to understand it. You just have to make sure you put it into one of the render events. Here is a basic example: addEventHandler ( "onClientRender", root, function ( ) dxDrawText ( "This is my direct x text!", 0, 0, 500, 20 ) end )
  12. xXMADEXx

    TaxiHelp

    You can use element data to store the player job, to check it if you need it. You'll need: setElementData, getElementData
  13. So, what exactly is the point of it?
  14. xXMADEXx

    Help

    That's of course how I started. Making small edits to community scripts until I finally understood how they work and what everything was for... I'm pretty sure this is how every scripter is born lol.
  15. xXMADEXx

    Help

    You're welcome. I started off at this forum just like you, as you can see here viewtopic.php?f=91&t=47933
  16. xXMADEXx

    Help

    No. An example could be something like: local m = createMarker ( 100, 100, 10, "cylinder", 2, 255, 255, 255, 255 ) setElementVisibleTo ( m, getRandomPlayer ( ), false )
  17. You can try to get them from here: http://code.google.com/p/mtasa-blue/sou ... eNames.cpp
  18. xXMADEXx

    Help

    There are two ways that you can do this. You can use the function setElementVisibleTo or you can make the marker on the client side.
  19. Try using this: addCommandHandler( "duyuru", function ( thePlayer ) local accName = getAccountName ( getPlayerAccount ( thePlayer ) ) if isObjectInACLGroup ("user."..accName, aclGetGroup ( "Admin" ) ) then triggerClientEvent ( thePlayer, "openGUI", thePlayer ) end end ) addEvent ( "yaziGonder", true ) addEventHandler ( "yaziGonder", root, function ( text ) triggerClientEvent ( root, "yaziGeldi", root, text ) end ) -- client textFont = "pricedown" textScale = 1 text = nil local x, y = guiGetScreenSize () addEventHandler("onClientResourceStart", resourceRoot, function() duyuruGrid = guiCreateGridList((x/2)-(379/2), (y/2)-(230/2), 379, 230, false) guiSetAlpha(duyuruGrid, 0.65) guiSetVisible(duyuruGrid,false) isimLab = guiCreateLabel(0, 0, 379, 41, "Hubbub Games Duyuru Paneli", false, duyuruGrid) guiSetFont(isimLab, "default-bold-small") guiLabelSetColor(isimLab, 254, 255, 254) guiLabelSetHorizontalAlign(isimLab, "center", false) guiLabelSetVerticalAlign(isimLab, "center") duyuruMemo = guiCreateMemo(10, 51, 359, 94, "", false, duyuruGrid) default = guiCreateButton(10, 155, 99, 22, "Default-Bold", false, duyuruGrid) guiSetFont(default, "default-bold-small") bankgothic = guiCreateButton(140, 155, 99, 22, "Bankgothic", false, duyuruGrid) guiSetFont(bankgothic, "default-bold-small") pricedown = guiCreateButton(260, 155, 99, 22, "Pricedown", false, duyuruGrid) guiSetFont(pricedown, "default-bold-small") guiSetEnabled(pricedown, false) gonder = guiCreateButton(162, 197, 54, 23, "Gonder", false, duyuruGrid) guiSetFont(gonder, "default-bold-small") kapat = guiCreateButton(315, 197, 54, 23, "Kapat", false, duyuruGrid) guiSetFont(kapat, "default-bold-small") zorrom = guiCreateLabel(10, 205, 120, 15, "Script By: ZoRRoM", false, duyuruGrid) guiSetFont(zorrom, "default-bold-small") guiLabelSetHorizontalAlign(zorrom, "center", false) guiLabelSetVerticalAlign(zorrom, "center") addEventHandler("onClientGUIClick", getRootElement(), click) end ) function click () if (source == default) then guiSetEnabled(default, false) guiSetEnabled(bankgothic, true) guiSetEnabled(pricedown, true) textFont = "default-bold" textScale = 1 elseif (source == bankgothic) then guiSetEnabled(default, true) guiSetEnabled(bankgothic, false) guiSetEnabled(pricedown, true) textFont = "bankgothic" textScale = 0.8 elseif (source == pricedown) then guiSetEnabled(default, true) guiSetEnabled(bankgothic, true) guiSetEnabled(pricedown, false) textFont = "pricedown" textScale = 1 elseif (source == kapat) then guiSetVisible(duyuruGrid, false) showCursor(false) elseif (source == gonder) then text = guiGetText ( duyuruMemo ) guiSetEnabled(default, false) guiSetEnabled(bankgothic, false) guiSetEnabled(pricedown, false) guiSetEnabled(gonder, false) setTimer(function() guiSetEnabled(gonder, true) if (textFont == "pricedown") then guiSetEnabled(default, true) guiSetEnabled(bankgothic, true) guiSetEnabled(pricedown, false) elseif (textFont == "bankgothic") then guiSetEnabled(default, true) guiSetEnabled(bankgothic, false) guiSetEnabled(pricedown, true) elseif (textFont == "default-bold") then guiSetEnabled(default, false) guiSetEnabled(bankgothic, true) guiSetEnabled(pricedown, true) end end, 15000, 1 ) showCursor(false) guiSetVisible(duyuruGrid, false) triggerServerEvent ( "yaziGonder", localPlayer, guiGetText ( duyuruMemo ) ) end end setAlphaGradually = function( element, Speed ) if ( isElement( element ) and getElementType( element ):find( "gui-" ) and tonumber( Speed ) and tonumber( Speed ) >= 50 ) then if ( isTimer( Timer ) ) then killTimer( Timer ) end guiSetAlpha ( element, 0 ) Timer = setTimer ( function ( ) guiSetAlpha ( element, guiGetAlpha ( element ) + 0.03 ) if ( guiGetAlpha ( element ) >= 0.70 ) then killTimer( Timer ) end end, Speed, 0 ) else return false end end addEvent("openGUI", true) addEventHandler("openGUI", getRootElement(), function() setAlphaGradually( duyuruGrid, 50 ) guiSetVisible( duyuruGrid, not guiGetVisible( duyuruGrid ) ) showCursor( guiGetVisible( duyuruGrid ) ) end ) local dxText = "" addEvent ( "yaziGeldi", true ) addEventHandler ( "yaziGeldi", root, function( text ) dxText = text addEventHandler("onClientRender", root, dxElement ) setTimer(function() removeEventHandler("onClientRender", root, dxElement ) end, 15000, 1 ) end ) function dxElement( player ) dxDrawText("Duyuru: "..dxText.."\n- Hubbub Games Ekibi -", 11, 11, x, 58, tocolor(0, 0, 0, 255), textScale, textFont, "center", "top", false, true, true, true,false) dxDrawText("Duyuru: "..dxText.."#ffffff\n- Hubbub Games Ekibi -", 10, 10, x-1, 57, tocolor(255, 255, 255, 255), textScale, textFont, "center", "top", false, true, true,true, false) end
  20. You're welcome. (Also, I'm not sure why you're triggering a client event to give the player money, but it's not a good idea. The client side and server side money isn't synced by default, so the server is going to be returning a different value then the client side when you use getPlayerMoney. This also applies to takePlayerMoney)
  21. No I think you were going for this: function robEnterTwo( p ) if ( isElement ( p ) ) then setTimer ( function( p ) triggerClientEvent ( p, "robbedShop", p ) end, 1000, 1, p ) end end addEventHandler("onMarkerHit", robMarker, robEnterTwo)
  22. This is your problem: triggerClientEvent("robbedShop") Read the arguments for triggerClientEvent.
  23. when I use this element on a vehicle, my vehicle just floats in the air... That function is bugged on the server side, you have to use the function I posted.
  24. Use this function: setElementCollidableWith.
×
×
  • Create New...