Jump to content

TAPL

Retired Staff
  • Posts

    7,337
  • Joined

  • Days Won

    11

Everything posted by TAPL

  1. Well, it work perfect for me: the image : http://i.imgur.com/PrcVU.jpg
  2. I don't think i get what you mean, can you post an image for the problem?
  3. it works TAPL Thanks But The admin panel Not colored what is the reason? how can i fix it ? /restart admin
  4. I think timer is needed. addEventHandler("onClientResourceStart", root, function() setTimer(function() for _, Ads in ipairs(getElementsByType('gui-button')) do guiSetProperty(Ads, 'NormalTextColour', 'FFFFFF00') guiSetProperty(Ads, 'HoverTextColour', 'FFFF0000') guiSetProperty(Ads, 'PushedTextColour', 'FF220000') guiSetFont(Ads, "default-bold-small") end end, 250, 1) end)
  5. TAPL

    HELP

    Maybe? setWaveHeight
  6. addEventHandler("onClientResourceStart", root, function() for _, Ads in ipairs(getElementsByType('gui-button')) do guiSetProperty(Ads, 'NormalTextColour', 'FFFFFF00') guiSetProperty(Ads, 'HoverTextColour', 'FFFF0000') guiSetProperty(Ads, 'PushedTextColour', 'FF220000') guiSetFont(Ads, "default-bold-small") end end)
  7. attachElements https://wiki.multitheftauto.com/wiki/CreateWeapon
  8. وين كود السيرفر يا عزيزي؟ وايش المشكلة بالكود حالياً؟
  9. Server Side And this a fix for SOSO code: local gate = createObject(7709, -2122.5, 381.89999389648, 35.700000762939, 0, 0, 358) megusta = false addCommandHandler("gate", function (source) -- i define source here (this needed for server side only) if ( getTeamName ( getPlayerTeam ( source ) ) == "Mafia" ) then if (megusta == false) then moveObject(gate, 2500, -2122.5, 381.89999389648, 30, 0, 0, 0 ) megusta = true elseif (megusta == true) then moveObject(gate, 2500, -2122.5, 381.89999389648, 35.700000762939, 0, 0, 0 ) megusta = false else outputChatBox( "you're not in mafia team !", source, 0, 255, 0, true ) end end end)
  10. createTeam setPlayerTeam
  11. TAPL

    Small help

    Event onResourceStop doesn't have player parameter. You need to use this to get all players. getElementsByType
  12. You mean team? You can get the team name via these functions and check if the name was Mafia then open the gate. getPlayerTeam getTeamName playerSource: The player who triggered the command. If not triggered by a player (e.g. by admin), this will be false. playerSource is who you will get his team name. https://wiki.multitheftauto.com/wiki/AddCommandHandler EDIT: @SOSO, hitPlayer is not defined anywhere.
  13. You need to use it client side.
  14. if you want set alpha for one element but different alpha for different players, so player 1 will see it in 255 but player2 will see it in 0 then you have to use it client side. Not sure if that what you mean.
  15. Use it client side maybe?
  16. You're welcome.
  17. Client what for? Not needed.
  18. -- Server Side -- bargate = createObject (968,-2063.5,1371.0999755859,7.0999999046326,0,270,0) damarker = createMarker (-2066.81201, 1370.72888, 6.90067, "cylinder", 9.5, 255, 0, 0, 0 ) isMoving = false function gatefunc( hitPlayer ) if ( getElementType ( hitPlayer ) == "player" and isPedInVehicle( hitPlayer ) ) then local veh = getElementModel ( getPedOccupiedVehicle ( hitPlayer ) ) if ( veh == 431 ) and not isMoving then isMoving = true moveObject( bargate, 1500, -2063.5, 1371.0999755859, 7.0999999046326, 0, 90, 0 ) end end end addEventHandler( "onMarkerHit", damarker, gatefunc ) function gatefuncclose( hitPlayer ) if ( getElementType( hitPlayer ) == "player" and isPedInVehicle( hitPlayer ) ) then local veh = getElementModel( getPedOccupiedVehicle( hitPlayer ) ) if ( veh == 431 ) and isMoving then isMoving = false moveObject( bargate, 1500, -2063.5, 1371.0999755859, 7.0999999046326, 0, -90, 0 ) end end end addEventHandler( "onMarkerLeave", damarker, gatefuncclose )
  19. isMoving not used at all.
  20. You're welcome.
  21. You forgot argument "time" at moveObject time: The time in milliseconds the object will arrive at the destination. local gate = createObject(7709, -2122.5, 381.89999389648, 35.700000762939, 0, 0, 358) function open() moveObject(gate, 2500, -2122.5, 381.89999389648, 30, 0, 0, 358 ) end addCommandHandler("open", open) function close() moveObject(gate, 2500, -2122.5, 381.89999389648, 35.700000762939, 0, 0, 358 ) end addCommandHandler("close", close)
  22. TAPL

    [SOLVED]

    Get last resource from here: http://code.google.com/p/mtasa-resources/downloads/list
  23. http://www.md5.net or https://wiki.multitheftauto.com/wiki/SetAccountPassword
  24. -- Server Side -- hit1 = 0 hit2 = 0 mohamad = createColCuboid(1354.9476318359, -1001.4436645508, 1000, 1000, 2000, 2000) addEventHandler("onColShapeHit", mohamad, function(player) if getElementType(player) ~= "player" then return end local Team = getPlayerTeam(player) local TeamName = Team and getTeamName(Team) or "" if (TeamName ~= "Criminal") and (TeamName ~= "Police") then return end if (TeamName == "Criminal") then hit1 = (hit1 + 1) elseif (TeamName == "Police") then hit2 = (hit2 + 1) end triggerClientEvent(root, "onHit", root, player, hit1, hit2) end) addEventHandler("onColShapeLeave", mohamad, function(player) if getElementType(player) ~= "player" then return end local Team = getPlayerTeam(player) local TeamName = Team and getTeamName(Team) or "" if (TeamName ~= "Criminal") and (TeamName ~= "Police") then return end if (TeamName == "Criminal") then hit1 = (hit1 - 1) elseif (TeamName == "Police") then hit2 = (hit2 - 1) end triggerClientEvent(root, "onLeave", root, player, hit1, hit2) end) -- Client Side -- addEvent("onHit", true) addEventHandler("onHit", root, function(player, hit1, hit2) if player == localPlayer then guiSetVisible(lbl1, true) guiSetVisible(lbl2, true) guiLabelSetColor(lbl1, 255, 0, 0) guiLabelSetColor(lbl2, 0, 0, 255) end guiSetText(lbl1, "Criminal "..hit1) guiSetText(lbl2, "Police "..hit2) end) addEvent("onLeave", true) addEventHandler("onLeave", root, function(player, hit1, hit2) if player == localPlayer then guiSetVisible(lbl1, false) guiSetVisible(lbl2, false) end guiSetText(lbl1, "Criminal "..hit1) guiSetText(lbl2, "Police "..hit2) end)
  25. addCommandHandler ( "vehicle", function ( thePlayer, cmd, id ) if isObjectInACLGroup ( "user." ..getAccountName ( getPlayerAccount ( thePlayer ) ), aclGetGroup ( "RPC" ) ) then x, y, z = getElementPosition ( thePlayer ) theVehicle = createVehicle ( tonumber(id), x, y + 3, z ) end end ) addEventHandler ( "onVehicleStartEnter", root, function ( thePlayer, theSeat ) if source == theVehicle then if ( theSeat == 0 ) and ( getPlayerSerial ( thePlayer ) ~= "MY SERIAL HERE" ) then cancelEvent ( ) outputChatBox ( "* ~][ هذه السيارة خاصة ][~", thePlayer, 255, 255, 0, true ) else outputChatBox ( "* ~][ مرحبـآ بك سيدي ][~", thePlayer, 255, 0, 0, true ) setVehicleDamageProof(theVehicle, true) end end end )
×
×
  • Create New...