im sorry but u copyed it from my code at least server side parts
https://forum.multitheftauto.com/viewtopic.php?f=91&t=27814&st=0&sk=t&sd=a&start=15
but well, i fixed all code for you.
client side:
GUIEditor_Window = {}
GUIEditor_TabPanel = {}
GUIEditor_Tab = {}
GUIEditor_Button = {}
GUIEditor_Memo = {}
GUIEditor_Label = {}
function toggleVisible ( )
if ( guiGetVisible ( GUIEditor_Window[1] ) == true ) then
guiSetVisible ( GUIEditor_Window[1], false )
showCursor ( false )
else
guiSetVisible ( GUIEditor_Window[1], true )
showCursor ( true )
end
end
bindKey ( "F6", "down", toggleVisible )
local player = getPlayerName(getLocalPlayer())
local playerMoney = getPlayerMoney(source)
local playerPoints = getElementData(getLocalPlayer(), "Points")
local playerWins = getElementData(getLocalPlayer(), "Wins")
local playerLoses = getElementData(getLocalPlayer(), "Loses")
GUIEditor_Window[1] = guiCreateWindow(11,135,275,194,"User panel",false)
guiSetVisible( GUIEditor_Window[1], false)
GUIEditor_TabPanel[1] = guiCreateTabPanel(12,23,249,162,false,GUIEditor_Window[1])
GUIEditor_Tab[1] = guiCreateTab("User",GUIEditor_TabPanel[1])
GUIEditor_Label[1] = guiCreateLabel(10,11,222,19,"Name: " .. player,false,GUIEditor_Tab[1])
guiLabelSetColor(GUIEditor_Label[1],255,255,255)
guiLabelSetVerticalAlign(GUIEditor_Label[1],"top")
guiLabelSetHorizontalAlign(GUIEditor_Label[1],"left",false)
GUIEditor_Label[2] = guiCreateLabel(10,32,222,19,"Money: $ " ..playerMoney,false,GUIEditor_Tab[1])
guiLabelSetColor(GUIEditor_Label[2],255,255,255)
guiLabelSetVerticalAlign(GUIEditor_Label[2],"top")
guiLabelSetHorizontalAlign(GUIEditor_Label[2],"left",false)
GUIEditor_Label[3] = guiCreateLabel(10,52,222,19,"Points: " .. playerPoints,false,GUIEditor_Tab[1])
guiLabelSetColor(GUIEditor_Label[3],255,255,255)
guiLabelSetVerticalAlign(GUIEditor_Label[3],"top")
guiLabelSetHorizontalAlign(GUIEditor_Label[3],"left",false)
GUIEditor_Label[4] = guiCreateLabel(10,52,222,19,"Wins: " .. playerWins,false,GUIEditor_Tab[1])
guiLabelSetColor(GUIEditor_Label[3],255,255,255)
guiLabelSetVerticalAlign(GUIEditor_Label[3],"top")
guiLabelSetHorizontalAlign(GUIEditor_Label[3],"left",false)
GUIEditor_Label[5] = guiCreateLabel(10,52,222,19,"Loses: " .. playerLoses,false,GUIEditor_Tab[1])
guiLabelSetColor(GUIEditor_Label[3],255,255,255)
guiLabelSetVerticalAlign(GUIEditor_Label[3],"top")
guiLabelSetHorizontalAlign(GUIEditor_Label[3],"left",false)
GUIEditor_Tab[2] = guiCreateTab("Shop",GUIEditor_TabPanel[1])
GUIEditor_Label[6] = guiCreateLabel(18,14,142,16,"Repair:",false,GUIEditor_Tab[2])
guiLabelSetColor(GUIEditor_Label[4],255,255,255)
guiLabelSetVerticalAlign(GUIEditor_Label[4],"top")
guiLabelSetHorizontalAlign(GUIEditor_Label[4],"left",false)
GUIEditor_Label[7] = guiCreateLabel(18,33,142,16,"Nitro:",false,GUIEditor_Tab[2])
guiLabelSetColor(GUIEditor_Label[5],255,255,255)
guiLabelSetVerticalAlign(GUIEditor_Label[5],"top")
guiLabelSetHorizontalAlign(GUIEditor_Label[5],"left",false)
GUIEditor_Label[8] = guiCreateLabel(18,53,142,16,"Barrel:",false,GUIEditor_Tab[2])
guiLabelSetColor(GUIEditor_Label[6],255,255,255)
guiLabelSetVerticalAlign(GUIEditor_Label[6],"top")
guiLabelSetHorizontalAlign(GUIEditor_Label[6],"left",false)
GUIEditor_Label[9] = guiCreateLabel(18,73,142,16,"Haystack:",false,GUIEditor_Tab[2])
guiLabelSetColor(GUIEditor_Label[7],255,255,255)
guiLabelSetVerticalAlign(GUIEditor_Label[7],"top")
guiLabelSetHorizontalAlign(GUIEditor_Label[7],"left",false)
GUIEditor_Button[1] = guiCreateButton(67,14,46,17,"$3500",false,GUIEditor_Tab[2])
GUIEditor_Button[2] = guiCreateButton(62,34,46,17,"$2000",false,GUIEditor_Tab[2])
GUIEditor_Button[3] = guiCreateButton(50,54,46,17,"$1500",false,GUIEditor_Tab[2])
GUIEditor_Button[4] = guiCreateButton(88,74,46,17,"$3000",false,GUIEditor_Tab[2])
GUIEditor_Button[5] = guiCreateButton(92,94,46,17,"$4000",false,GUIEditor_Tab[2])
GUIEditor_Tab[3] = guiCreateTab("Credits",GUIEditor_TabPanel[1])
GUIEditor_Memo[1] = guiCreateMemo(7,6,233,127,"User panel by loler",false,GUIEditor_Tab[3])
guiMemoSetReadOnly(GUIEditor_Memo[1],true)
GUIEditor_Tab[4] = guiCreateTab("Top Points",GUIEditor_TabPanel[1])
GUIEditor_Label[9] = guiCreateLabel(9,11,223,21,"Coming soon",false,GUIEditor_Tab[4])
guiLabelSetColor(GUIEditor_Label[9],255,255,255)
guiLabelSetVerticalAlign(GUIEditor_Label[9],"top")
guiLabelSetHorizontalAlign(GUIEditor_Label[9],"left",false)
function fixv()
triggerServerEvent("fixRequest", getLocalPlayer())
end
addEventHandler("onClientGUIClick",GUIEditor_Button[1],fixv,false)
function haystack()
triggerServerEvent("haystack", getLocalPlayer())
end
addEventHandler("onClientGUIClick",GUIEditor_Button[4],haystack,false)
function barrel()
triggerServerEvent("barrel", getLocalPlayer())
end
addEventHandler("onClientGUIClick",GUIEditor_Button[3],barrel,false)
function nitro()
triggerServerEvent("nitro", getLocalPlayer())
end
addEventHandler("onClientGUIClick",GUIEditor_Button[2],nitro,false)
server side:
addEvent("nitro", true)
addEventHandler("nitro", getRootElement(),
function()
if isPedInVehicle(source) then
if ( getPlayerMoney (source) >= 7000 ) then
takePlayerMoney(source, 7000)
addVehicleUpgrade(getPedOccupiedVehicle(source),1010)
outputChatBox("Nitro Successfully added", source, 255, 255, 0, true)
else
outputChatBox("Not enough money.", source, 255, 0, 0, true)
end
else
outputChatBox("You are not in a vehicle", source, 255, 0, 0, true)
end
end
)
addEvent("fixRequest", true)
addEventHandler("fixRequest", getRootElement(),
function()
if isPedInVehicle(source) then
if ( getPlayerMoney (source) >= 20000 ) then
takePlayerMoney(source, 20000)
fixVehicle(getPedOccupiedVehicle(source))
outputChatBox("Vehicle Successfully Fixed", source, 255, 255, 0, true)
else
outputChatBox("Not enough money.", source, 255, 0, 0, true)
end
else
outputChatBox("You are not in a vehicle", source, 255, 0, 0, true)
end
end
)
addEvent("haystack", true)
addEventHandler("haystack", getRootElement(),
function()
local x,y,z = getElementPosition( source )
if isPedInVehicle(source) then
if ( getPlayerMoney (source) >= 99999 ) then
takePlayerMoney(source, 99999)
createObject ( 3374 , x , y , z )
outputChatBox("Haystack Successfully planted", source, 255, 255, 0, true)
else
outputChatBox("Not enough money.", source, 255, 0, 0, true)
end
else
outputChatBox("You are not in a vehicle", source, 255, 0, 0, true)
end
end
)
addEvent("barrel", true)
addEventHandler("barrel", getRootElement(),
function()
local x,y,z = getElementPosition( source )
if isPedInVehicle(source) then
if ( getPlayerMoney (source) >= 100000 ) then
takePlayerMoney(source, 100000)
createObject ( 1225 , x , y , z )
outputChatBox("Barrel Successfully planted", source, 255, 255, 0, true)
else
outputChatBox("Not enough money.", source, 255, 0, 0, true)
end
else
outputChatBox("You are not in a vehicle", source, 255, 0, 0, true)
end
end
)
greetings, Castillo