Mir gehts garnicht um "Cool" sein.
Mir gehts darum den Spielern den bestmöglichen Spielspaß zu bringen.
Und wenn ich was nicht weiß wende ich mich ans Forum.
Vor allem wenn ich nicht weiß wo etwas definiert wurde.
Mir gehts garnicht um "Cool" sein.
Mir gehts darum den Spielern den bestmöglichen Spielspaß zu bringen.
Und wenn ich was nicht weiß wende ich mich ans Forum.
Vor allem wenn ich nicht weiß wo etwas definiert wurde.
Wie gesagt ich habe keine Ahnung wo. Deshalb frage ich hier auch
Da steht das :
local playerListLabels = {}
local playerListFactionMembersLabel = {}
local playersOnline = {}
local playersOnlineData = {}
local curPlayerListPosition = 1
local playerCount = 0
local playerListWidth = 650
local playerListHeight = 360
local maxPlayersInCurList = 17
local maxPlayers = 250
local playersToScrollPerButton = 10
function recieveServerSlotCount ( max )
maxPlayers = max
end
addEvent ( "recieveServerSlotCount", true )
addEventHandler ( "recieveServerSlotCount", getRootElement(), recieveServerSlotCount )
triggerServerEvent ( "getServerSlotCount", lp )
local radioUpState, radioDownState, weaponUpState, weaponDownState = true
function fillPlayerListOnStart ()
local players = getElementsByType ( "player" )
for key, index in pairs ( players ) do
playerCount = playerCount + 1
playersOnlineData[index] = playerCount
playersOnline[playerCount] = index
end
end
fillPlayerListOnStart ()
function clientPlayerListDisconnect ()
local i = playersOnlineData[source]
playersOnline[i] = nil
playerCount = playerCount - 1
end
addEventHandler ( "onClientPlayerQuit", getRootElement(), clientPlayerListDisconnect )
function clientPlayerListConnect ()
local i
for k = 1, maxPlayers do
if not playersOnline[k] then
i = k
break
end
end
playerCount = playerCount + 1
playersOnlineData[source] = i
playersOnline[i] = source
end
addEventHandler ( "onClientPlayerJoin", getRootElement(), clientPlayerListConnect )
function showPlayerList ()
if gImage["playerList"] then
guiSetVisible ( gImage["playerList"], true )
else
local label, img
--gImage["playerList"] = guiCreateStaticImage(screenwidth/2-playerListWidth/2,screenheight/2-playerListHeight/2,playerListWidth,playerListHeight,"images/colors/c_black.jpg",false)
gImage["playerList"] = guiCreateStaticImage(screenwidth/2-playerListWidth/2,screenheight/2-playerListHeight/2,playerListWidth,playerListHeight,"images/scoreboard.png",false)
guiSetAlpha(gImage["playerList"],0.9)
label = guiCreateLabel(40,39,51,23,"Name",false,gImage["playerList"])
guiSetAlpha(label,1)
guiLabelSetColor(label,255,255,255)
guiLabelSetVerticalAlign(label,"top")
guiLabelSetHorizontalAlign(label,"left",false)
guiSetFont(label,"default-bold-small")
--img = guiCreateStaticImage(8,23,453,5,"images/colors/c_green.jpg",false,gImage["playerList"])
--guiSetAlpha(img,0.7)
label = guiCreateLabel(166,39,88,23,"Sozialer Status",false,gImage["playerList"])
guiSetAlpha(label,1)
guiLabelSetColor(label,255,255,255)
guiLabelSetVerticalAlign(label,"top")
guiLabelSetHorizontalAlign(label,"left",false)
guiSetFont(label,"default-bold-small")
label = guiCreateLabel(290,39,52,20,"Spielzeit",false,gImage["playerList"])
guiSetAlpha(label,1)
guiLabelSetColor(label,255,255,255)
guiLabelSetVerticalAlign(label,"top")
guiLabelSetHorizontalAlign(label,"left",false)
guiSetFont(label,"default-bold-small")
--img = guiCreateStaticImage(151,28,3,268,"images/colors/c_green.jpg",false,gImage["playerList"])
--guiSetAlpha(img,0.7)
--img = guiCreateStaticImage(265,28,3,268,"images/colors/c_green.jpg",false,gImage["playerList"])
--guiSetAlpha(img,0.7)
label = guiCreateLabel(360,39,62,16,"Telefonnr.",false,gImage["playerList"])
guiSetAlpha(label,1)
guiLabelSetColor(label,255,255,255)
guiLabelSetVerticalAlign(label,"top")
guiLabelSetHorizontalAlign(label,"left",false)
guiSetFont(label,"default-bold-small")
--img = guiCreateStaticImage(333,28,3,268,"images/colors/c_green.jpg",false,gImage["playerList"])
--guiSetAlpha(img,0.7)
--img = guiCreateStaticImage(413,28,3,268,"images/colors/c_green.jpg",false,gImage["playerList"])
--guiSetAlpha(img,0.7)
label = guiCreateLabel(443,39,65,15,"Fraktion",false,gImage["playerList"])
guiSetAlpha(label,1)
guiLabelSetColor(label,255,255,255)
guiLabelSetVerticalAlign(label,"top")
guiLabelSetHorizontalAlign(label,"left",false)
guiSetFont(label,"default-bold-small")
label = guiCreateLabel(546,39,57,15,"Ping",false,gImage["playerList"])
guiSetAlpha(label,1)
guiLabelSetColor(label,255,255,255)
guiLabelSetVerticalAlign(label,"top")
guiLabelSetHorizontalAlign(label,"left",false)
guiSetFont(label,"default-bold-small")
--gImage["playerListBarBG"] = guiCreateStaticImage(472,0,12,playerListHeight,"images/colors/c_white.jpg",false,gImage["playerList"])
--guiSetAlpha(gImage["playerListBarBG"],0.7)
--gImage["playerListBarPull"] = guiCreateStaticImage(0,17,12,33,"images/colors/c_black.jpg",false,gImage["playerListBarBG"])
--guiSetAlpha(gImage["playerListBarPull"],1)
gLabel["playerListPlayers"] = guiCreateLabel(45,330,100,18,"0/"..maxPlayers.." Spieler",false,gImage["playerList"])
guiSetAlpha(gLabel["playerListPlayers"],1)
guiLabelSetColor(gLabel["playerListPlayers"],255,255,255)
guiLabelSetVerticalAlign(gLabel["playerListPlayers"],"top")
guiLabelSetHorizontalAlign(gLabel["playerListPlayers"],"left",false)
guiSetFont(gLabel["playerListPlayers"],"default-bold-small")
for i, index in pairs ( factionColors ) do
if i > 0 then
local r, g, b = factionColors[i][1], factionColors[i][2], factionColors[i][3]
playerListFactionMembersLabel[i] = guiCreateLabel(175+175+(i)*20,330,20,18,"",false,gImage["playerList"])
guiSetAlpha(playerListFactionMembersLabel[i],1)
guiLabelSetColor(playerListFactionMembersLabel[i],r,g,b)
guiLabelSetVerticalAlign(playerListFactionMembersLabel[i],"top")
guiLabelSetHorizontalAlign(playerListFactionMembersLabel[i],"left",false)
guiSetFont(playerListFactionMembersLabel[i],"default-bold-small")
end
end
for i = 1, maxPlayersInCurList do
playerListLabels[i] = {}
playerListLabels[i][1] = guiCreateLabel(40,55 - 16 + 16 * i,141,16,"",false,gImage["playerList"])
playerListLabels[i][2] = guiCreateLabel(166,55 - 16 + 16 * i,141,16,"",false,gImage["playerList"])
playerListLabels[i][3] = guiCreateLabel(290,55 - 16 + 16 * i,141,16,"",false,gImage["playerList"])
playerListLabels[i][4] = guiCreateLabel(360,55 - 16 + 16 * i,141,16,"",false,gImage["playerList"])
playerListLabels[i][5] = guiCreateLabel(443,55 - 16 + 16 * i,141,16,"",false,gImage["playerList"])
playerListLabels[i][6] = guiCreateLabel(546,55 - 16 + 16 * i,141,16,"",false,gImage["playerList"])
for k = 1, 6 do
guiSetAlpha(playerListLabels[i][k],1)
guiLabelSetColor(playerListLabels[i][k],255,255,255)
guiLabelSetVerticalAlign(playerListLabels[i][k],"top")
guiLabelSetHorizontalAlign(playerListLabels[i][k],"left",false)
guiSetFont(playerListLabels[i][k],"default-bold-small")
end
guiLabelSetColor ( playerListLabels[i][2], 200, 200, 0 )
end
end
updatePlayerList ()
end
function updateFactionPlayerCount ()
factionCounter = {}
local players = getElementsByType ( "player" )
for key, index in pairs ( players ) do
local i = getElementData ( index, "fraktion" )
if i then
if not factionCounter[i] then
factionCounter[i] = {}
end
factionCounter[i][index] = true
end
end
for i, index in pairs ( factionColors ) do
if playerListFactionMembersLabel[i] then
local length = tableLength ( factionCounter[i] )
if length > 0 then
guiSetText ( playerListFactionMembersLabel[i], length )
else
guiSetText ( playerListFactionMembersLabel[i], "" )
end
end
end
end
function tableLength ( table )
local i = 0
if table then
for _, _ in pairs ( table ) do
i = i + 1
end
end
return i
end
function updatePlayerList ()
if guiGetVisible ( gImage["playerList"] ) then
updateFactionPlayerCount ()
guiSetText ( gLabel["playerListPlayers"], playerCount.."/"..maxPlayers.." Spieler" )
reFillPlayerList ()
playerListUpdateTimer = setTimer ( updatePlayerList, 1000, 1 )
end
end
function reAdjustPlayerListScollBar ()
--[[pxPerPlayer = playerListHeight / ( playerCount )
barSize = maxPlayersInCurList / playerCount * playerListHeight
if barSize > playerListHeight then
]]
pxPerPlayer = 310 / ( playerCount )
barSize = maxPlayersInCurList / playerCount * 310
if barSize > 310 then
barSize = 1
barYPos = 0
else
barYPos = ( curPlayerListPosition - 1 ) * ( pxPerPlayer )
end
--guiSetSize ( gImage["playerListBarPull"], 17, barSize, false )
--guiSetPosition ( gImage["playerListBarPull"], 0, barYPos, false )
end
function reFillPlayerList ()
for key, index in pairs ( playerListLabels ) do
for i = 1, 6 do
guiSetText ( playerListLabels[key][i], "" )
end
end
local i = 0
local k = 0
local name, rang, playingtime, ping, r, g, b
for z = -2, factioncount do
for key, index in pairs ( playersOnline ) do
if ( z == -2 and not getElementData ( index, "loggedin" ) ) or ( z == -1 and getElementData ( index, "loggedin" ) == 0 ) or getElementData ( index, "fraktion" ) == z then
i = i + 1
if k > maxPlayersInCurList then
break
end
if i >= curPlayerListPosition then
k = k + 1
name = getPlayerName ( index )
rang = getElementData ( index, "socialState" )
fraktion = getElementData ( index, "fraktion" )
ping = tonumber ( getPlayerPing ( index ) )
if not rang then
rang = "Verbinden..."
nr = ""
playingtime = ""
r, g, b = 175, 175, 175
else
nr = getElementData ( index, "telenr" )
local faction = getElementData ( index, "fraktion" )
r, g, b = factionColors[faction][1], factionColors[faction][2], factionColors[faction][3]
playingtime = getElementData ( index, "playingtime" )
playingtime = math.floor ( playingtime / 60 )..":"..( playingtime - math.floor ( playingtime / 60 ) * 60 )
end
if not fraktion then
fraktion = "-"
else
fraktion = fraktionsNamen[fraktion] or "Zivilist"
end
if playerListLabels[k] and playerListLabels[k][1] and isElement(playerListLabels[k][1]) and name then
guiSetText ( playerListLabels[k][1], name )
guiSetText ( playerListLabels[k][2], rang )
guiSetText ( playerListLabels[k][3], playingtime )
guiSetText ( playerListLabels[k][4], nr )
guiSetText ( playerListLabels[k][5], fraktion )
guiSetText ( playerListLabels[k][6], ping )
pr, pg, pb = getPingColor ( ping )
local admlvl = getElementData ( index, "adminlvl" )
if admlvl and admlvl >= 1 then
guiLabelSetColor ( playerListLabels[k][2], 0, 200, 0 )
else
guiLabelSetColor ( playerListLabels[k][2], 200, 200, 0 )
end
guiLabelSetColor ( playerListLabels[k][1], r, g, b )
guiLabelSetColor ( playerListLabels[k][5], r, g, b )
guiLabelSetColor ( playerListLabels[k][6], pr, pg, pb )
end
end
end
end
end
end
function getPingColor ( ping )
if ping <= 50 then
return 0, 200, 0
elseif ping <= 150 then
return 200, 200, 0
else
return 200, 0, 0
end
end
function playerListScrollDown ()
if curPlayerListPosition < playerCount - maxPlayersInCurList + playersToScrollPerButton then
curPlayerListPosition = curPlayerListPosition + playersToScrollPerButton
else
curPlayerListPosition = playerCount
end
reFillPlayerList ()
end
function playerListScrollUp ()
if curPlayerListPosition > playersToScrollPerButton then
curPlayerListPosition = curPlayerListPosition - playersToScrollPerButton
else
curPlayerListPosition = 1
end
reFillPlayerList ()
end
function playerListKeyPressed ( key, state )
if state == "down" then
radioUpState = isControlEnabled ( "radio_next" )
radioDownState = isControlEnabled ( "radio_previous" )
weaponUpState = isControlEnabled ( "next_weapon" )
weaponDownState = isControlEnabled ( "previous_weapon" )
toggleControl ( "radio_next", false )
toggleControl ( "radio_previous", false )
toggleControl ( "next_weapon", false )
toggleControl ( "previous_weapon", false )
toggleControl ( "radio_user_track_skip", false )
unbindKey ( "radio_next", "down", customRadioChannelSwitchUp )
unbindKey ( "radio_previous", "down", customRadioChannelSwitchDown )
if isTimer ( playerListUpdateTimer ) then
killTimer ( playerListUpdateTimer )
end
scollBarAdjustTimer = setTimer ( reAdjustPlayerListScollBar, 50, 0 )
bindKey ( "mouse_wheel_up", "down", playerListScrollUp )
bindKey ( "mouse_wheel_down", "down", playerListScrollDown )
showPlayerList ()
else
if isControlEnabled ( "next_weapon" ) then
toggleControl ( "radio_next", true )
toggleControl ( "radio_previous", true )
toggleControl ( "next_weapon", true )
toggleControl ( "previous_weapon", true )
else
if radioUpState ~= nil then
toggleControl ( "radio_next", radioUpState )
else
toggleControl ( "radio_next", true )
end
if radioDownState ~= nil then
toggleControl ( "radio_previous", radioDownState )
else
toggleControl ( "radio_previous", true )
end
if weaponUpState ~= nil then
toggleControl ( "next_weapon", weaponUpState )
else
toggleControl ( "next_weapon", true )
end
if weaponDownState ~= nil then
toggleControl ( "previous_weapon", weaponDownState )
else
toggleControl ( "previous_weapon", true )
end
end
toggleControl ( "radio_user_track_skip", true )
bindKey ( "radio_next", "down", customRadioChannelSwitchUp )
bindKey ( "radio_previous", "down", customRadioChannelSwitchDown )
if isTimer ( scollBarAdjustTimer ) then
killTimer ( scollBarAdjustTimer )
end
unbindKey ( "mouse_wheel_up", "down", playerListScrollUp )
unbindKey ( "mouse_wheel_down", "down", playerListScrollDown )
if gImage["playerList"] then
guiSetVisible ( gImage["playerList"], false )
end
end
end
bindKey ( "tab", "both", playerListKeyPressed )
Alles anzeigen
Ich habe alees mögliche geändert. Aber Terroristen sind immer noch unter SFPD, Mafia und Triaden..
in settings/settings_client.lua?
@FFrozen das Problem = ich finde es nicht xD
Klappt nicht. Die Anordnung behält sich.
Ich wollte das die Terroristen bei den Zivilisten angezeigt werden. Also in der Tabliste.
Sie sollten sich in der Anordnung der Zivilsten einsortieren. Also : Zivilisten ; SFPD ; Mafia usw.
Könnte mir wer dabei helfen?
Ich wollte bei den Terroristen die Selbstmordbombe ändern.
Und zwar sollte diese mehr schaden machen und eine etwas größere Reichweite.
Könnte mir gesagt werden wo man das ändern kann?
function arm_bomb ( player )
if not isPedDead ( player ) and vioGetElementData ( player, "hasBomb" ) then
bindKey ( player, "mouse3", "up", explodeTerror, player )
outputChatBox ( "Bombe ist scharf!", player, 0, 125, 0 )
setPlayerNametagColor ( player, 200, 0, 0 )
vioSetElementData ( player, "hasBomb", false )
else
outputChatBox ( "Du hast keine Bombe/bist Tod!", player, 125, 0, 0 )
end
vioSetElementData ( player, "armingBomb", false )
end
function explodeTerror ( keyPresser )
local x, y, z = getElementPosition ( keyPresser )
local rnd = math.random ( 7, 12 )
createExplosion ( x, y, z, rnd, keyPresser )
setTimer ( reExplode, 100, 1, keyPresser )
setPlayerNametagColor ( keyPresser, 200, 200, 200 )
unbindKey ( keyPresser, "mouse3", "up", explodeTerror )
end
function reExplode ( player )
setTimer ( reReExplode, math.floor(math.random(200,1000)), 1, player )
setTimer ( reReExplode, math.floor(math.random(200,1000)), 1, player )
setTimer ( reReExplode, math.floor(math.random(200,1000)), 1, player )
setTimer ( reReExplode, math.floor(math.random(200,1000)), 1, player )
setTimer ( reReExplode, math.floor(math.random(200,1000)), 1, player )
end
function reReExplode ( player )
local veh = getPedOccupiedVehicle ( player )
local x, y, z = getElementPosition ( player )
if veh then
local x, y, z = getElementPosition ( veh )
end
local rnd = math.random ( 7, 12 )
createExplosion ( x, y, z, rnd, player )
end
Alles anzeigen
Das Problem : wo?...
Wo denn im Script?
Ich finde es nicht. Tut mir leid
Ich meine Scriptseitig.
In der Datenbank den Standart des Bonuses einfach ändern.
Oder nach Login den Skill extra setzten,
Wo in der Datenbank?
Guten Tag,
ich wollte das so einstellen das jeder Spieler die Funktion "Doppel SMG" automatisch und immer aktiviert hat. Egal ob sie dies gekauft haben oder nicht.
Kann mir dort einer helfen?
Mfg
byFlex
Ne, nachdem Sie mir gesagt haben wo ich nochmal nachgucken sollte bzw den Code senden wusste ich dann auch wo
Habe es jetzt geschafft. Ich danke euch.
Ohne euch hätte ich das jetzt nicht ausprobiert
/closed
addEvent ("giveFgunsWeapon", true)
addEventHandler ("giveFgunsWeapon", getRootElement(), function (waffe, moneycost, matscost)
if waffe and moneycost and matscost then
local fac = getPlayerFaction(client)
if factionDepotData["mats"][fac] >= matscost then
if vioGetElementData ( client, "money" ) >= moneycost then
setPedArmor( client, 100 )
if waffe == "Baseball" then
giveWeapon ( client, 5, 1, true )
elseif waffe == "Messer" then
giveWeapon ( client, 4, 1, true )
elseif waffe == "Queue" then
giveWeapon ( client, 7, 1, true )
elseif waffe == "Deagle" then
giveWeapon ( client, 24, 49, true )
elseif waffe == "Mp5" then
giveWeapon ( client, 29, 180, true )
elseif waffe == "M4" then
giveWeapon ( client, 31, 350, true )
elseif waffe == "Katana" then
giveWeapon ( client, 8, 1, true )
elseif waffe == "Molotov" then
giveWeapon ( client, 18, 4, true )
elseif waffe == "Lupara" then
giveWeapon ( client, 26, 22, true )
elseif waffe == "Gewehr" then
giveWeapon ( client, 33, 51, true )
elseif waffe == "AK47" then
giveWeapon ( client, 30, 180, true )
elseif waffe == "Sniper" then
giveWeapon ( client, 34, 21, true )
elseif waffe == "Raketenwerfer" then
giveWeapon ( client, 35, 3, true )
end
vioSetElementData ( client, "money", vioGetElementData ( client, "money" ) - moneycost )
factionDepotData["money"][fac] = factionDepotData["money"][fac] + moneycost
factionDepotData["mats"][fac] = factionDepotData["mats"][fac] - matscost
outputLog ( getPlayerName(client) .. " hat ein(e) "..waffe.." gekauft.", "fguns" )
else
outputChatBox ( "Nicht genug Geld auf der Hand!", client, 155, 0, 0 )
end
else
outputChatBox ( "Nicht genug Mats im Lager", client, 155, 0, 0 )
end
end
end)
Alles anzeigen
Ne hat nicht geklappt
Ich wollte für die AoD Fraktion das so haben das die AoDler sich Uzis kaufen können statt Molotov
local GUIEditor = {
button = {},
window = {},
label = {}
}
--[[
1 = Nahkampf | 2 = Deagle | 3 = Mp5 | 4 = Spezialwaffe | 5 = Gewehr |
6 = AK47 | 7 = M4 | 8 = Sniper | 9 = Raketenwerfer |
]]
local Moneycost = {
[1] = 100,
[2] = 200,
[3] = 300,
[4] = 300,
[5] = 300,
[6] = 300,
[7] = 400,
[8] = 1500,
[9] = 2000
}
local Matscost = {
[1] = 10,
[2] = 20,
[3] = 30,
[4] = 30,
[5] = 30,
[6] = 30,
[7] = 40,
[8] = 150,
[9] = 200
}
local buttonID = {}
function createFgunsGui (therank, thefrac)
showCursor (true)
setElementClicked ( true )
GUIEditor.window[1] = guiCreateWindow(0.26, 0.07, 0.50, 0.80, "Fraktionslager", true)
guiSetAlpha(GUIEditor.window[1], 0.90)
guiBringToFront (GUIEditor.window[1])
-- Yakuza --
if thefrac == 3 then
GUIEditor.button[1] = guiCreateButton(0.03, 0.09, 0.25, 0.11, "Baseball", true, GUIEditor.window[1])
guiSetProperty(GUIEditor.button[1], "NormalTextColour", "E3FFFFFF")
if therank >= 2 then
GUIEditor.button[4] = guiCreateButton(0.03, 0.34, 0.25, 0.11, "Katana", true, GUIEditor.window[1])
guiSetProperty(GUIEditor.button[4], "NormalTextColour", "E3FFFFFF")
GUIEditor.label[7] = guiCreateLabel(0.03, 0.48, 0.25, 0.04, Moneycost[4].."$", true, GUIEditor.window[1])
guiLabelSetHorizontalAlign(GUIEditor.label[7], "center", false)
GUIEditor.label[8] = guiCreateLabel(0.03, 0.52, 0.25, 0.04, Matscost[4].." Mats", true, GUIEditor.window[1])
guiLabelSetHorizontalAlign(GUIEditor.label[8], "center", false)
end
-- Mafia --
elseif thefrac == 2 then
GUIEditor.button[1] = guiCreateButton(0.03, 0.09, 0.25, 0.11, "Messer", true, GUIEditor.window[1])
guiSetProperty(GUIEditor.button[1], "NormalTextColour", "E3FFFFFF")
if therank >= 2 then
GUIEditor.button[4] = guiCreateButton(0.03, 0.34, 0.25, 0.11, "Lupara", true, GUIEditor.window[1])
guiSetProperty(GUIEditor.button[4], "NormalTextColour", "E3FFFFFF")
GUIEditor.label[7] = guiCreateLabel(0.03, 0.48, 0.25, 0.04, Moneycost[4].."$", true, GUIEditor.window[1])
guiLabelSetHorizontalAlign(GUIEditor.label[7], "center", false)
GUIEditor.label[8] = guiCreateLabel(0.03, 0.52, 0.25, 0.04, Matscost[4].." Mats", true, GUIEditor.window[1])
guiLabelSetHorizontalAlign(GUIEditor.label[8], "center", false)
end
else
GUIEditor.button[1] = guiCreateButton(0.03, 0.09, 0.25, 0.11, "Queue", true, GUIEditor.window[1])
guiSetProperty(GUIEditor.button[1], "NormalTextColour", "E3FFFFFF")
if therank >= 2 then
GUIEditor.button[4] = guiCreateButton(0.03, 0.34, 0.25, 0.111, "Molotov", true, GUIEditor.window[1])
guiSetProperty(GUIEditor.button[4], "NormalTextColour", "E3FFFFFF")
GUIEditor.label[7] = guiCreateLabel(0.03, 0.48, 0.25, 0.04, Moneycost[4].."$", true, GUIEditor.window[1])
guiLabelSetHorizontalAlign(GUIEditor.label[7], "center", false)
GUIEditor.label[8] = guiCreateLabel(0.03, 0.52, 0.25, 0.04, Matscost[4].." Mats", true, GUIEditor.window[1])
guiLabelSetHorizontalAlign(GUIEditor.label[8], "center", false)
end
end
GUIEditor.label[1] = guiCreateLabel(0.03, 0.22, 0.25, 0.04, Moneycost[1].."$", true, GUIEditor.window[1])
guiLabelSetHorizontalAlign(GUIEditor.label[1], "center", false)
GUIEditor.label[2] = guiCreateLabel(0.03, 0.26, 0.25, 0.04, Matscost[1].." Mats", true, GUIEditor.window[1])
guiLabelSetHorizontalAlign(GUIEditor.label[2], "center", false)
GUIEditor.button[2] = guiCreateButton(0.39, 0.09, 0.25, 0.11, "Deagle", true, GUIEditor.window[1])
guiSetProperty(GUIEditor.button[2], "NormalTextColour", "E3FFFFFF")
GUIEditor.label[3] = guiCreateLabel(0.39, 0.22, 0.25, 0.04, Moneycost[2].."$", true, GUIEditor.window[1])
guiLabelSetHorizontalAlign(GUIEditor.label[3], "center", false)
GUIEditor.label[4] = guiCreateLabel(0.39, 0.26, 0.25, 0.04, Matscost[2].." Mats", true, GUIEditor.window[1])
guiLabelSetHorizontalAlign(GUIEditor.label[4], "center", false)
if therank >= 1 then
GUIEditor.button[3] = guiCreateButton(0.73, 0.09, 0.25, 0.11, "Mp5", true, GUIEditor.window[1])
guiSetProperty(GUIEditor.button[3], "NormalTextColour", "E3FFFFFF")
GUIEditor.label[5] = guiCreateLabel(0.73, 0.22, 0.25, 0.04, Moneycost[3].."$", true, GUIEditor.window[1])
guiLabelSetHorizontalAlign(GUIEditor.label[5], "center", false)
GUIEditor.label[6] = guiCreateLabel(0.73, 0.26, 0.25, 0.04, Matscost[3].." Mats", true, GUIEditor.window[1])
guiLabelSetHorizontalAlign(GUIEditor.label[6], "center", false)
end
if therank >= 2 then
GUIEditor.button[5] = guiCreateButton(0.39, 0.34, 0.25, 0.11, "Gewehr", true, GUIEditor.window[1])
guiSetProperty(GUIEditor.button[5], "NormalTextColour", "E3FFFFFF")
GUIEditor.label[9] = guiCreateLabel(0.39, 0.48, 0.24, 0.04, Moneycost[5].."$", true, GUIEditor.window[1])
guiLabelSetHorizontalAlign(GUIEditor.label[9], "center", false)
GUIEditor.label[10] = guiCreateLabel(0.39, 0.52, 0.25, 0.04, Matscost[5].." Mats", true, GUIEditor.window[1])
guiLabelSetHorizontalAlign(GUIEditor.label[10], "center", false)
end
if therank >= 3 then
GUIEditor.button[7] = guiCreateButton(0.03, 0.61, 0.25, 0.11, "M4", true, GUIEditor.window[1])
guiSetProperty(GUIEditor.button[7], "NormalTextColour", "E3FFFFFF")
GUIEditor.label[13] = guiCreateLabel(0.03, 0.73, 0.25, 0.04, Moneycost[7].."$", true, GUIEditor.window[1])
guiLabelSetHorizontalAlign(GUIEditor.label[13], "center", false)
GUIEditor.label[14] = guiCreateLabel(0.03, 0.77, 0.25, 0.04, Matscost[7].." Mats", true, GUIEditor.window[1])
guiLabelSetHorizontalAlign(GUIEditor.label[14], "center", false)
GUIEditor.button[6] = guiCreateButton(0.73, 0.34, 0.25, 0.11, "AK47", true, GUIEditor.window[1])
guiSetProperty(GUIEditor.button[6], "NormalTextColour", "E3FFFFFF")
GUIEditor.label[11] = guiCreateLabel(0.73, 0.48, 0.25, 0.04, Moneycost[6].."$".."$", true, GUIEditor.window[1])
guiLabelSetHorizontalAlign(GUIEditor.label[11], "center", false)
GUIEditor.label[12] = guiCreateLabel(0.73, 0.52, 0.25, 0.04, Matscost[6].." Mats", true, GUIEditor.window[1])
guiLabelSetHorizontalAlign(GUIEditor.label[12], "center", false)
end
if therank >= 4 then
GUIEditor.button[8] = guiCreateButton(0.39, 0.61, 0.25, 0.11, "Sniper", true, GUIEditor.window[1])
guiSetProperty(GUIEditor.button[8], "NormalTextColour", "E3FFFFFF")
GUIEditor.label[15] = guiCreateLabel(0.39, 0.73, 0.25, 0.04, Moneycost[8].."$", true, GUIEditor.window[1])
guiLabelSetHorizontalAlign(GUIEditor.label[15], "center", false)
GUIEditor.label[16] = guiCreateLabel(0.39, 0.77, 0.25, 0.04, Matscost[8].." Mats", true, GUIEditor.window[1])
guiLabelSetHorizontalAlign(GUIEditor.label[16], "center", false)
end
if therank >= 5 then
GUIEditor.button[9] = guiCreateButton(0.73, 0.61, 0.25, 0.11, "Raketenwerfer", true, GUIEditor.window[1])
guiSetProperty(GUIEditor.button[9], "NormalTextColour", "E3FFFFFF")
GUIEditor.label[17] = guiCreateLabel(0.73, 0.73, 0.25, 0.04, Moneycost[9].."$", true, GUIEditor.window[1])
guiLabelSetHorizontalAlign(GUIEditor.label[17], "center", false)
GUIEditor.label[18] = guiCreateLabel(0.73, 0.78, 0.25, 0.04, Matscost[9].." Mats", true, GUIEditor.window[1])
guiLabelSetHorizontalAlign(GUIEditor.label[18], "center", false)
end
GUIEditor.button[10] = guiCreateButton(0.29, 0.86, 0.43, 0.09, "Schließen", true, GUIEditor.window[1])
guiSetProperty(GUIEditor.button[10], "NormalTextColour", "E3FFFFFF")
for index, button in pairs ( GUIEditor.button ) do
if index ~= 10 then
addEventHandler ("onClientGUIClick", GUIEditor.button[index], sendTheWeaponFromFGunsToServer, false)
buttonID[GUIEditor.button[index]] = index
end
end
addEventHandler ("onClientGUIClick", GUIEditor.button[10], closeFgunsGui, false)
end
addEvent ( "startFgunsGui", true )
addEventHandler( "startFgunsGui", getRootElement(), createFgunsGui )
function sendTheWeaponFromFGunsToServer ( button, state )
if button == "left" and state == "up" then
triggerServerEvent ( "giveFgunsWeapon", lp, guiGetText(source), Moneycost[buttonID[source]], Matscost[buttonID[source]] )
end
end
function closeFgunsGui ( button, state )
if button == "left" and state == "up" then
showCursor (false)
setElementClicked ( false )
for i, button in pairs (GUIEditor.button) do
destroyElement (button)
GUIEditor.button[i] = nil
end
for i, label in pairs (GUIEditor.label) do
destroyElement (label)
GUIEditor.label[i] = nil
end
destroyElement (GUIEditor.window[1])
GUIEditor.window[1] = nil
end
end
Alles anzeigen