Jump to content

Help in Gui Script


Evil-Cod3r

Recommended Posts

Hi all the Gui Script is Hard for me can some win help me with it

iam making a War_Shop Panel :)

  
GUIEditor_Window = {} 
GUIEditor_TabPanel = {} 
GUIEditor_Tab = {} 
GUIEditor_Button = {} 
GUIEditor_Label = {} 
GUIEditor_Grid = {} 
GUIEditor_Image = {} 
  
GUIEditor_Window[1] = guiCreateWindow(324,201,707,349,"Shop_Panel By Evil-Cod3r",false) 
guiWindowSetMovable(GUIEditor_Window[1],false) 
guiWindowSetSizable(GUIEditor_Window[1],false) 
GUIEditor_Label[1] = guiCreateLabel(8,20,226,40,"Welcome :",false,GUIEditor_Window[1]) 
guiLabelSetColor(GUIEditor_Label[1],0,255,0) 
guiSetFont(GUIEditor_Label[1],"clear-normal") 
GUIEditor_Label[2] = guiCreateLabel(401,23,268,24,"Press F7 To Show and Hide The Window",false,GUIEditor_Window[1]) 
guiLabelSetColor(GUIEditor_Label[2],255,0,0) 
guiSetFont(GUIEditor_Label[2],"clear-normal") 
GUIEditor_TabPanel[1] = guiCreateTabPanel(10,73,688,267,false,GUIEditor_Window[1]) 
GUIEditor_Tab[1] = guiCreateTab("Buy Weapons",GUIEditor_TabPanel[1]) 
GUIEditor_Button[1] = guiCreateButton(6,17,201,39,"Buy Sniper $120",false,GUIEditor_Tab[1]) 
guiSetFont(GUIEditor_Button[1],"clear-normal") 
GUIEditor_Button[2] = guiCreateButton(6,185,202,48,"Buy Armor $250",false,GUIEditor_Tab[1]) 
guiSetFont(GUIEditor_Button[2],"clear-normal") 
GUIEditor_Button[3] = guiCreateButton(467,183,204,47,"Buy M4 $190",false,GUIEditor_Tab[1]) 
guiSetFont(GUIEditor_Button[3],"clear-normal") 
GUIEditor_Button[4] = guiCreateButton(450,18,225,46,"Buy Pistol $ 80",false,GUIEditor_Tab[1]) 
guiSetFont(GUIEditor_Button[4],"clear-normal") 
GUIEditor_Image[1] = guiCreateStaticImage(215,32,231,184,"images/mtalogo.png",false,GUIEditor_Tab[1]) 
GUIEditor_Tab[2] = guiCreateTab("Send Money",GUIEditor_TabPanel[1]) 
GUIEditor_Grid[1] = guiCreateGridList(7,13,370,216,false,GUIEditor_Tab[2]) 
guiGridListSetSelectionMode(GUIEditor_Grid[1],2) 
  
col = guiGridListAddColumn(GUIEditor_Grid[1],"Players",0.2) 
if col then 
    for _, players in pairs( getElementsByType 'player' ) do 
        guiGridListSetItemText( GUIEditor_Grid[1],row,col,getPlayerName( players ),false,false ) 
    end 
end 
  
for i = 1, 1 do 
row = guiGridListAddRow(GUIEditor_Grid[1]) 
end 
  
guiGridListSetItemColor(GUIEditor_Grid[1],0,1,0,255,0,255) 
GUIEditor_Image[2] = guiCreateStaticImage(413,24,240,120,"images/image.png",false,GUIEditor_Tab[2]) 
GUIEditor_Button[5] = guiCreateButton(411,164,257,57,"Send Money",false,GUIEditor_Tab[2]) 
guiSetFont(GUIEditor_Button[5],"clear-normal") 
  
GUIEditor_Label[3] = guiCreateLabel(726,260,220,22,"Money :",false) 
guiLabelSetVerticalAlign(GUIEditor_Label[3],"center") 
guiSetFont(GUIEditor_Label[3],"clear-normal") 
  

and i try fix this by my self 100 times dont work to

local x,y = guiGetScreenSize() 
  
function headshot ( killer, weapon, bodypart ) 
if ( killer ) and ( killer ~= source ) then 
local image = guiCreateStaticImage ( x/5, y/5.8, 399,169, "SAMP"..math.random(1,4)..".png", false ) 
guiSetVisible ( image, false ) 
guiSetVisible ( image, true ) 
guiStaticImageLoadImage(image, "SAMP"..math.random(1,4)..".png") 
setTimer (guiSetVisible, 4000, 1, image, false ) 
end 
addEventHandler ( "onClientPlayerWasted", getLocalPlayer(), headshot ) 
  
function yasser (killer, weapon, bodypart ) 
    if ( killer ) and ( killer ~= source ) then 
        if (bodypart == 9) then 
         outputChatBox("**OWned->HeadShot !!!+$50**",killer,255,255,0) 
        owned = guiCreateStaticImage(0.45,0.6722,0.0917,0.0533,"images/owned.png",true) 
        givePlayerMoney ( killer, 50 ) 
        guiSetVisible(owned, false) 
        guiSetVisible(owned, true) 
        setTimer (guiSetVisible, 4000, 1, owned, false ) 
end 
end 
end 
end 
addEventHandler ( "onClientPlayerWasted", getLocalPlayer(), yasser ) 
  
  
function trigger ( killer, killerweapon, bodypart ) 
if ( killer ) and ( killer ~= source ) then 
if (bodypart == 9) then 
triggerClientEvent(killer,"playWastedSound",killer,"sounds/2.ogg") 
end 
end 
end 
addEventHandler ( "onPlayerWasted", getRootElement(), trigger) 
  
function wastedme () 
outputChatBox("**Woops Your Dead Try Next Time - $5**",source,255,255,0) 
    takePlayerMoney( source, 5 ) 
triggerClientEvent(source,"playWastedSound",source,"sounds/3.ogg") 
end 
addEventHandler ( "onPlayerWasted", getRootElement ( ), wastedme) 

Link to comment
local x,y = guiGetScreenSize() 
  
function headshot ( killer, weapon, bodypart ) 
if ( killer ) and ( killer ~= source ) then 
local image = guiCreateStaticImage ( x/5, y/5.8, 399,169, "SAMP"..math.random(1,4)..".png", false ) 
guiSetVisible ( image, false ) 
guiSetVisible ( image, true ) 
guiStaticImageLoadImage(image, "SAMP"..math.random(1,4)..".png") 
setTimer (guiSetVisible, 4000, 1, image, false ) 
end 
addEventHandler ( "onClientPlayerWasted", root, headshot ) 
  
function yasser (killer, weapon, bodypart ) 
    if ( killer ) and ( killer ~= source ) then 
        if (bodypart == 9) then 
         outputChatBox("**OWned->HeadShot !!!+$50**",killer,255,255,0) 
        owned = guiCreateStaticImage(0.45,0.6722,0.0917,0.0533,"images/owned.png",true) 
        givePlayerMoney ( killer, 50 ) 
        guiSetVisible(owned, false) 
        guiSetVisible(owned, true) 
        setTimer (guiSetVisible, 4000, 1, owned, false ) 
end 
end 
end 
end 
addEventHandler ( "onClientPlayerWasted", root, yasser ) 
  
  
function trigger ( killer, killerweapon, bodypart ) 
if ( killer ) and ( killer ~= source ) then 
if (bodypart == 9) then 
triggerClientEvent(killer,"playWastedSound",killer,"sounds/2.ogg") 
end 
end 
end 
addEventHandler ( "onPlayerWasted", root, trigger) 
  
function wastedme () 
outputChatBox("**Woops Your Dead Try Next Time - $5**",source,255,255,0) 
    takePlayerMoney( source, 5 ) 
triggerClientEvent(source,"playWastedSound",source,"sounds/3.ogg") 
end 
addEventHandler ( "onPlayerWasted", root, wastedme) 

Link to comment
local sx, sy = guiGetScreenSize()  
image = guiCreateStaticImage(sx/5,sy/5.8,399,169,'SAMP'..math.random(1,4)..'.png',false) 
owned = guiCreateStaticImage(0.45,0.6722,0.917,0.0533,'images/owned.png',true) 
  
addEventHandler('onClientPlayerWasted', root,  
 function(theKiller,theWeapon,bodyPart) 
   if theKiller and theKiller ~= source then 
     if bodyPart == 9 then 
       outputChatBox('**Owned -> HeadShot!! + $50**',theKiller,255,255,0) 
       playSound('sounds/2.ogg',false) 
       guiSetVisible(owned,true) 
       givePlayerMoney(theKiller,50) 
       setTimer(guiSetVisible,4000,1,owned,false) 
     end 
    else 
      guiSetVisible(image,true) 
      setTimer(guiSetVisible,4000,1,image,false) 
      outputChatBox('** Opps, you dead! Try again - $5 **', source, 255, 255, 0) 
      takePlayerMoney(source,5) 
      playSound('sounds/3.ogg',false) 
    end 
  end 
end) 

Edited by Guest
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...