Jump to content

مشكلة واجهتني شخصياا


Recommended Posts

في سيرفري بدون ذكر اسم

واجهتني مشكله انا حاط في اف 7 و اف 6 مودين

اف 7 مود مخدرات

و اف 6 مود قروبات

لاكن احيانا تكون مو شغاله عندي يعني ما تفتح الوحه

لاكن عند لاعب اخر تفتح

يعني المود شغال لاكن فيه مشاكل انها تفتح عند بعض الاعبين و البعض لا

مو معناها ني اضغط يفتح عنده

لا لا يعني اضغط و ما تفتح معي بس لو ضغط اخوي تفتح معاه

ولو سويت للمود رستارت يشتغل تمام

في حل وله لا؟؟

Link to comment
ويمكن يكون فيه غلط بكود فتح النافذة

أطرحة نشوف.

ماعتقد أنها من السكربت لانه قال لو سويت ريستارت تتصلح

ماقلت يطرح اكواده كامله , يطرح بس كود فتح النافذه وش بيخسر ض1 ؟

+ اول مره اسمع بذي المشكله الغريبه :redhotevil:

Link to comment
ويمكن يكون فيه غلط بكود فتح النافذة

أطرحة نشوف.

ماعتقد أنها من السكربت لانه قال لو سويت ريستارت تتصلح

ماقلت يطرح اكواده كامله , يطرح بس كود فتح النافذه وش بيخسر ض1 ؟

+ اول مره اسمع بذي المشكله الغريبه :redhotevil:

addCommandHandler("drog" , PanelShow) 
bindKey("F7","down",PanelShow) 
addEventHandler ("onClientGUIClick", getRootElement(),  
function() 
if (source == useM5drat) then 
if guiRadioButtonGetSelected(radioButton1) == true then 
if getElementData(localPlayer,"Weed") > 0 then 
if getElementData(localPlayer,"WeedT") == false then 
setElementData(localPlayer,"WeedT",true) 
triggerServerEvent ( "takeWeed", localPlayer ) 
setGameSpeed(1.5) 
setTimer(setGameSpeed,60000,1,1) 
setTimer(setElementData,60000,1,localPlayer,"WeedT",false) 
end 
end 

Link to comment
أطرح الوظيفة PanelShow
  
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 - callClientFunction(source, "dxGetTextWidth", str:gsub("#%x%x%x%x%x%x",""), scale, font))/2
    elseif alignX == "right" then
      ax = bx - callClientFunction(source, "dxGetTextWidth", str:gsub("#%x%x%x%x%x%x",""), scale, font)
    end
  end
  if alignY then
    if alignY == "center" then
      ay = ay + (by - ay - callClientFunction(source, "dxGetFontHeight", scale, font))/2
    elseif alignY == "bottom" then
      ay = by - callClientFunction(source, "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)
      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)
    callClientFunction(source, "dxDrawText", cap, ax, ay, ax + callClientFunction(source, "dxGetTextWidth", cap, scale, font ), by, color, scale, font )
  end
end
 
M5dratMisson = createBlip( 2156.1762695313, -1651.7482910156, 14.078443527222, 24, 3, 0, 0, 255, 255, 0, 250)
local d5olm5dratShop = createMarker( 2156.1762695313, -1651.7482910156, 14.078443527222, "cylinder", 1.5, 242, 242, 242, 95 )
local rojm5dratShop = createMarker( 140.32954,1366.60278,1083.85938-1, "cylinder", 1.5, 242, 242, 242, 95 )
local m5dratShop = createMarker( 140.46518,1385.14026,1088.36719-1, "cylinder", 2, 255, 255, 0, 170 )
setElementInterior ( rojm5dratShop, 5 )
setElementInterior ( m5dratShop, 5 )
function d5olShop(theElement)
if getElementType(theElement) == "player" and (theElement == localPlayer) then
fadeCamera(false)
setTimer(setElementInterior, 1000, 1, theElement, 5)
setTimer(setElementPosition, 1000, 1, theElement, 140.36220,1380.57886,1088.36719)
setTimer(setPedRotation, 1000, 1, theElement, 270)
setTimer(fadeCamera, 1000, 1, true)
playSoundFrontEnd(1)
end
end
function rojShop(theElement)
if getElementType(theElement) == "player" and (theElement == localPlayer) then
fadeCamera(false)
setTimer(setElementInterior, 1000, 1, theElement, 0)
setTimer(setElementPosition, 1000, 1, theElement, 2157.74512,-1653.11218,15.07844)
setTimer(setPedRotation, 1000, 1, theElement, 270)
setTimer(fadeCamera, 1000, 1, true)
playSoundFrontEnd(1)
end
end
function ShowM5dratPanel(theElement)
if getElementType(theElement) == "player" and (theElement == localPlayer) then
guiSetVisible (buywindow,true)
showCursor (true)
end
end
--- useFull
function centerWindow(center_window)
    local screenW,screenH=guiGetScreenSize()
    local windowW,windowH=guiGetSize(center_window,false)
    local x,y = (screenW-windowW)/2,(screenH-windowH)/2
    guiSetPosition(center_window,x,y,false)
end
 
GUIEditor = {
    staticimage = {},
    edit = {},
    button = {},
    window = {},
    label = {}
}
buywindow = guiCreateWindow(321, 125, 239, 475, "Drug-system Shop ", false)
guiSetVisible (buywindow,false)
centerWindow(buywindow)
guiWindowSetSizable(buywindow, false)
 
edit2 = guiCreateEdit(72, 220, 100, 33, "0", false, buywindow)
edit3 = guiCreateEdit(72, 81, 100, 33,"0", false, buywindow)
edit5 = guiCreateEdit(72, 292, 100, 33, "0", false, buywindow)
edit6 = guiCreateEdit(72, 152, 100, 33, "0", false, buywindow)
 
guiEditSetMaxLength ( edit2, 2 )
guiEditSetMaxLength ( edit3, 2 )
guiEditSetMaxLength ( edit5, 2 )
guiEditSetMaxLength ( edit6, 2 )
edit8 = guiCreateEdit(43, 380, 153, 33, "", false, buywindow)
guiEditSetReadOnly(edit8, true)
buyButton = guiCreateButton(43, 349, 156, 31, "Buy", false, buywindow)
guiSetProperty(buyButton, "NormalTextColour", "FFAAAAAA")
 
label2 = guiCreateLabel(76, 195, 100, 15, "الدم(Health 200)", false, buywindow)
 
label3 = guiCreateLabel(66, 50, 116, 15, "السرعة (Speed X10)", false, buywindow)
 
label5 = guiCreateLabel(72, 263, 104, 19, "مضاعفة إصابة العدو", false, buywindow)
 
label6 = guiCreateLabel(90, 124, 64, 18, "قوة الدم", false, buywindow)
 
closeButton = guiCreateButton(47, 428, 139, 27, "Close", false, buywindow)
        GUIEditor.staticimage[1] = guiCreateStaticImage(9, 132, 63, 43, "12.png", false, buywindow)
        GUIEditor.staticimage[2] = guiCreateStaticImage(12, 200, 46, 53, "123.png", false, buywindow)
        GUIEditor.staticimage[3] = guiCreateStaticImage(13, 61, 43, 47, "123456.png", false, buywindow)
        GUIEditor.staticimage[4] = guiCreateStaticImage(12, 278, 44, 43, "12345.png", false, buywindow)  
 
 
--- window1 fic
function SetAll()
 
if tonumber(guiGetText ( edit2 )) ~= nil then
setElementData( localPlayer,"GodMoney", guiGetText( edit2 )*getElementData(localPlayer,"GodPrice") )
else
guiSetText ( edit2,"0" )
end
if tonumber(guiGetText ( edit3 )) ~= nil then
setElementData( localPlayer,"SpeedMoney", guiGetText( edit3 )*getElementData(localPlayer,"SpeedPrice") )
else
guiSetText ( edit3,"0" )
end
 
if tonumber(guiGetText ( edit5 )) ~= nil then
setElementData( localPlayer,"SteroidsMoney", guiGetText( edit5 )*getElementData(localPlayer,"SteroidsPrice") )
else
guiSetText ( edit5,"0" )
end
if tonumber(guiGetText ( edit6 )) ~= nil then
setElementData( localPlayer,"HeroinMoney", guiGetText( edit6 )*getElementData(localPlayer,"HeroinPrice") )
else
guiSetText ( edit6,"0" )
end
end
setTimer(
function()
if ( guiGetVisible ( buywindow ) == true ) then
guiSetText ( edit8, getElementData( localPlayer,"WeedMoney" )+getElementData( localPlayer,"GodMoney" )+getElementData( localPlayer,"SpeedMoney")+getElementData( localPlayer,"LsdMoney" )+getElementData( localPlayer,"SteroidsMoney" )+getElementData( localPlayer,"HeroinMoney" )+getElementData( localPlayer,"ALLMoney" ) )
end
end,50,0)
addEventHandler ("onClientGUIClick", getRootElement(),
function()
if (source == closeButton) then
guiSetVisible (buywindow,false)
showCursor (false)
elseif (source == buyButton) then
 
 
triggerServerEvent ( "giveGod", localPlayer, getElementData( localPlayer,"GodMoney" ), guiGetText( edit2 ))
triggerServerEvent ( "giveSpeed", localPlayer, getElementData( localPlayer,"SpeedMoney" ), guiGetText( edit3 ))
triggerServerEvent ( "giveSteroids", localPlayer, getElementData( localPlayer,"SteroidsMoney" ), guiGetText( edit5 ))
triggerServerEvent ( "giveHeroin", localPlayer, getElementData( localPlayer,"HeroinMoney" ), guiGetText( edit6 ))
 
end
end
 
)
 
GUIEditor = {
    staticimage = {},
    edit = {},
    button = {},
    window = {},
    label = {}
}
useWindow = guiCreateWindow(382, 178, 255, 356, "Drugs Panel - تعاطي المخدرات", false)
centerWindow(useWindow)
guiSetVisible (useWindow,false)
guiWindowSetSizable(useWindow, false)
 
radioButton2 = guiCreateRadioButton(10, 127, 205, 21, "الدم(Health 200)", false, useWindow)
 
radioButton3 = guiCreateRadioButton(10, 168, 205, 21, "السرعة (Speed X10)", false, useWindow)
 
 
radioButton5 = guiCreateRadioButton(9, 211, 205, 21, "مضاعفة إصابة العدو", false, useWindow)
 
radioButton6 = guiCreateRadioButton(9, 256, 205, 21, "قوة الدم", false, useWindow)
 
GodLabel = guiCreateLabel(221, 127, 24, 20, "".. getElementData(localPlayer,"God") .."", false, useWindow)
SpeedLabel = guiCreateLabel(221, 168, 24, 20, "".. getElementData(localPlayer,"Speed") .."", false, useWindow)
SteroidsLabel = guiCreateLabel(221, 212, 24, 20, "".. getElementData(localPlayer,"Steroids") .."", false, useWindow)
Heroin = guiCreateLabel(221, 257, 24, 20, "".. getElementData(localPlayer,"Heroin") .."", false, useWindow)
useM5drat = guiCreateButton(9, 298, 235, 41, "Use", false, useWindow)
GUIEditor.staticimage[1] = guiCreateStaticImage(38, 34, 183, 74, "123.png", false, useWindow)    
guiSetProperty(useM5drat, "NormalTextColour", "FFAAAAAA")
--------- Bind
function PanelShow ()
getVisible = guiGetVisible (useWindow)
if (getVisible == true) then
guiSetVisible (useWindow, false)
showCursor (false)
elseif (getVisible == false) then   
showCursor (true)
guiSetVisible (useWindow, true)
guiSetInputEnabled(false)
end
end
addCommandHandler("drog" , PanelShow)
bindKey("F7","down",PanelShow)
addEventHandler ("onClientGUIClick", getRootElement(),
function()
if (source == useM5drat) then
if guiRadioButtonGetSelected(radioButton1) == true then
if getElementData(localPlayer,"Weed") > 0 then
if getElementData(localPlayer,"WeedT") == false then
setElementData(localPlayer,"WeedT",true)
triggerServerEvent ( "takeWeed", localPlayer )
setGameSpeed(1.5)
setTimer(setGameSpeed,60000,1,1)
setTimer(setElementData,60000,1,localPlayer,"WeedT",false)
end
end
elseif guiRadioButtonGetSelected(radioButton2) == true then
if getElementData(localPlayer,"God") > 0 then
if getElementData(localPlayer,"GodT") == false then
setElementData(localPlayer,"GodT",true)
triggerServerEvent ( "takeGod", localPlayer )
setTimer(setElementData,60000,1,localPlayer,"GodT",false)
setTimer(triggerServerEvent,60000,1,"removeGod", localPlayer)
end
end
elseif guiRadioButtonGetSelected(radioButton3) == true then
if getElementData(localPlayer,"Speed") > 0 then
if getElementData(localPlayer,"SpeedT") == false then
setElementData(localPlayer,"SpeedT",true)
triggerServerEvent ( "takeSpeed", localPlayer )
setGameSpeed(10)
setTimer(setGameSpeed,60000,1,1)
setTimer(triggerServerEvent,60000,1,"removeSpeed", localPlayer)
setTimer(setElementData,60000,1,localPlayer,"SpeedT",false)
end
end
elseif guiRadioButtonGetSelected(radioButton4) == true then
if getElementData(localPlayer,"Lsd") > 0 then
if getElementData(localPlayer,"LsdT") == false then
setElementData(localPlayer,"LsdT",true)
triggerServerEvent ( "takeLsd", localPlayer )
setGameSpeed(0.9)
setPedWalkingStyle(localPlayer,120)
Link to comment

  
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 - callClientFunction(source, "dxGetTextWidth", str:gsub("#%x%x%x%x%x%x",""), scale, font))/2
    elseif alignX == "right" then
      ax = bx - callClientFunction(source, "dxGetTextWidth", str:gsub("#%x%x%x%x%x%x",""), scale, font)
    end
  end
  if alignY then
    if alignY == "center" then
      ay = ay + (by - ay - callClientFunction(source, "dxGetFontHeight", scale, font))/2
    elseif alignY == "bottom" then
      ay = by - callClientFunction(source, "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)
      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)
    callClientFunction(source, "dxDrawText", cap, ax, ay, ax + callClientFunction(source, "dxGetTextWidth", cap, scale, font ), by, color, scale, font )
  end
end
 
M5dratMisson = createBlip( 2156.1762695313, -1651.7482910156, 14.078443527222, 24, 3, 0, 0, 255, 255, 0, 250)
local d5olm5dratShop = createMarker( 2156.1762695313, -1651.7482910156, 14.078443527222, "cylinder", 1.5, 242, 242, 242, 95 )
local rojm5dratShop = createMarker( 140.32954,1366.60278,1083.85938-1, "cylinder", 1.5, 242, 242, 242, 95 )
local m5dratShop = createMarker( 140.46518,1385.14026,1088.36719-1, "cylinder", 2, 255, 255, 0, 170 )
setElementInterior ( rojm5dratShop, 5 )
setElementInterior ( m5dratShop, 5 )
function d5olShop(theElement)
if getElementType(theElement) == "player" and (theElement == localPlayer) then
fadeCamera(false)
setTimer(setElementInterior, 1000, 1, theElement, 5)
setTimer(setElementPosition, 1000, 1, theElement, 140.36220,1380.57886,1088.36719)
setTimer(setPedRotation, 1000, 1, theElement, 270)
setTimer(fadeCamera, 1000, 1, true)
playSoundFrontEnd(1)
end
end
function rojShop(theElement)
if getElementType(theElement) == "player" and (theElement == localPlayer) then
fadeCamera(false)
setTimer(setElementInterior, 1000, 1, theElement, 0)
setTimer(setElementPosition, 1000, 1, theElement, 2157.74512,-1653.11218,15.07844)
setTimer(setPedRotation, 1000, 1, theElement, 270)
setTimer(fadeCamera, 1000, 1, true)
playSoundFrontEnd(1)
end
end
function ShowM5dratPanel(theElement)
if getElementType(theElement) == "player" and (theElement == localPlayer) then
guiSetVisible (buywindow,true)
showCursor (true)
end
end
--- useFull
function centerWindow(center_window)
    local screenW,screenH=guiGetScreenSize()
    local windowW,windowH=guiGetSize(center_window,false)
    local x,y = (screenW-windowW)/2,(screenH-windowH)/2
    guiSetPosition(center_window,x,y,false)
end
 
GUIEditor = {
    staticimage = {},
    edit = {},
    button = {},
    window = {},
    label = {}
}
buywindow = guiCreateWindow(321, 125, 239, 475, "Drug-system Shop ", false)
guiSetVisible (buywindow,false)
centerWindow(buywindow)
guiWindowSetSizable(buywindow, false)
 
edit2 = guiCreateEdit(72, 220, 100, 33, "0", false, buywindow)
edit3 = guiCreateEdit(72, 81, 100, 33,"0", false, buywindow)
edit5 = guiCreateEdit(72, 292, 100, 33, "0", false, buywindow)
edit6 = guiCreateEdit(72, 152, 100, 33, "0", false, buywindow)
 
guiEditSetMaxLength ( edit2, 2 )
guiEditSetMaxLength ( edit3, 2 )
guiEditSetMaxLength ( edit5, 2 )
guiEditSetMaxLength ( edit6, 2 )
edit8 = guiCreateEdit(43, 380, 153, 33, "", false, buywindow)
guiEditSetReadOnly(edit8, true)
buyButton = guiCreateButton(43, 349, 156, 31, "Buy", false, buywindow)
guiSetProperty(buyButton, "NormalTextColour", "FFAAAAAA")
 
label2 = guiCreateLabel(76, 195, 100, 15, "الدم(Health 200)", false, buywindow)
 
label3 = guiCreateLabel(66, 50, 116, 15, "السرعة (Speed X10)", false, buywindow)
 
label5 = guiCreateLabel(72, 263, 104, 19, "مضاعفة إصابة العدو", false, buywindow)
 
label6 = guiCreateLabel(90, 124, 64, 18, "قوة الدم", false, buywindow)
 
closeButton = guiCreateButton(47, 428, 139, 27, "Close", false, buywindow)
        GUIEditor.staticimage[1] = guiCreateStaticImage(9, 132, 63, 43, "12.png", false, buywindow)
        GUIEditor.staticimage[2] = guiCreateStaticImage(12, 200, 46, 53, "123.png", false, buywindow)
        GUIEditor.staticimage[3] = guiCreateStaticImage(13, 61, 43, 47, "123456.png", false, buywindow)
        GUIEditor.staticimage[4] = guiCreateStaticImage(12, 278, 44, 43, "12345.png", false, buywindow)  
 
 
--- window1 fic
function SetAll()
 
if tonumber(guiGetText ( edit2 )) ~= nil then
setElementData( localPlayer,"GodMoney", guiGetText( edit2 )*getElementData(localPlayer,"GodPrice") )
else
guiSetText ( edit2,"0" )
end
if tonumber(guiGetText ( edit3 )) ~= nil then
setElementData( localPlayer,"SpeedMoney", guiGetText( edit3 )*getElementData(localPlayer,"SpeedPrice") )
else
guiSetText ( edit3,"0" )
end
 
if tonumber(guiGetText ( edit5 )) ~= nil then
setElementData( localPlayer,"SteroidsMoney", guiGetText( edit5 )*getElementData(localPlayer,"SteroidsPrice") )
else
guiSetText ( edit5,"0" )
end
if tonumber(guiGetText ( edit6 )) ~= nil then
setElementData( localPlayer,"HeroinMoney", guiGetText( edit6 )*getElementData(localPlayer,"HeroinPrice") )
else
guiSetText ( edit6,"0" )
end
end
setTimer(
function()
if ( guiGetVisible ( buywindow ) == true ) then
guiSetText ( edit8, getElementData( localPlayer,"WeedMoney" )+getElementData( localPlayer,"GodMoney" )+getElementData( localPlayer,"SpeedMoney")+getElementData( localPlayer,"LsdMoney" )+getElementData( localPlayer,"SteroidsMoney" )+getElementData( localPlayer,"HeroinMoney" )+getElementData( localPlayer,"ALLMoney" ) )
end
end,50,0)
addEventHandler ("onClientGUIClick", getRootElement(),
function()
if (source == closeButton) then
guiSetVisible (buywindow,false)
showCursor (false)
elseif (source == buyButton) then
 
 
triggerServerEvent ( "giveGod", localPlayer, getElementData( localPlayer,"GodMoney" ), guiGetText( edit2 ))
triggerServerEvent ( "giveSpeed", localPlayer, getElementData( localPlayer,"SpeedMoney" ), guiGetText( edit3 ))
triggerServerEvent ( "giveSteroids", localPlayer, getElementData( localPlayer,"SteroidsMoney" ), guiGetText( edit5 ))
triggerServerEvent ( "giveHeroin", localPlayer, getElementData( localPlayer,"HeroinMoney" ), guiGetText( edit6 ))
 
end
end
 
)
 
GUIEditor = {
    staticimage = {},
    edit = {},
    button = {},
    window = {},
    label = {}
}
useWindow = guiCreateWindow(382, 178, 255, 356, "Drugs Panel - تعاطي المخدرات", false)
centerWindow(useWindow)
guiSetVisible (useWindow,false)
guiWindowSetSizable(useWindow, false)
 
radioButton2 = guiCreateRadioButton(10, 127, 205, 21, "الدم(Health 200)", false, useWindow)
 
radioButton3 = guiCreateRadioButton(10, 168, 205, 21, "السرعة (Speed X10)", false, useWindow)
 
 
radioButton5 = guiCreateRadioButton(9, 211, 205, 21, "مضاعفة إصابة العدو", false, useWindow)
 
radioButton6 = guiCreateRadioButton(9, 256, 205, 21, "قوة الدم", false, useWindow)
 
GodLabel = guiCreateLabel(221, 127, 24, 20, "".. getElementData(localPlayer,"God") .."", false, useWindow)
SpeedLabel = guiCreateLabel(221, 168, 24, 20, "".. getElementData(localPlayer,"Speed") .."", false, useWindow)
SteroidsLabel = guiCreateLabel(221, 212, 24, 20, "".. getElementData(localPlayer,"Steroids") .."", false, useWindow)
Heroin = guiCreateLabel(221, 257, 24, 20, "".. getElementData(localPlayer,"Heroin") .."", false, useWindow)
useM5drat = guiCreateButton(9, 298, 235, 41, "Use", false, useWindow)
GUIEditor.staticimage[1] = guiCreateStaticImage(38, 34, 183, 74, "123.png", false, useWindow)    
guiSetProperty(useM5drat, "NormalTextColour", "FFAAAAAA")
--------- Bind
 
function PanelShow()
if guiGetVisible( useWindow ) then
    guiSetVisible(useWindow, false)
    showCursor(false)
else
    guiSetVisible(useWindow, true)
    showCursor(true)
         end
 end
addCommandHandler("drog" , PanelShow)
bindKey("F7","down",PanelShow)
addEventHandler ("onClientGUIClick", getRootElement(),
function()
if (source == useM5drat) then
if guiRadioButtonGetSelected(radioButton1) == true then
if getElementData(localPlayer,"Weed") > 0 then
if getElementData(localPlayer,"WeedT") == false then
setElementData(localPlayer,"WeedT",true)
triggerServerEvent ( "takeWeed", localPlayer )
setGameSpeed(1.5)
setTimer(setGameSpeed,60000,1,1)
setTimer(setElementData,60000,1,localPlayer,"WeedT",false)
end
end
elseif guiRadioButtonGetSelected(radioButton2) == true then
if getElementData(localPlayer,"God") > 0 then
if getElementData(localPlayer,"GodT") == false then
setElementData(localPlayer,"GodT",true)
triggerServerEvent ( "takeGod", localPlayer )
setTimer(setElementData,60000,1,localPlayer,"GodT",false)
setTimer(triggerServerEvent,60000,1,"removeGod", localPlayer)
end
end
elseif guiRadioButtonGetSelected(radioButton3) == true then
if getElementData(localPlayer,"Speed") > 0 then
if getElementData(localPlayer,"SpeedT") == false then
setElementData(localPlayer,"SpeedT",true)
triggerServerEvent ( "takeSpeed", localPlayer )
setGameSpeed(10)
setTimer(setGameSpeed,60000,1,1)
setTimer(triggerServerEvent,60000,1,"removeSpeed", localPlayer)
setTimer(setElementData,60000,1,localPlayer,"SpeedT",false)
end
end
elseif guiRadioButtonGetSelected(radioButton4) == true then
if getElementData(localPlayer,"Lsd") > 0 then
if getElementData(localPlayer,"LsdT") == false then
setElementData(localPlayer,"LsdT",true)
triggerServerEvent ( "takeLsd", localPlayer )
setGameSpeed(0.9)
setPedWalkingStyle(localPlayer,120)
Link to comment

  
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 - callClientFunction(source, "dxGetTextWidth", str:gsub("#%x%x%x%x%x%x",""), scale, font))/2
    elseif alignX == "right" then
      ax = bx - callClientFunction(source, "dxGetTextWidth", str:gsub("#%x%x%x%x%x%x",""), scale, font)
    end
  end
  if alignY then
    if alignY == "center" then
      ay = ay + (by - ay - callClientFunction(source, "dxGetFontHeight", scale, font))/2
    elseif alignY == "bottom" then
      ay = by - callClientFunction(source, "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)
      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)
    callClientFunction(source, "dxDrawText", cap, ax, ay, ax + callClientFunction(source, "dxGetTextWidth", cap, scale, font ), by, color, scale, font )
  end
end
 
M5dratMisson = createBlip( 2156.1762695313, -1651.7482910156, 14.078443527222, 24, 3, 0, 0, 255, 255, 0, 250)
local d5olm5dratShop = createMarker( 2156.1762695313, -1651.7482910156, 14.078443527222, "cylinder", 1.5, 242, 242, 242, 95 )
local rojm5dratShop = createMarker( 140.32954,1366.60278,1083.85938-1, "cylinder", 1.5, 242, 242, 242, 95 )
local m5dratShop = createMarker( 140.46518,1385.14026,1088.36719-1, "cylinder", 2, 255, 255, 0, 170 )
setElementInterior ( rojm5dratShop, 5 )
setElementInterior ( m5dratShop, 5 )
function d5olShop(theElement)
if getElementType(theElement) == "player" and (theElement == localPlayer) then
fadeCamera(false)
setTimer(setElementInterior, 1000, 1, theElement, 5)
setTimer(setElementPosition, 1000, 1, theElement, 140.36220,1380.57886,1088.36719)
setTimer(setPedRotation, 1000, 1, theElement, 270)
setTimer(fadeCamera, 1000, 1, true)
playSoundFrontEnd(1)
end
end
function rojShop(theElement)
if getElementType(theElement) == "player" and (theElement == localPlayer) then
fadeCamera(false)
setTimer(setElementInterior, 1000, 1, theElement, 0)
setTimer(setElementPosition, 1000, 1, theElement, 2157.74512,-1653.11218,15.07844)
setTimer(setPedRotation, 1000, 1, theElement, 270)
setTimer(fadeCamera, 1000, 1, true)
playSoundFrontEnd(1)
end
end
function ShowM5dratPanel(theElement)
if getElementType(theElement) == "player" and (theElement == localPlayer) then
guiSetVisible (buywindow,true)
showCursor (true)
end
end
--- useFull
function centerWindow(center_window)
    local screenW,screenH=guiGetScreenSize()
    local windowW,windowH=guiGetSize(center_window,false)
    local x,y = (screenW-windowW)/2,(screenH-windowH)/2
    guiSetPosition(center_window,x,y,false)
end
 
GUIEditor = {
    staticimage = {},
    edit = {},
    button = {},
    window = {},
    label = {}
}
buywindow = guiCreateWindow(321, 125, 239, 475, "Drug-system Shop ", false)
guiSetVisible (buywindow,false)
centerWindow(buywindow)
guiWindowSetSizable(buywindow, false)
 
edit2 = guiCreateEdit(72, 220, 100, 33, "0", false, buywindow)
edit3 = guiCreateEdit(72, 81, 100, 33,"0", false, buywindow)
edit5 = guiCreateEdit(72, 292, 100, 33, "0", false, buywindow)
edit6 = guiCreateEdit(72, 152, 100, 33, "0", false, buywindow)
 
guiEditSetMaxLength ( edit2, 2 )
guiEditSetMaxLength ( edit3, 2 )
guiEditSetMaxLength ( edit5, 2 )
guiEditSetMaxLength ( edit6, 2 )
edit8 = guiCreateEdit(43, 380, 153, 33, "", false, buywindow)
guiEditSetReadOnly(edit8, true)
buyButton = guiCreateButton(43, 349, 156, 31, "Buy", false, buywindow)
guiSetProperty(buyButton, "NormalTextColour", "FFAAAAAA")
 
label2 = guiCreateLabel(76, 195, 100, 15, "الدم(Health 200)", false, buywindow)
 
label3 = guiCreateLabel(66, 50, 116, 15, "السرعة (Speed X10)", false, buywindow)
 
label5 = guiCreateLabel(72, 263, 104, 19, "مضاعفة إصابة العدو", false, buywindow)
 
label6 = guiCreateLabel(90, 124, 64, 18, "قوة الدم", false, buywindow)
 
closeButton = guiCreateButton(47, 428, 139, 27, "Close", false, buywindow)
        GUIEditor.staticimage[1] = guiCreateStaticImage(9, 132, 63, 43, "12.png", false, buywindow)
        GUIEditor.staticimage[2] = guiCreateStaticImage(12, 200, 46, 53, "123.png", false, buywindow)
        GUIEditor.staticimage[3] = guiCreateStaticImage(13, 61, 43, 47, "123456.png", false, buywindow)
        GUIEditor.staticimage[4] = guiCreateStaticImage(12, 278, 44, 43, "12345.png", false, buywindow)  
 
 
--- window1 fic
function SetAll()
 
if tonumber(guiGetText ( edit2 )) ~= nil then
setElementData( localPlayer,"GodMoney", guiGetText( edit2 )*getElementData(localPlayer,"GodPrice") )
else
guiSetText ( edit2,"0" )
end
if tonumber(guiGetText ( edit3 )) ~= nil then
setElementData( localPlayer,"SpeedMoney", guiGetText( edit3 )*getElementData(localPlayer,"SpeedPrice") )
else
guiSetText ( edit3,"0" )
end
 
if tonumber(guiGetText ( edit5 )) ~= nil then
setElementData( localPlayer,"SteroidsMoney", guiGetText( edit5 )*getElementData(localPlayer,"SteroidsPrice") )
else
guiSetText ( edit5,"0" )
end
if tonumber(guiGetText ( edit6 )) ~= nil then
setElementData( localPlayer,"HeroinMoney", guiGetText( edit6 )*getElementData(localPlayer,"HeroinPrice") )
else
guiSetText ( edit6,"0" )
end
end
setTimer(
function()
if ( guiGetVisible ( buywindow ) == true ) then
guiSetText ( edit8, getElementData( localPlayer,"WeedMoney" )+getElementData( localPlayer,"GodMoney" )+getElementData( localPlayer,"SpeedMoney")+getElementData( localPlayer,"LsdMoney" )+getElementData( localPlayer,"SteroidsMoney" )+getElementData( localPlayer,"HeroinMoney" )+getElementData( localPlayer,"ALLMoney" ) )
end
end,50,0)
addEventHandler ("onClientGUIClick", getRootElement(),
function()
if (source == closeButton) then
guiSetVisible (buywindow,false)
showCursor (false)
elseif (source == buyButton) then
 
 
triggerServerEvent ( "giveGod", localPlayer, getElementData( localPlayer,"GodMoney" ), guiGetText( edit2 ))
triggerServerEvent ( "giveSpeed", localPlayer, getElementData( localPlayer,"SpeedMoney" ), guiGetText( edit3 ))
triggerServerEvent ( "giveSteroids", localPlayer, getElementData( localPlayer,"SteroidsMoney" ), guiGetText( edit5 ))
triggerServerEvent ( "giveHeroin", localPlayer, getElementData( localPlayer,"HeroinMoney" ), guiGetText( edit6 ))
 
end
end
 
)
 
GUIEditor = {
    staticimage = {},
    edit = {},
    button = {},
    window = {},
    label = {}
}
useWindow = guiCreateWindow(382, 178, 255, 356, "Drugs Panel - تعاطي المخدرات", false)
centerWindow(useWindow)
guiSetVisible (useWindow,false)
guiWindowSetSizable(useWindow, false)
 
radioButton2 = guiCreateRadioButton(10, 127, 205, 21, "الدم(Health 200)", false, useWindow)
 
radioButton3 = guiCreateRadioButton(10, 168, 205, 21, "السرعة (Speed X10)", false, useWindow)
 
 
radioButton5 = guiCreateRadioButton(9, 211, 205, 21, "مضاعفة إصابة العدو", false, useWindow)
 
radioButton6 = guiCreateRadioButton(9, 256, 205, 21, "قوة الدم", false, useWindow)
 
GodLabel = guiCreateLabel(221, 127, 24, 20, "".. getElementData(localPlayer,"God") .."", false, useWindow)
SpeedLabel = guiCreateLabel(221, 168, 24, 20, "".. getElementData(localPlayer,"Speed") .."", false, useWindow)
SteroidsLabel = guiCreateLabel(221, 212, 24, 20, "".. getElementData(localPlayer,"Steroids") .."", false, useWindow)
Heroin = guiCreateLabel(221, 257, 24, 20, "".. getElementData(localPlayer,"Heroin") .."", false, useWindow)
useM5drat = guiCreateButton(9, 298, 235, 41, "Use", false, useWindow)
GUIEditor.staticimage[1] = guiCreateStaticImage(38, 34, 183, 74, "123.png", false, useWindow)    
guiSetProperty(useM5drat, "NormalTextColour", "FFAAAAAA")
--------- Bind
 
function PanelShow()
if guiGetVisible( useWindow ) then
    guiSetVisible(useWindow, false)
    showCursor(false)
else
    guiSetVisible(useWindow, true)
    showCursor(true)
         end
 end
addCommandHandler("drog" , PanelShow)
bindKey("F7","down",PanelShow)
addEventHandler ("onClientGUIClick", getRootElement(),
function()
if (source == useM5drat) then
if guiRadioButtonGetSelected(radioButton1) == true then
if getElementData(localPlayer,"Weed") > 0 then
if getElementData(localPlayer,"WeedT") == false then
setElementData(localPlayer,"WeedT",true)
triggerServerEvent ( "takeWeed", localPlayer )
setGameSpeed(1.5)
setTimer(setGameSpeed,60000,1,1)
setTimer(setElementData,60000,1,localPlayer,"WeedT",false)
end
end
elseif guiRadioButtonGetSelected(radioButton2) == true then
if getElementData(localPlayer,"God") > 0 then
if getElementData(localPlayer,"GodT") == false then
setElementData(localPlayer,"GodT",true)
triggerServerEvent ( "takeGod", localPlayer )
setTimer(setElementData,60000,1,localPlayer,"GodT",false)
setTimer(triggerServerEvent,60000,1,"removeGod", localPlayer)
end
end
elseif guiRadioButtonGetSelected(radioButton3) == true then
if getElementData(localPlayer,"Speed") > 0 then
if getElementData(localPlayer,"SpeedT") == false then
setElementData(localPlayer,"SpeedT",true)
triggerServerEvent ( "takeSpeed", localPlayer )
setGameSpeed(10)
setTimer(setGameSpeed,60000,1,1)
setTimer(triggerServerEvent,60000,1,"removeSpeed", localPlayer)
setTimer(setElementData,60000,1,localPlayer,"SpeedT",false)
end
end
elseif guiRadioButtonGetSelected(radioButton4) == true then
if getElementData(localPlayer,"Lsd") > 0 then
if getElementData(localPlayer,"LsdT") == false then
setElementData(localPlayer,"LsdT",true)
triggerServerEvent ( "takeLsd", localPlayer )
Link to comment

  
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 - callClientFunction(source, "dxGetTextWidth", str:gsub("#%x%x%x%x%x%x",""), scale, font))/2
    elseif alignX == "right" then
      ax = bx - callClientFunction(source, "dxGetTextWidth", str:gsub("#%x%x%x%x%x%x",""), scale, font)
    end
  end
  if alignY then
    if alignY == "center" then
      ay = ay + (by - ay - callClientFunction(source, "dxGetFontHeight", scale, font))/2
    elseif alignY == "bottom" then
      ay = by - callClientFunction(source, "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)
      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)
    callClientFunction(source, "dxDrawText", cap, ax, ay, ax + callClientFunction(source, "dxGetTextWidth", cap, scale, font ), by, color, scale, font )
  end
end
 
M5dratMisson = createBlip( 2156.1762695313, -1651.7482910156, 14.078443527222, 24, 3, 0, 0, 255, 255, 0, 250)
local d5olm5dratShop = createMarker( 2156.1762695313, -1651.7482910156, 14.078443527222, "cylinder", 1.5, 242, 242, 242, 95 )
local rojm5dratShop = createMarker( 140.32954,1366.60278,1083.85938-1, "cylinder", 1.5, 242, 242, 242, 95 )
local m5dratShop = createMarker( 140.46518,1385.14026,1088.36719-1, "cylinder", 2, 255, 255, 0, 170 )
setElementInterior ( rojm5dratShop, 5 )
setElementInterior ( m5dratShop, 5 )
function d5olShop(theElement)
if getElementType(theElement) == "player" and (theElement == localPlayer) then
fadeCamera(false)
setTimer(setElementInterior, 1000, 1, theElement, 5)
setTimer(setElementPosition, 1000, 1, theElement, 140.36220,1380.57886,1088.36719)
setTimer(setPedRotation, 1000, 1, theElement, 270)
setTimer(fadeCamera, 1000, 1, true)
playSoundFrontEnd(1)
end
end
function rojShop(theElement)
if getElementType(theElement) == "player" and (theElement == localPlayer) then
fadeCamera(false)
setTimer(setElementInterior, 1000, 1, theElement, 0)
setTimer(setElementPosition, 1000, 1, theElement, 2157.74512,-1653.11218,15.07844)
setTimer(setPedRotation, 1000, 1, theElement, 270)
setTimer(fadeCamera, 1000, 1, true)
playSoundFrontEnd(1)
end
end
function ShowM5dratPanel(theElement)
if getElementType(theElement) == "player" and (theElement == localPlayer) then
guiSetVisible (buywindow,true)
showCursor (true)
end
end
--- useFull
function centerWindow(center_window)
    local screenW,screenH=guiGetScreenSize()
    local windowW,windowH=guiGetSize(center_window,false)
    local x,y = (screenW-windowW)/2,(screenH-windowH)/2
    guiSetPosition(center_window,x,y,false)
end
 
GUIEditor = {
    staticimage = {},
    edit = {},
    button = {},
    window = {},
    label = {}
}
buywindow = guiCreateWindow(321, 125, 239, 475, "Drug-system Shop ", false)
guiSetVisible (buywindow,false)
centerWindow(buywindow)
guiWindowSetSizable(buywindow, false)
 
edit2 = guiCreateEdit(72, 220, 100, 33, "0", false, buywindow)
edit3 = guiCreateEdit(72, 81, 100, 33,"0", false, buywindow)
edit5 = guiCreateEdit(72, 292, 100, 33, "0", false, buywindow)
edit6 = guiCreateEdit(72, 152, 100, 33, "0", false, buywindow)
 
guiEditSetMaxLength ( edit2, 2 )
guiEditSetMaxLength ( edit3, 2 )
guiEditSetMaxLength ( edit5, 2 )
guiEditSetMaxLength ( edit6, 2 )
edit8 = guiCreateEdit(43, 380, 153, 33, "", false, buywindow)
guiEditSetReadOnly(edit8, true)
buyButton = guiCreateButton(43, 349, 156, 31, "Buy", false, buywindow)
guiSetProperty(buyButton, "NormalTextColour", "FFAAAAAA")
 
label2 = guiCreateLabel(76, 195, 100, 15, "الدم(Health 200)", false, buywindow)
 
label3 = guiCreateLabel(66, 50, 116, 15, "السرعة (Speed X10)", false, buywindow)
 
label5 = guiCreateLabel(72, 263, 104, 19, "مضاعفة إصابة العدو", false, buywindow)
 
label6 = guiCreateLabel(90, 124, 64, 18, "قوة الدم", false, buywindow)
 
closeButton = guiCreateButton(47, 428, 139, 27, "Close", false, buywindow)
        GUIEditor.staticimage[1] = guiCreateStaticImage(9, 132, 63, 43, "12.png", false, buywindow)
        GUIEditor.staticimage[2] = guiCreateStaticImage(12, 200, 46, 53, "123.png", false, buywindow)
        GUIEditor.staticimage[3] = guiCreateStaticImage(13, 61, 43, 47, "123456.png", false, buywindow)
        GUIEditor.staticimage[4] = guiCreateStaticImage(12, 278, 44, 43, "12345.png", false, buywindow)  
 
 
--- window1 fic
function SetAll()
 
if tonumber(guiGetText ( edit2 )) ~= nil then
setElementData( localPlayer,"GodMoney", guiGetText( edit2 )*getElementData(localPlayer,"GodPrice") )
else
guiSetText ( edit2,"0" )
end
if tonumber(guiGetText ( edit3 )) ~= nil then
setElementData( localPlayer,"SpeedMoney", guiGetText( edit3 )*getElementData(localPlayer,"SpeedPrice") )
else
guiSetText ( edit3,"0" )
end
 
if tonumber(guiGetText ( edit5 )) ~= nil then
setElementData( localPlayer,"SteroidsMoney", guiGetText( edit5 )*getElementData(localPlayer,"SteroidsPrice") )
else
guiSetText ( edit5,"0" )
end
if tonumber(guiGetText ( edit6 )) ~= nil then
setElementData( localPlayer,"HeroinMoney", guiGetText( edit6 )*getElementData(localPlayer,"HeroinPrice") )
else
guiSetText ( edit6,"0" )
end
end
setTimer(
function()
if ( guiGetVisible ( buywindow ) == true ) then
guiSetText ( edit8, getElementData( localPlayer,"WeedMoney" )+getElementData( localPlayer,"GodMoney" )+getElementData( localPlayer,"SpeedMoney")+getElementData( localPlayer,"LsdMoney" )+getElementData( localPlayer,"SteroidsMoney" )+getElementData( localPlayer,"HeroinMoney" )+getElementData( localPlayer,"ALLMoney" ) )
end
end,50,0)
addEventHandler ("onClientGUIClick", getRootElement(),
function()
if (source == closeButton) then
guiSetVisible (buywindow,false)
showCursor (false)
elseif (source == buyButton) then
 
 
triggerServerEvent ( "giveGod", localPlayer, getElementData( localPlayer,"GodMoney" ), guiGetText( edit2 ))
triggerServerEvent ( "giveSpeed", localPlayer, getElementData( localPlayer,"SpeedMoney" ), guiGetText( edit3 ))
triggerServerEvent ( "giveSteroids", localPlayer, getElementData( localPlayer,"SteroidsMoney" ), guiGetText( edit5 ))
triggerServerEvent ( "giveHeroin", localPlayer, getElementData( localPlayer,"HeroinMoney" ), guiGetText( edit6 ))
 
end
end
 
)
 
GUIEditor = {
    staticimage = {},
    edit = {},
    button = {},
    window = {},
    label = {}
}
useWindow = guiCreateWindow(382, 178, 255, 356, "Drugs Panel - تعاطي المخدرات", false)
centerWindow(useWindow)
guiSetVisible (useWindow,false)
guiWindowSetSizable(useWindow, false)
 
radioButton2 = guiCreateRadioButton(10, 127, 205, 21, "الدم(Health 200)", false, useWindow)
 
radioButton3 = guiCreateRadioButton(10, 168, 205, 21, "السرعة (Speed X10)", false, useWindow)
 
 
radioButton5 = guiCreateRadioButton(9, 211, 205, 21, "مضاعفة إصابة العدو", false, useWindow)
 
radioButton6 = guiCreateRadioButton(9, 256, 205, 21, "قوة الدم", false, useWindow)
 
GodLabel = guiCreateLabel(221, 127, 24, 20, "".. getElementData(localPlayer,"God") .."", false, useWindow)
SpeedLabel = guiCreateLabel(221, 168, 24, 20, "".. getElementData(localPlayer,"Speed") .."", false, useWindow)
SteroidsLabel = guiCreateLabel(221, 212, 24, 20, "".. getElementData(localPlayer,"Steroids") .."", false, useWindow)
Heroin = guiCreateLabel(221, 257, 24, 20, "".. getElementData(localPlayer,"Heroin") .."", false, useWindow)
useM5drat = guiCreateButton(9, 298, 235, 41, "Use", false, useWindow)
GUIEditor.staticimage[1] = guiCreateStaticImage(38, 34, 183, 74, "123.png", false, useWindow)    
guiSetProperty(useM5drat, "NormalTextColour", "FFAAAAAA")
--------- Bind
 
function PanelShow()
if guiGetVisible( useWindow ) then
    guiSetVisible(useWindow, false)
    showCursor(false)
else
    guiSetVisible(useWindow, true)
    showCursor(true)
         end
 end
addCommandHandler("drog" , PanelShow)
bindKey("F7","down",PanelShow)
addEventHandler ("onClientGUIClick", getRootElement(),
function()
if (source == useM5drat) then
if guiRadioButtonGetSelected(radioButton1) == true then
if getElementData(localPlayer,"Weed") > 0 then
if getElementData(localPlayer,"WeedT") == false then
setElementData(localPlayer,"WeedT",true)
triggerServerEvent ( "takeWeed", localPlayer )
setGameSpeed(1.5)
setTimer(setGameSpeed,60000,1,1)
setTimer(setElementData,60000,1,localPlayer,"WeedT",false)
end
end
elseif guiRadioButtonGetSelected(radioButton2) == true then
if getElementData(localPlayer,"God") > 0 then
if getElementData(localPlayer,"GodT") == false then
setElementData(localPlayer,"GodT",true)
triggerServerEvent ( "takeGod", localPlayer )
setTimer(setElementData,60000,1,localPlayer,"GodT",false)
setTimer(triggerServerEvent,60000,1,"removeGod", localPlayer)
end
end
elseif guiRadioButtonGetSelected(radioButton3) == true then
if getElementData(localPlayer,"Speed") > 0 then
if getElementData(localPlayer,"SpeedT") == false then
setElementData(localPlayer,"SpeedT",true)
triggerServerEvent ( "takeSpeed", localPlayer )
setGameSpeed(10)
setTimer(setGameSpeed,60000,1,1)
setTimer(triggerServerEvent,60000,1,"removeSpeed", localPlayer)
setTimer(setElementData,60000,1,localPlayer,"SpeedT",false)
end
end
elseif guiRadioButtonGetSelected(radioButton4) == true then
if getElementData(localPlayer,"Lsd") > 0 then
if getElementData(localPlayer,"LsdT") == false then
setElementData(localPlayer,"LsdT",true)
triggerServerEvent ( "takeLsd", localPlayer )
Link to comment

  
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 - callClientFunction(source, "dxGetTextWidth", str:gsub("#%x%x%x%x%x%x",""), scale, font))/2
    elseif alignX == "right" then
      ax = bx - callClientFunction(source, "dxGetTextWidth", str:gsub("#%x%x%x%x%x%x",""), scale, font)
    end
  end
  if alignY then
    if alignY == "center" then
      ay = ay + (by - ay - callClientFunction(source, "dxGetFontHeight", scale, font))/2
    elseif alignY == "bottom" then
      ay = by - callClientFunction(source, "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)
      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)
    callClientFunction(source, "dxDrawText", cap, ax, ay, ax + callClientFunction(source, "dxGetTextWidth", cap, scale, font ), by, color, scale, font )
  end
end
 
M5dratMisson = createBlip( 2156.1762695313, -1651.7482910156, 14.078443527222, 24, 3, 0, 0, 255, 255, 0, 250)
local d5olm5dratShop = createMarker( 2156.1762695313, -1651.7482910156, 14.078443527222, "cylinder", 1.5, 242, 242, 242, 95 )
local rojm5dratShop = createMarker( 140.32954,1366.60278,1083.85938-1, "cylinder", 1.5, 242, 242, 242, 95 )
local m5dratShop = createMarker( 140.46518,1385.14026,1088.36719-1, "cylinder", 2, 255, 255, 0, 170 )
setElementInterior ( rojm5dratShop, 5 )
setElementInterior ( m5dratShop, 5 )
function d5olShop(theElement)
if getElementType(theElement) == "player" and (theElement == localPlayer) then
fadeCamera(false)
setTimer(setElementInterior, 1000, 1, theElement, 5)
setTimer(setElementPosition, 1000, 1, theElement, 140.36220,1380.57886,1088.36719)
setTimer(setPedRotation, 1000, 1, theElement, 270)
setTimer(fadeCamera, 1000, 1, true)
playSoundFrontEnd(1)
end
end
function rojShop(theElement)
if getElementType(theElement) == "player" and (theElement == localPlayer) then
fadeCamera(false)
setTimer(setElementInterior, 1000, 1, theElement, 0)
setTimer(setElementPosition, 1000, 1, theElement, 2157.74512,-1653.11218,15.07844)
setTimer(setPedRotation, 1000, 1, theElement, 270)
setTimer(fadeCamera, 1000, 1, true)
playSoundFrontEnd(1)
end
end
function ShowM5dratPanel(theElement)
if getElementType(theElement) == "player" and (theElement == localPlayer) then
guiSetVisible (buywindow,true)
showCursor (true)
end
end
--- useFull
function centerWindow(center_window)
    local screenW,screenH=guiGetScreenSize()
    local windowW,windowH=guiGetSize(center_window,false)
    local x,y = (screenW-windowW)/2,(screenH-windowH)/2
    guiSetPosition(center_window,x,y,false)
end
 
GUIEditor = {
    staticimage = {},
    edit = {},
    button = {},
    window = {},
    label = {}
}
buywindow = guiCreateWindow(321, 125, 239, 475, "Drug-system Shop ", false)
guiSetVisible (buywindow,false)
centerWindow(buywindow)
guiWindowSetSizable(buywindow, false)
 
edit2 = guiCreateEdit(72, 220, 100, 33, "0", false, buywindow)
edit3 = guiCreateEdit(72, 81, 100, 33,"0", false, buywindow)
edit5 = guiCreateEdit(72, 292, 100, 33, "0", false, buywindow)
edit6 = guiCreateEdit(72, 152, 100, 33, "0", false, buywindow)
 
guiEditSetMaxLength ( edit2, 2 )
guiEditSetMaxLength ( edit3, 2 )
guiEditSetMaxLength ( edit5, 2 )
guiEditSetMaxLength ( edit6, 2 )
edit8 = guiCreateEdit(43, 380, 153, 33, "", false, buywindow)
guiEditSetReadOnly(edit8, true)
buyButton = guiCreateButton(43, 349, 156, 31, "Buy", false, buywindow)
guiSetProperty(buyButton, "NormalTextColour", "FFAAAAAA")
 
label2 = guiCreateLabel(76, 195, 100, 15, "الدم(Health 200)", false, buywindow)
 
label3 = guiCreateLabel(66, 50, 116, 15, "السرعة (Speed X10)", false, buywindow)
 
label5 = guiCreateLabel(72, 263, 104, 19, "مضاعفة إصابة العدو", false, buywindow)
 
label6 = guiCreateLabel(90, 124, 64, 18, "قوة الدم", false, buywindow)
 
closeButton = guiCreateButton(47, 428, 139, 27, "Close", false, buywindow)
        GUIEditor.staticimage[1] = guiCreateStaticImage(9, 132, 63, 43, "12.png", false, buywindow)
        GUIEditor.staticimage[2] = guiCreateStaticImage(12, 200, 46, 53, "123.png", false, buywindow)
        GUIEditor.staticimage[3] = guiCreateStaticImage(13, 61, 43, 47, "123456.png", false, buywindow)
        GUIEditor.staticimage[4] = guiCreateStaticImage(12, 278, 44, 43, "12345.png", false, buywindow)  
 
 
--- window1 fic
function SetAll()
 
if tonumber(guiGetText ( edit2 )) ~= nil then
setElementData( localPlayer,"GodMoney", guiGetText( edit2 )*getElementData(localPlayer,"GodPrice") )
else
guiSetText ( edit2,"0" )
end
if tonumber(guiGetText ( edit3 )) ~= nil then
setElementData( localPlayer,"SpeedMoney", guiGetText( edit3 )*getElementData(localPlayer,"SpeedPrice") )
else
guiSetText ( edit3,"0" )
end
 
if tonumber(guiGetText ( edit5 )) ~= nil then
setElementData( localPlayer,"SteroidsMoney", guiGetText( edit5 )*getElementData(localPlayer,"SteroidsPrice") )
else
guiSetText ( edit5,"0" )
end
if tonumber(guiGetText ( edit6 )) ~= nil then
setElementData( localPlayer,"HeroinMoney", guiGetText( edit6 )*getElementData(localPlayer,"HeroinPrice") )
else
guiSetText ( edit6,"0" )
end
end
setTimer(
function()
if ( guiGetVisible ( buywindow ) == true ) then
guiSetText ( edit8, getElementData( localPlayer,"WeedMoney" )+getElementData( localPlayer,"GodMoney" )+getElementData( localPlayer,"SpeedMoney")+getElementData( localPlayer,"LsdMoney" )+getElementData( localPlayer,"SteroidsMoney" )+getElementData( localPlayer,"HeroinMoney" )+getElementData( localPlayer,"ALLMoney" ) )
end
end,50,0)
addEventHandler ("onClientGUIClick", getRootElement(),
function()
if (source == closeButton) then
guiSetVisible (buywindow,false)
showCursor (false)
elseif (source == buyButton) then
 
 
triggerServerEvent ( "giveGod", localPlayer, getElementData( localPlayer,"GodMoney" ), guiGetText( edit2 ))
triggerServerEvent ( "giveSpeed", localPlayer, getElementData( localPlayer,"SpeedMoney" ), guiGetText( edit3 ))
triggerServerEvent ( "giveSteroids", localPlayer, getElementData( localPlayer,"SteroidsMoney" ), guiGetText( edit5 ))
triggerServerEvent ( "giveHeroin", localPlayer, getElementData( localPlayer,"HeroinMoney" ), guiGetText( edit6 ))
 
end
end
 
)
 
addEventHandler ("onClientResourceStart",resourceRoot,
function (  )
useWindow = guiCreateWindow(382, 178, 255, 356, "Drugs Panel - تعاطي المخدرات", false)
centerWindow(useWindow)
guiSetVisible (useWindow,false)
guiWindowSetSizable(useWindow, false)
 
radioButton2 = guiCreateRadioButton(10, 127, 205, 21, "الدم(Health 200)", false, useWindow)
 
radioButton3 = guiCreateRadioButton(10, 168, 205, 21, "السرعة (Speed X10)", false, useWindow)
 
 
radioButton5 = guiCreateRadioButton(9, 211, 205, 21, "مضاعفة إصابة العدو", false, useWindow)
 
radioButton6 = guiCreateRadioButton(9, 256, 205, 21, "قوة الدم", false, useWindow)
 
GodLabel = guiCreateLabel(221, 127, 24, 20, "".. getElementData(localPlayer,"God") .."", false, useWindow)
SpeedLabel = guiCreateLabel(221, 168, 24, 20, "".. getElementData(localPlayer,"Speed") .."", false, useWindow)
SteroidsLabel = guiCreateLabel(221, 212, 24, 20, "".. getElementData(localPlayer,"Steroids") .."", false, useWindow)
Heroin = guiCreateLabel(221, 257, 24, 20, "".. getElementData(localPlayer,"Heroin") .."", false, useWindow)
useM5drat = guiCreateButton(9, 298, 235, 41, "Use", false, useWindow)
GUIEditor.staticimage[1] = guiCreateStaticImage(38, 34, 183, 74, "123.png", false, useWindow)    
guiSetProperty(useM5drat, "NormalTextColour", "FFAAAAAA")
   end
 )
--------- Bind
 
bindKey ( "F7", "down", function (  )
        guiSetVisible ( useWindow, not guiGetVisible ( useWindow ) )
        showCursor ( guiGetVisible ( useWindow ) )
   end
)
 
 ----------------------
addEventHandler ("onClientGUIClick", getRootElement(),
function()
if (source == useM5drat) then
if guiRadioButtonGetSelected(radioButton1) == true then
if getElementData(localPlayer,"Weed") > 0 then
if getElementData(localPlayer,"WeedT") == false then
setElementData(localPlayer,"WeedT",true)
triggerServerEvent ( "takeWeed", localPlayer )
setGameSpeed(1.5)
setTimer(setGameSpeed,60000,1,1)
setTimer(setElementData,60000,1,localPlayer,"WeedT",false)
end
end
elseif guiRadioButtonGetSelected(radioButton2) == true then
if getElementData(localPlayer,"God") > 0 then
if getElementData(localPlayer,"GodT") == false then
setElementData(localPlayer,"GodT",true)
triggerServerEvent ( "takeGod", localPlayer )
setTimer(setElementData,60000,1,localPlayer,"GodT",false)
setTimer(triggerServerEvent,60000,1,"removeGod", localPlayer)
end
end
elseif guiRadioButtonGetSelected(radioButton3) == true then
if getElementData(localPlayer,"Speed") > 0 then
if getElementData(localPlayer,"SpeedT") == false then
setElementData(localPlayer,"SpeedT",true)
triggerServerEvent ( "takeSpeed", localPlayer )
setGameSpeed(10)
setTimer(setGameSpeed,60000,1,1)
setTimer(triggerServerEvent,60000,1,"removeSpeed", localPlayer)
setTimer(setElementData,60000,1,localPlayer,"SpeedT",false)
end
end
elseif guiRadioButtonGetSelected(radioButton4) == true then
if getElementData(localPlayer,"Lsd") > 0 then
if getElementData(localPlayer,"LsdT") == false then
setElementData(localPlayer,"LsdT",true)
triggerServerEvent ( "takeLsd", localPlayer )
setGameSpeed(0.9)
setPedWalkingStyle(localPlayer,120)
setTimer(setPedWalkingStyle,60000,1,localPlayer,54)
setTimer(setGameSpeed,60000,1,1)
setTimer(triggerServerEvent,60000,1,"removeLsd", localPlayer)
setTimer(setElementData,60000,1,localPlayer,"LsdT",false)
end
end
elseif guiRadioButtonGetSelected(radioButton5) == true then
if
Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...