Jump to content

Some Help in Here


Evil-Cod3r

Recommended Posts

Hi all i make this War_Script For any gameMode

ClientSide ...

function me () 
GUIEditor_Window[1] = guiCreateWindow(370,249,635,331,"War_Script v1.0 By Evil-Cod3r",false) 
guiWindowSetMovable(GUIEditor_Window[1],false) 
guiWindowSetSizable(GUIEditor_Window[1],false) 
GUIEditor_Image[1] = guiCreateStaticImage(10,25,137,68,"images/1.png",false,GUIEditor_Window[1]) 
GUIEditor_Button[1] = guiCreateButton(16,107,137,24,"Health",false,GUIEditor_Window[1]) 
guiSetFont(GUIEditor_Button[1],"default-bold-small") 
GUIEditor_Label[1] = guiCreateLabel(24,147,145,18,"Buy Health $ 1000",false,GUIEditor_Window[1]) 
guiLabelSetColor(GUIEditor_Label[1],255,255,0) 
guiSetFont(GUIEditor_Label[1],"default-bold-small") 
GUIEditor_Image[2] = guiCreateStaticImage(201,24,186,63,"images/2.png",false,GUIEditor_Window[1]) 
GUIEditor_Button[2] = guiCreateButton(211,109,166,26,"Armor",false,GUIEditor_Window[1]) 
guiSetFont(GUIEditor_Button[2],"default-bold-small") 
GUIEditor_Label[2] = guiCreateLabel(235,145,165,17,"Buy Armor $ 1500",false,GUIEditor_Window[1]) 
guiLabelSetColor(GUIEditor_Label[2],0,255,255) 
guiSetFont(GUIEditor_Label[2],"default-bold-small") 
GUIEditor_Image[3] = guiCreateStaticImage(424,22,182,70,"images/3.png",false,GUIEditor_Window[1]) 
GUIEditor_Button[3] = guiCreateButton(442,110,146,27,"invisible",false,GUIEditor_Window[1]) 
guiSetFont(GUIEditor_Button[3],"default-bold-small") 
GUIEditor_Label[3] = guiCreateLabel(449,148,133,13,"Buy invisible $ 2500",false,GUIEditor_Window[1]) 
guiLabelSetColor(GUIEditor_Label[3],255,0,0) 
guiSetFont(GUIEditor_Label[3],"default-bold-small") 
GUIEditor_Image[4] = guiCreateStaticImage(11,183,153,53,"images/4.png",false,GUIEditor_Window[1]) 
GUIEditor_Button[4] = guiCreateButton(14,249,136,26,"Barrel",false,GUIEditor_Window[1]) 
guiSetFont(GUIEditor_Button[4],"default-bold-small") 
GUIEditor_Label[4] = guiCreateLabel(19,286,136,18,"Buy Barrel $ 1800",false,GUIEditor_Window[1]) 
guiLabelSetColor(GUIEditor_Label[4],0,0,255) 
guiSetFont(GUIEditor_Label[4],"default-bold-small") 
GUIEditor_Label[5] = guiCreateLabel(137,-269,5,5,"",false,GUIEditor_Label[4]) 
GUIEditor_Image[6] = guiCreateStaticImage(431,178,172,63,"images/6.png",false,GUIEditor_Window[1]) 
GUIEditor_Button[6] = guiCreateButton(432,253,153,28,"JetPack",false,GUIEditor_Window[1]) 
guiSetFont(GUIEditor_Button[6],"default-bold-small") 
GUIEditor_Label[7] = guiCreateLabel(449,290,145,24,"Buy JetPack $ 1400",false,GUIEditor_Window[1]) 
guiLabelSetColor(GUIEditor_Label[7],0,255,255) 
guiSetFont(GUIEditor_Label[7],"default-bold-small") 
outputChatBox("This Script By ||Evil-Cod3r||",255,255,0) 
outputChatBox("Press F3 To Open ||War_Shop Panel|| !!!",0,255,0) 
end 
addEventHandler("onClientResourceStart", resourceRoot, me) 
  
function onGuiClick (button, state, absoluteX, absoluteY) 
    if (source == buyHealth) then 
        triggerServerEvent("buyHealth",localPlayer) 
    elseif (source == buyArmor) then 
        triggerServerEvent("buyArmor",localPlayer) 
        elseif (source == buyinvisible) then 
        triggerServerEvent("buyinvisible",localPlayer) 
        elseif (source == Smoke) then 
        triggerServerEvent("buyBarrel",localPlayer) 
        elseif (source == JetPack) then  
        triggerServerEvent("buyJet",localPlayer) 
    end 
end 
addEventHandler("onClientGUIClick",root,onGuiClick) 
  
function toggleMenu() 
    if (guiGetVisible(GUIEditor_Window[1]) == true) then 
        guiSetVisible(GUIEditor_Window[1], false) 
        showCursor(false) 
    else 
        guiSetVisible(GUIEditor_Window[1], true) 
        showCursor(true) 
        local sound = playSound("sounds/open.wav") 
        setSoundVolume(sound, 8.5) 
    end 
end 
bindKey("F3","down",toggleMenu) 

serverSide ..

addEvent("buyHealth",true) 
addEventHandler("buyHealth",root, 
function () 
    if (getPlayerMoney(source) >= 1000) then 
        setElementHealth ( source, 100 ) 
        outputChatBox("You Have Bought (Health) !",source,255,255,0) 
        outputChatBox("Your Health + 100", source, 255, 255, 0, true) 
        takePlayerMoney(source, 1000) 
    else 
        outputChatBox("You don't have $1,000 to buy Health !",source,255,0,0) 
    end 
end) 
  
addEvent("buyArmor",true) 
addEventHandler("buyArmor",root, 
function () 
    if (getPlayerMoney(source) >= 1500) then 
        setPedArmor ( source, 100 ) 
        outputChatBox("You Have Bought (Armor) !",source,255,255,0) 
        outputChatBox("+100 Armor Has Been Add To You !", source, 255, 255, 0, true) 
        takePlayerMoney(source, 1500) 
    else 
        outputChatBox("You don't have $1,500 to buy Armor !",source,255,0,0) 
    end 
end) 
  
addEvent("buyinvisible", true) 
addEventHandler("buyinvisible", getRootElement(), 
function() 
      if ( getPlayerMoney (source) >= 2500 ) then 
        takePlayerMoney(source, 2500) 
        outputChatBox("You Have Bought (invisible) !", source, 255, 255, 0, true) 
        outputChatBox("Others cant see you now For 6 Min !", source, 255, 255, 0, true) 
        setElementAlpha(getPedOccupiedVehicle(source),0) 
        setElementAlpha(source,0) 
        setPlayerNametagShowing(source, false) 
        setTimer( setElementAlpha, 60000, 1, source, 500, true) 
        setTimer( setElementAlpha, 60000, 1, getPedOccupiedVehicle(source), 500, true) 
        setTimer( setPlayerNametagShowing, 60000, 1, source, true, true) 
      else 
        outputChatBox("You don't have $1,500 to buy invisivle !", source, 255, 0, 0, true) 
    end 
  end 
) 
  
addEvent("buyBarrel",true) 
addEventHandler("buyBarrel",root, 
function () 
    if ( getPlayerMoney (source) >= 1800 ) then 
        takePlayerMoney(source, 1800) 
        x,y,z = getElementPosition( source ) 
        createObject ( 1225, x, y, z, 90, 0, 0 ) 
        outputChatBox("You Have Bought (Bareel) !", source, 255, 255, 0, true) 
        outputChatBox("Bareel Successfully droped", source, 255, 255, 0, true) 
      else 
        outputChatBox("You don't have $1,800 to buy Bareel !", source, 255, 0, 0, true) 
    end 
  end 
) 
  
addEvent("buyJetPack",true) 
addEventHandler("buyJetPack",root, 
function () 
    if ( getPlayerMoney (source) >= 1400 ) then 
        takePlayerMoney(source, 1400) 
        x,y,z = getElementPosition( source ) 
        createPickup ( x, y, z, 370, source ) 
        outputChatBox("You Have Bought (JetPack) !", source, 255, 255, 0, true) 
        outputChatBox("JetPack Successfully droped", source, 255, 255, 0, true) 
      else 
        outputChatBox("You don't have $1,400 to buy JetPack !", source, 255, 0, 0, true) 
    end 
  end 
) 

Hope No one steel it :(

Link to comment

-- client side:

function me () 
GUIEditor_Window = {} 
GUIEditor_Image = {} 
GUIEditor_Button = {} 
GUIEditor_Label = {} 
  
GUIEditor_Window[1] = guiCreateWindow(370,249,635,331,"War_Script v1.0 By Evil-Cod3r",false) 
guiWindowSetMovable(GUIEditor_Window[1],false) 
guiWindowSetSizable(GUIEditor_Window[1],false) 
GUIEditor_Image[1] = guiCreateStaticImage(10,25,137,68,"images/1.png",false,GUIEditor_Window[1]) 
GUIEditor_Button[1] = guiCreateButton(16,107,137,24,"Health",false,GUIEditor_Window[1]) 
guiSetFont(GUIEditor_Button[1],"default-bold-small") 
GUIEditor_Label[1] = guiCreateLabel(24,147,145,18,"Buy Health $ 1000",false,GUIEditor_Window[1]) 
guiLabelSetColor(GUIEditor_Label[1],255,255,0) 
guiSetFont(GUIEditor_Label[1],"default-bold-small") 
GUIEditor_Image[2] = guiCreateStaticImage(201,24,186,63,"images/2.png",false,GUIEditor_Window[1]) 
GUIEditor_Button[2] = guiCreateButton(211,109,166,26,"Armor",false,GUIEditor_Window[1]) 
guiSetFont(GUIEditor_Button[2],"default-bold-small") 
GUIEditor_Label[2] = guiCreateLabel(235,145,165,17,"Buy Armor $ 1500",false,GUIEditor_Window[1]) 
guiLabelSetColor(GUIEditor_Label[2],0,255,255) 
guiSetFont(GUIEditor_Label[2],"default-bold-small") 
GUIEditor_Image[3] = guiCreateStaticImage(424,22,182,70,"images/3.png",false,GUIEditor_Window[1]) 
GUIEditor_Button[3] = guiCreateButton(442,110,146,27,"invisible",false,GUIEditor_Window[1]) 
guiSetFont(GUIEditor_Button[3],"default-bold-small") 
GUIEditor_Label[3] = guiCreateLabel(449,148,133,13,"Buy invisible $ 2500",false,GUIEditor_Window[1]) 
guiLabelSetColor(GUIEditor_Label[3],255,0,0) 
guiSetFont(GUIEditor_Label[3],"default-bold-small") 
GUIEditor_Image[4] = guiCreateStaticImage(11,183,153,53,"images/4.png",false,GUIEditor_Window[1]) 
GUIEditor_Button[4] = guiCreateButton(14,249,136,26,"Barrel",false,GUIEditor_Window[1]) 
guiSetFont(GUIEditor_Button[4],"default-bold-small") 
GUIEditor_Label[4] = guiCreateLabel(19,286,136,18,"Buy Barrel $ 1800",false,GUIEditor_Window[1]) 
guiLabelSetColor(GUIEditor_Label[4],0,0,255) 
guiSetFont(GUIEditor_Label[4],"default-bold-small") 
GUIEditor_Label[5] = guiCreateLabel(137,-269,5,5,"",false,GUIEditor_Label[4]) 
GUIEditor_Image[6] = guiCreateStaticImage(431,178,172,63,"images/6.png",false,GUIEditor_Window[1]) 
GUIEditor_Button[5] = guiCreateButton(432,253,153,28,"JetPack",false,GUIEditor_Window[1]) 
guiSetFont(GUIEditor_Button[6],"default-bold-small") 
GUIEditor_Label[7] = guiCreateLabel(449,290,145,24,"Buy JetPack $ 1400",false,GUIEditor_Window[1]) 
guiLabelSetColor(GUIEditor_Label[7],0,255,255) 
guiSetFont(GUIEditor_Label[7],"default-bold-small") 
outputChatBox("This Script By ||Evil-Cod3r||",255,255,0) 
outputChatBox("Press F3 To Open ||War_Shop Panel|| !!!",0,255,0) 
end 
addEventHandler("onClientResourceStart", resourceRoot, me) 
  
function onGuiClick (button, state, absoluteX, absoluteY) 
    if (source == GUIEditor_Button[1]) then 
        triggerServerEvent("buyHealth",localPlayer) 
    elseif (source == GUIEditor_Button[2]) then 
        triggerServerEvent("buyArmor",localPlayer) 
        elseif (source == GUIEditor_Button[3]) then 
        triggerServerEvent("buyinvisible",localPlayer) 
        elseif (source == GUIEditor_Button[4]) then 
        triggerServerEvent("buyBarrel",localPlayer) 
        elseif (source == GUIEditor_Button[5]) then 
        triggerServerEvent("buyJet",localPlayer) 
    end 
end 
addEventHandler("onClientGUIClick",root,onGuiClick) 
  
function toggleMenu() 
    if (guiGetVisible(GUIEditor_Window[1]) == true) then 
        guiSetVisible(GUIEditor_Window[1], false) 
        showCursor(false) 
    else 
        guiSetVisible(GUIEditor_Window[1], true) 
        showCursor(true) 
        local sound = playSound("sounds/open.wav") 
        setSoundVolume(sound, 8.5) 
    end 
end 
bindKey("F3","down",toggleMenu) 

-- server side:

addEvent("buyHealth",true) 
addEventHandler("buyHealth",root, 
function () 
    if (getPlayerMoney(source) >= 1000) then 
        setElementHealth ( source, 100 ) 
        outputChatBox("You Have Bought (Health) !",source,255,255,0) 
        outputChatBox("Your Health + 100", source, 255, 255, 0, true) 
        takePlayerMoney(source, 1000) 
    else 
        outputChatBox("You don't have $1,000 to buy Health !",source,255,0,0) 
    end 
end) 
  
addEvent("buyArmor",true) 
addEventHandler("buyArmor",root, 
function () 
    if (getPlayerMoney(source) >= 1500) then 
        setPedArmor ( source, 100 ) 
        outputChatBox("You Have Bought (Armor) !",source,255,255,0) 
        outputChatBox("+100 Armor Has Been Add To You !", source, 255, 255, 0, true) 
        takePlayerMoney(source, 1500) 
    else 
        outputChatBox("You don't have $1,500 to buy Armor !",source,255,0,0) 
    end 
end) 
  
addEvent("buyinvisible", true) 
addEventHandler("buyinvisible", getRootElement(), 
function() 
      if ( getPlayerMoney (source) >= 2500 ) then 
        takePlayerMoney(source, 2500) 
        outputChatBox("You Have Bought (invisible) !", source, 255, 255, 0, true) 
        outputChatBox("Others cant see you now For 6 Min !", source, 255, 255, 0, true) 
        setElementAlpha(getPedOccupiedVehicle(source),0) 
        setElementAlpha(source,0) 
        setPlayerNametagShowing(source, false) 
        setTimer( setElementAlpha, 60000, 1, source, 500, true) 
        setTimer( setElementAlpha, 60000, 1, getPedOccupiedVehicle(source), 500, true) 
        setTimer( setPlayerNametagShowing, 60000, 1, source, true, true) 
      else 
        outputChatBox("You don't have $1,500 to buy invisivle !", source, 255, 0, 0, true) 
    end 
  end 
) 
  
addEvent("buyBarrel",true) 
addEventHandler("buyBarrel",root, 
function () 
    if ( getPlayerMoney (source) >= 1800 ) then 
        takePlayerMoney(source, 1800) 
        local x,y,z = getElementPosition( source ) 
        createObject ( 1225, x, y, z, 90, 0, 0 ) 
        outputChatBox("You Have Bought (Bareel) !", source, 255, 255, 0, true) 
        outputChatBox("Bareel Successfully droped", source, 255, 255, 0, true) 
      else 
        outputChatBox("You don't have $1,800 to buy Bareel !", source, 255, 0, 0, true) 
    end 
  end 
) 
  
addEvent("buyJetPack",true) 
addEventHandler("buyJetPack",root, 
function () 
    if ( getPlayerMoney (source) >= 1400 ) then 
        takePlayerMoney(source, 1400) 
        givePedJetPack(source) 
        outputChatBox("You Have Bought (JetPack) !", source, 255, 255, 0, true) 
      else 
        outputChatBox("You don't have $1,400 to buy JetPack !", source, 255, 0, 0, true) 
    end 
  end 
) 

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...