Jump to content

Blaawee

Members
  • Posts

    857
  • Joined

  • Last visited

Everything posted by Blaawee

  1. theMarker = createMarker(2144.6176757813,-1688.2725830078,14.0859375, "cylinder", 2, 204, 0, 204,170) GUIEditor_Button = {} GUIEditor_Memo = {} GUIEditor_Label = {} function guiMyCwindow(w,h,t) local x,y = guiGetScreenSize() return guiCreateWindow((x-w)/2,(y-h)/2,w,h,t,false) end drugWindow = guiMyCwindow(301,250,"Buy Drugs") guiSetVisible(drugWindow, false) GUIEditor_Label[1] = guiCreateLabel(193,-103,5,5,"",false,drugWindow) GUIEditor_Button[1] = guiCreateButton(179,200,110,36,"Cancel",false,drugWindow) GUIEditor_Label[2] = guiCreateLabel(19,33,273,50,"Weed ( x 5 )",false,drugWindow) guiLabelSetColor( GUIEditor_Label[2], 0,255,0 ) GUIEditor_Label[3] = guiCreateLabel(19,50,273,50,"Speed ( x 5 )",false,drugWindow) guiLabelSetColor( GUIEditor_Label[3], 204,0,204 ) GUIEditor_Label[4] = guiCreateLabel(19,67,273,50,"Eroine ( x 5 )",false,drugWindow) guiLabelSetColor( GUIEditor_Label[4], 255,255,0 ) GUIEditor_Label[5] = guiCreateLabel(19,84,273,50,"LSD ( x 5 )",false,drugWindow) guiLabelSetColor( GUIEditor_Label[5], 0,0,255 ) GUIEditor_Label[6] = guiCreateLabel(19,101,273,50,"God ( x 5 )",false,drugWindow) guiLabelSetColor( GUIEditor_Label[6], 255,0,0 ) GUIEditor_Button[2] = guiCreateButton(95,33,70,15,"1000$",false,drugWindow) GUIEditor_Button[3] = guiCreateButton(95,50,70,15,"1500$",false,drugWindow) GUIEditor_Button[4] = guiCreateButton(95,67,70,15,"1200$",false,drugWindow) GUIEditor_Button[5] = guiCreateButton(95,84,70,15,"800$",false,drugWindow) GUIEditor_Button[6] = guiCreateButton(95,101,70,15,"2000$",false,drugWindow) function openDrugGui ( element ) if ( source == theMarker ) then if ( element == localPlayer ) then guiSetVisible( drugWindow, true ) showCursor( true ) end end end addEventHandler ( "onClientMarkerHit", resourceRoot, openDrugGui ) function buyWeed( ) if ( source == GUIEditor_Button[ 1 ] ) then guiSetVisible( drugWindow, false ) showCursor( false ) elseif ( source == GUIEditor_Button[ 2 ] ) then triggerServerEvent( "takemoney", localPlayer ) end end addEventHandler("onClientGUIClick", guiRoot, buyWeed ) addEvent( "takemoney", true ) function moneyTake( ) if ( getPlayerMoney( source ) > 1000 ) then takePlayerMoney( source, 1000 ) else "You don't have money" end end addEventHandler( "takemoney", getRootElement(), moneyTake )
  2. local Enter = createMarker( ... ) addEventHandler ( "onClientRender", root, function ( ) local x, y, z = getElementPosition ( Enter ) local x2, y2, z2 = getElementPosition ( localPlayer ) if isLineOfSightClear ( x, y, z, x2, y2, z2, true, true, false, true ) then local sx, sy = getScreenFromWorldPosition ( x, y, z+1 ) if sx and sy then local distance = getDistanceBetweenPoints3D(x, y, z, x2, y2, z2) if distance < 44 then dxDrawText ( "Police Station", sx+2, sy+2, sx, sy, tocolor(0, 0, 255, 255), 6-(distance/20), "default-bold", "center", "center" ) dxDrawText ( "Police Station", sx+2, sy-1, sx, sy, tocolor(255, 255, 255, 200), 6-(distance/20), "default-bold", "center", "center" ) end end end end )
  3. function _getMapName( map ) -- From race return getResourceInfo( map, "name" ) or getResourceName( map ) or "unknown" end addCommandHandler ( 'deletemap', function ( player, _, name ) if not isObjectInACLGroup ( 'user.' .. getAccountName ( getPlayerAccount ( player ) ), aclGetGroup ( 'Admin' ) ) then outputChatBox ( 'You are not allowed to use this command', player, 255, 0, 0 ); return end if not name or name == '' or name == ' ' then return end name = string.gsub( name, '([%*%+%?%.%(%)%[%]%{%}%\%/%|%^%$%-%_])', '%%%1' ) for _, resource in ipairs ( getResources ( ) ) do if name == _getMapName ( resource ) and getResourceInfo ( resource, 'type' ) == 'map' then if getResourceState ( resource ) == 'running' then stopResource ( resource ); end if deleteResource ( name ) then outputChatBox ( "Map [ " .. name .. " ] has been successfully removed", player, 0, 255, 0 ); else outputChatBox ( "There is an unknown problem with the map", player, 255, 0, 0 ); end return end end outputChatBox ( "The map does not exist", player, 255, 0, 0 ); end ); Or function _getMapName( map ) -- From race return getResourceInfo( map, "name" ) or getResourceName( map ) or "unknown" end addCommandHandler ( 'deletemap', function ( player, _, name ) if not isObjectInACLGroup ( 'user.' .. getAccountName ( getPlayerAccount ( player ) ), aclGetGroup ( 'Admin' ) ) then outputChatBox ( 'You are not allowed to use this command', player, 255, 0, 0 ); return end if not name or name == '' or name == ' ' then return end for _, resource in ipairs ( getResources ( ) ) do if string.find( getResourceName( resource ):lower( ), tostring( name ):lower( ), 1, true ) and getResourceInfo ( resource, 'type' ) == 'map' then if getResourceState ( resource ) == 'running' then stopResource ( resource ); end if deleteResource ( name ) then outputChatBox ( "Map " .. name .. " has been successfully removed", player, 0, 255, 0 ); else outputChatBox ( "There is an unknown problem with the map", player, 255, 0, 0 ); end return end end outputChatBox ( "The map does not exist", player, 255, 0, 0 ); end ); طبعآ ممو مجرب احد فيهم = )
  4. Blaawee

    Question

    -- Server addEventHandler( 'onPlayerJoin', root, function( ) triggerClientEvent( 'getTheMaxPlayers', source, getMaxPlayers( ) ); end ); --Client addEvent ( 'getTheMaxPlayers', true ); addEventHandler ( 'getTheMaxPlayers', root, function ( count ) howMany = count; end ); addEventHandler( 'onClientRender', root, function ( ) dxDrawText( howMany, sx * 0.2, sy * 0.1, sx, sy, tocolor( 255, 0, 0, 255 ),( sx / 1024 ) * 0.5, "bankgothic", "left", "top", false, false, false ); end );
  5. You have to edit the textlib. Replace this function with the old one function dxText:font( font ) if validFonts[ font ] then self.strFont = font else self.strFont = dxCreateFont( font ) end return true end
  6. Are you mean renaming the resource name ? if so renameResource If you are trying find [ old school map ] use this function function ismapNameOLDS( mapName ) return mapName:find( '[old]', 1, true ) or mapName:find( '[OLDS]', 1, true ) end
  7. Are you kidding with me ! that's what you want to = )
  8. Give a try for this local Line1 = createColRectangle ( -1318.4671630859, -189.9077911377, 1000, 1000 ) function SafeZoneA( element ) if source == Line1 then if getElementType ( element ) == "vehicle" then if ( isElementWithinColShape( element, source ) ) then repeat until getElementSpeed( element ) == 0 if getElementSpeed( element ) == 0 then setTimer ( destroyElement , 1000, 1, element ) end end end end end addEventHandler ( "onColShapeHit", resourceRoot, SafeZoneA ) function getElementSpeed( element, unit ) if ( nit == nil ) then unit = 0 end if ( isElement( element ) ) then local x,y,z = getElementVelocity( element ) if ( unit == "mph" or unit == 1 or unit == '1' ) then return ( x^2 + y^2 + z^2 ) ^ 0.5 * 100 else return ( x^2 + y^2 + z^2 ) ^ 0.5 * 1.8 * 100 end else outputDebugString( "Not an element. Can't get speed" ) return false end end
  9. @SolidSnake At line 31, should be if ( index [ player ] == 1 ) then @StevyDK Try again i edit it.
  10. Search for 'upgradesInit' function, You have to use table so you can edit the upgrades names.
  11. local Line1 = createColRectangle ( -1318.4671630859, -189.9077911377, 1000, 1000) function SafeZoneA( element ) if source == Line1 then if getElementType ( element ) == "vehicle" then if ( isElementWithinColShape( element, source ) ) then if getElementSpeed( element ) == 0 then setTimer ( destroyElement , 1000, 1, element ) end end end end end addEventHandler ( "onColShapeHit", resourceRoot, SafeZoneA ) function getElementSpeed(element,unit) if (unit == nil) then unit = 0 end if (isElement(element)) then local x,y,z = getElementVelocity(element) if (unit=="mph" or unit==1 or unit =='1') then return (x^2 + y^2 + z^2) ^ 0.5 * 100 else return (x^2 + y^2 + z^2) ^ 0.5 * 1.8 * 100 end else outputDebugString("Not an element. Can't get speed") return false end end
  12. function showVehiclesGui() local team = getPlayerTeam(localPlayer) local FreeroamTeam = getTeamFromName("Freeroam Arena") local StuntageTeam = getTeamFromName("Stuntage Arena") if team and FreeroamTeam and StuntageTeam and team == FreeroamTeam or team == StuntageTeam then if guiGetVisible(GUIEditor_Window[1]) then guiSetVisible(GUIEditor_Window[1], false) showCursor(false) else guiSetVisible(GUIEditor_Window[1], true) showCursor(true) end else outputChatBox("Vehicles are only allowed in Freeroam and -Stuntage Arena.", 255, 0, 0, true) end end bindKey("F2", "down", showVehiclesGui)
  13. local mySkins = { [ 1 ] = { ID = 171 }, [ 2 ] = { ID = 172 }, [ 3 ] = { ID = 133 }, [ 4 ] = { ID = 149 } }; local i = 1 -- function Selection( player ) showCursor(player, true) bindKey(player,"rshift","down",Spawn) bindKey(player,"arrow_l","down",SwitchSkin) bindKey(player,"arrow_r","down",SwitchSkin) fadeCamera ( player, true ) end function Selection2(player) if(not isPedDead(player) == true) then outputChatBox(" ", player, 0, 255, 0) outputChatBox("You'll choose your skin again.", player, 0, 138, 138) outputChatBox("Press Arrow keys to switch skins and Right shift to spawn!", player, 0, 138, 138) killPed(player, player) end setTimer(Selection,1000,2,player) end -- function SwitchSkin( player, key ) if( key == "arrow_l" ) then if ( i == 1 ) then i = #mySkins else i = i - 1; end else if ( i == #mySkins ) then i = 1; else i = i + 1; end end setElementModel( player, mySkins[ i ].ID ); playSoundFrontEnd ( player, 32 ); end -- function Spawn( player ) showCursor(player, false) playSoundFrontEnd (player, 44) outputChatBox("Done!", player, 0, 255, 138) unbindKey ( player, "rshift", "down", Spawn ) unbindKey ( player, "arrow_l", "down", SwitchSkin ) unbindKey ( player, "arrow_r", "down", SwitchSkin ) setCameraMode ( player, "player" ) end function GamemodeStart( res ) players = getElementsByType ( "player") for k,v in ipairs(players) do bindKey(v,"F4","down",Selection2) outputChatBox("< Press Arrow keys to switch skins and Right shift to spawn. >", v, 255, 138, 0) setTimer(SpawnPlayer,1000,2,v) setTimer(Selection,1000,2,v) fadeCamera ( v, true ) end end function GamemodeEnd( res ) players = getElementsByType ( "player") for k,v in ipairs(players) do unbindKey(v,"F4","down",Selection2) end end function PlayerDeath() setTimer(SpawnPlayer,1000,2,source) end function SpawnPlayer(source) spawnPlayer(source, -2026.5035, 156.7506, 29.0391, 269.1424, 167) end function PlayerJoin() bindKey(source,"F4","down",Selection2) outputChatBox("< Press Arrow Keys to switch skins and Right shift to spawn. >", source, 255, 255, 0) setTimer(SpawnPlayer,1000,2,source) fadeCamera (source, true ) setTimer(Selection,1500,2,source) end addEventHandler("onResourceStart", getRootElement(),GamemodeStart) addEventHandler("onResourceStop", getRootElement(),GamemodeEnd) addEventHandler("onPlayerJoin", getRootElement(),PlayerJoin)
  14. جرب ذآ و ردلي خبر local x, y = guiGetScreenSize() rRoot = getResourceRootElement(getThisResource()) Music = "Other/Intro.mp3" Anims = {"DAN_UP_A", "dnce_M_b", "DAN_Left_A", "DAN_Down_A", "DAN_Loop_A", "dance_loop"} num = 0 local TeamNameee = "" local Team = "" local findskin = nil local Text = "" local mn = nil Color = {255, 255, 255} local NewTeam = 0 local ID, skin = nil, nil, nil TeamName = {"Grove", "Aztecas", "Police", "Ballas", "No Team", "Medic", "Drift" } local WaeponID = {5, 22, 3, 1, 32, 41, 43} allPlayer = 0 local Weapon = 0 local NameWeap = "Fist" GameType = {} ColorGame = {0, 255, 255} GameNameType = "" Info = {} SkinSelectMusic = nil local foundTeam = 0 local findskin = 0 typeGame = "gang" local foundInTeam = "" local foundInall = "" Ped = {} skin = { Grove = {105, 106, 107}, Aztecas = {115, 116, 117}, Police = {283, 284, 285}, Ballas = {102, 103, 104}, ["No Team"] = {28, 34, 123, 230, 7, 15, 16, 21, 19, 22, 23, 24, 26, 28, 29, 30, 32, 33, 34, 37, 45, 46, 59, 72, 137, 189, 200, 217, 212, 240, 241, 247, 248, 261}, Medic = {274, 275, 276}, Drift = {46, 124, 43, 63, 64, 75, 285, 0} } AllTeamName = { Grove = {2494.96948, -1684.03101, 14.3313, 2494.98486, -1685.02856, 14.26363, 2495.38843, -1688.54297, 13.87171}, Aztecas = {1764.75586, -1928.03674, 15.2383, 1763.80432, -1928.0498, 14.93086, 1761.0708, -1928.08801, 13.57734}, Police = {1568.73779, -1695.54541, 7.0456, 1568.71582, -1694.55835, 6.8869, 1568.64075, -1691.68494, 5.89063}, Ballas = {2217.03027, -1167.91956, 27.0701, 2217.0166, -1168.89661, 26.85767, 2216.97534, -1171.77625, 25.72656}, ["No Team"] = {901.33551, -1208.65796, 18.4756, 901.27332, -1207.69299, 18.22063, 901.05676, -1204.8208, 16.98322}, Medic = {2022.72839, -1426.36877, 18.3914, 2023.34521, -1425.61548, 18.16297, 2025.20178, -1423.47644, 16.99219}, } Rot = {357.4391784668, 271.10339355469, 179.70733642578, 0, 179.01052856445, 132.08488464355} CamGameType = { {2454.49487, -1654.69812, 26.19402, 2541.42432, -1686.7251, -11.45641} } function dxDrawColorText(str, ax, ay, bx, by, color, scale, font, alignX, alignY) bx, by, color, scale, font = bx or ax, by or ay, color or tocolor(255,255,255,255), scale or 1, font or "default" if alignX then if alignX == "center" then ax = ax + (bx - ax - dxGetTextWidth(str:gsub("#%x%x%x%x%x%x",""), scale, font))/2 elseif alignX == "right" then ax = bx - dxGetTextWidth(str:gsub("#%x%x%x%x%x%x",""), scale, font) end end if alignY then if alignY == "center" then ay = ay + (by - ay - dxGetFontHeight(scale, font))/2 elseif alignY == "bottom" then ay = by - dxGetFontHeight(scale, font) end end local alpha = string.format("%08X", color):sub(1,2) local pat = "(.-)#(%x%x%x%x%x%x)" local s, e, cap, col = str:find(pat, 1) local last = 1 while s do if cap == "" and col then color = tocolor(getColorFromString("#"..col..alpha)) end if s ~= 1 or cap ~= "" then local w = dxGetTextWidth(cap, scale, font) dxDrawText(cap, ax, ay, ax + w, by, color, scale, font,"left", "top", false, false, true, false, false) ax = ax + w color = tocolor(getColorFromString("#"..col..alpha)) end last = e + 1 s, e, cap, col = str:find(pat, last) end if last <= #str then cap = str:sub(last) dxDrawText(cap, ax, ay, ax + dxGetTextWidth(cap, scale, font), by, color, scale, font,"left", "top", false, false, true, false, false) end end local function getTeam(team) return getTeamFromName(team) end local function count(team) return countPlayersInTeam(getTeamFromName(team)) end function onStop() resetSkyGradient() showChat(true) showPlayerHudComponent("all", true) end addEventHandler("onClientResourceStop", resourceRoot, onStop) function foundPos(nummm) local foundPo = AllTeamName[TeamName[NewTeam]][tonumber(nummm)] return foundPo end function showforallteam() foundInTeam = "There are Players" foundInall = "all Players" GameType = {"Gang Wars"} Info = {"Wlecom To Gang Wars","To Spawn press [Enter]"} fadeCamera( true ) GameNameType = "Gang Wars" mn = nil showChat(false) bindKey("enter","down",SpawnGameType) l1, l2, l3, l4, l5, l6 = unpack(CamGameType[1]) info1 = Info[1] info2 = Info[2] ShowGameType() addEventHandler("onClientRender",getRootElement(),DrawGameType) end addEventHandler("onClientPlayerWasted", getLocalPlayer(), function(killer, weapon, bodypart) if getElementData(localPlayer, "WasChangeTeam") == true then showforallteam() else return false end end) function ShowGameType() ColorGame = {255,255,0} l1, l2, l3, l4, l5, l6 = unpack(CamGameType[1]) setCameraMatrix(l1, l2, l3, l4, l5, l6) SelectGame = 1 GameNameType = GameType[1] count2 = count("Grove") count3 = count("Aztecas") count4 = count("Police") count5 = count("Ballas") count6 = count("No Team") mn = count2 + count3 + count4 + count5 + count6 typeGame = "gang" end function SpawnGameType() if typeGame == "gang" then setTimer(MakeGangWars, 500, 1) end unbindKey("enter", "down", SpawnGameType) TeamNameee = "Team Name" end function MakeGangWars() Color = {0, 255, 0} Team = " " .. TeamName[1] .. " " allPlayer = count(TeamName[1]) Weapon = WaeponID[1] NameWeap = getWeaponNameFromID(Weapon) NameWeap = getWeaponNameFromID(Weapon) NewTeam = 1 local x, y, z, lx, ly, lz = foundPos(1), foundPos(2), foundPos(3), foundPos(4), foundPos(5), foundPos(6) setCameraMatrix(x, y, z, lx, ly, lz) removeEventHandler("onClientRender", getRootElement(), DrawGameType) bindKey("arrow_r", "down", Next) bindKey("arrow_l", "down", Next) bindKey("enter", "down", SpawnPlayer) addEventHandler("onClientRender", getRootElement(), DrawTeam) SkinSelectMusic = playSound(Music, true) local pedx, pedy, pedz = foundPos(7), foundPos(8), foundPos(9) findskin = math.random( 1, 3 ) ID = 105 Ped[1] = createPed(ID, pedx, pedy, pedz, Rot[1]) if not isElement(Ped[1]) then Ped[1] = createPed(ID, pedx, pedy, pedz, Rot[NewTeam]) end setElementFrozen(Ped[1], true) setPedAnimation(Ped[1], "DANCING", Anims[math.random(1, 6)]) foundTeam = 1 findskin = 1 end function Next(key) if key == "arrow_l" then num = num - 1 else num = num + 1 end if key == "arrow_l" then findskin = findskin - 1 else findskin = findskin + 1 end if findskin < 1 then findskin = #skin[ TeamName[ number ] ] end if findskin > #skin[ TeamName[ number ] ] then findskin = 1 end if num < 1 then num = #skin foundTeam = 6 elseif num == #skin[ TeamName[ 1 ] ] then foundTeam = 1 elseif num == #skin[ TeamName[ 2 ] ] then foundTeam = 2 elseif num == #skin[ TeamName[ 3 ] ] then foundTeam = 3 elseif num == #skin[ TeamName[ 4 ] ] then foundTeam = 4 elseif num == #skin[ TeamName[ 5 ] ] then foundTeam = 5 elseif num == #skin[ TeamName[ 6 ] ] then foundTeam = 6 elseif num == #skin[ TeamName[ 7 ] ] then foundTeam = 1 num = 1 end number = foundTeam ID = skin[TeamName[number]][findskin] Team = " " .. TeamName[number] .. " " NewTeam = foundTeam TextColor(number) setElementModel(Ped[1], ID) setPedAnimation(Ped[1], "DANCING", Anims[math.random(1, 5)]) if Ped[1] then destroyElement(Ped[1]) Ped[1] = nil end local x, y, z, lx, ly, lz = foundPos(1), foundPos(2), foundPos(3), foundPos(4), foundPos(5), foundPos(6) wasFoundCamAndPed = foundTeam local pedx, pedy, pedz = foundPos(7), foundPos(8), foundPos(9) Ped[1] = createPed(ID, pedx, pedy, pedz, Rot[number]) if not isElement(Ped[1]) then Ped[1] = createPed(ID, pedx, pedy, pedz, Rot[number]) end setElementFrozen(Ped[1], true) setPedAnimation(Ped[1], "DANCING", Anims[math.random(1, 6)]) setCameraMatrix(x, y, z, lx, ly, lz) end function TextColor(numbe) if TeamName[numbe] == "Grove" then Color = {0, 255, 0} elseif TeamName[numbe] == "Aztecas" then Color =
  15. اخخوي انصحكك انكك تاخذ جميع الاكآونت ب الوظيفهه getAccounts سوي لهآ لوب و ارسلهآ للكلاينت واضيفهآ ب القريد ليست
  16. اخخوي طيب شلون تبي تحذف الاكآونت ؟ يعني مسوي قريد ليست ولا وشلون , ولا حسآبك ذذ
  17. ججرب ذآ طيب addEvent( "removeall", true ) addEventHandler( "removeall", root, function( account ) for _, aclGroup in ipairs ( { 'Police', 'Moderator' } ) do if isObjectInACLGroup ( 'user.' ..getAccountName( getPlayerAccount( getPlayerFromName( account ) ) ) , aclGetGroup ( aclGroup ) ) then aclGroupRemoveObject( aclGetGroup ( aclGroup ), 'user.'..getAccountName( getPlayerAccount( getPlayerFromName( account ) ) ) ); end end end ); + لا تنسى تضيف السكريبت في قروب الادمن
  18. Is he mean to draw a line in the map without he drawn it in the image ?
  19. اخخوي الخآص حقكك مقفل عع ممآ اضن = ) لككني متوآجد $'
  20. Change ' onClienRender ' to ' onClientRender '
  21. Here's an example for real time addEventHandler( 'onClientRender', root, function ( ) local realtime = getRealTime(); local Hour = realtime.hour; local Minutes = realtime.minute; if Hour == 20 and Minutes = 0 then -- Do something, like you want to play sound : playSound( ... ); end end ); and example for game time addEventHandler( 'onClientRender', root, function ( ) local Hour, Minutes = getTime(); if Hour == 20 and Minutes = 0 then -- Do something, like you want to play sound : playSound( ... ); end end );
×
×
  • Create New...