-
Posts
21,935 -
Joined
-
Last visited
-
Days Won
6
Everything posted by Castillo
-
You must have put this script as server side, GUI is client side only.
-
function theLastPiece ( _, attacker ) if ( getElementType ( attacker ) == "player" ) then if ( getPlayerTeam ( attacker) == getPlayerTeam ( source ) ) then if getElementData ( attacker, "Reported" ) then if ( getElementData ( attacker, "Reported" ) == 1 ) then kickPlayer ( attacker, "You have been kicked for deathmatching" ) outputChatBox ( getPlayerName ( attacker ) .." have been kicked for deathmatching, this is not acceptable. If you continue you will be kicked", root, 255, 0, 0 ) else setElementData ( attacker, "Reported", getElementData ( attacker, "Reported" ) + 1 ) outputChatBox ( "You have been reported for deathmatching, this is not acceptable. If you continue you will be kicked", attacker, 255, 0, 0 ) end else setElementData ( attacker, "Reported", 1 ) outputChatBox ( "You have been reported for deathmatching, this is not acceptable. If you continue you will be kicked", attacker, 255, 0, 0 ) end end end end addEventHandler ( "onPlayerWasted", getRootElement(), theLastPiece )
-
-- client side: GUIEditor = { button = { }, window = { }, edit = { } } addEventHandler ( "onClientResourceStart", resourceRoot, function ( ) GUIEditor.window[1] = guiCreateWindow(5, 122, 1366, 498, "Backup Server - Spawn System", false) guiSetVisible ( GUIEditor.window[1], false ) guiWindowSetSizable(GUIEditor.window[1], false) GUIEditor.button[1] = guiCreateButton(54, 96, 558, 137, "Military", false, GUIEditor.window[1]) guiSetProperty(GUIEditor.button[1], "NormalTextColour", "FF00FE06") GUIEditor.button[2] = guiCreateButton(749, 96, 558, 137, "Resistance", false, GUIEditor.window[1]) guiSetProperty(GUIEditor.button[2], "NormalTextColour", "FFFE0000") GUIEditor.edit[1] = guiCreateEdit(45, 265, 567, 223, "Players spawned in the Military Class must protect the people of SA from the Zombie Infection.", false, GUIEditor.window[1]) GUIEditor.edit[2] = guiCreateEdit(744, 260, 567, 223, "Players spawned in the Resistance Class must destroy the Military Troops, and take control of SA.", false, GUIEditor.window[1]) end ) addEventHandler ( "onClientGUIClick", root, function ( ) if ( source == GUIEditor.button[1] ) then triggerServerEvent ( "Military", localPlayer ) guiSetVisible ( GUIEditor_window[1], false ) showCursor ( false ) elseif ( source == GUIEditor.button[2] ) then triggerServerEvent ( "Resistance", localPlayer ) guiSetVisible ( GUIEditor_window[1], false ) showCursor ( false ) end end ) addEvent ( "setSpawnVisible", true ) addEventHandler ( "setSpawnVisible",root, function ( ) guiSetVisible ( GUIEditor_window[1], true ) setTimer ( function ( ) showCursor ( true ) end ,1000, 1 ) end ) -- server side: addEvent("Military", true) addEventHandler("Military", root, function() team1 = createTeam ("Military Forces", 0, 255, 0) setPlayerTeam (source, team1) spawnPlayer (source, 207.90919, 1865.12842, 13.14063, 196, 0, 0) setElementModel (source, 196) setPlayerNametagColor (source, 0, 255, 0) fadeCamera (source, true) setCameraTarget (source, source) giveWeapon (source, 28, 2000) giveWeapon (source, 23, 2000) end ) addEvent("Resistance", true) addEventHandler("Resistance", root, function() resisteam = createTeam ("Resistances", 255, 0, 0) setPlayerTeam (source, resisteam) spawnPlayer (source, 1091.63159, 2111.34351, 15.35040, 7, 0, 0) outputChatBox ( "You have spawned as a 'Resistance Member'!", source, 255, 0, 0, true ) setElementModel (source, 7) setPlayerNametagColor (source, 255, 0, 0) fadeCamera (source, true) setCameraTarget (source,source) giveWeapon (source, 28, 2000,true) giveWeapon (source, 23, 2000) end ) function showSpawn ( ) triggerClientEvent ( source, "setSpawnVisible", source, true ) end addEventHandler ( "onPlayerWasted", root, showSpawn ) addEventHandler ( "onPlayerLogin", root, showSpawn )
-
onClientGUIClick > guiGridListGetSelectedItem > guiGridListGetItemText > getPlayerFromName > isElement > createBlipAttachedTo.
-
There's no such function.
-
That'll only obtain the ping from the local player. local text_h = dxGetFontHeight ( 1, "bankgothic" ) addEventHandler("onClientRender",root, function ( ) local name_X = 350 local team_X = 700 local ping_X = 950 local name_Y = 200 local namend_Y = 700 if ( not getKeyState ( "tab" ) ) then return end if ( name_Y > namend_Y ) then return end dxDrawRectangle(250, 100, 800, 600, tocolor(0, 100, 255, 150), false) dxDrawText("Belgium-Reallife", 250, 100, 1050, 200, tocolor(255, 255, 255, 255), 2.00, "bankgothic", "center", "center", false, false, true, false, false) dxDrawLine(250, 200, 1050, 200, tocolor(255, 255, 255, 255), 1, false) dxDrawLine(550, 200, 550, 700, tocolor(255, 255, 255, 255), 1, false) dxDrawLine(850, 200, 850, 700, tocolor(255, 255, 255, 255), 1, false) --dxDrawText("Team1", 550, 200, 850, 700, tocolor(255, 255, 255, 255), 1.00, "bankgothic", "center", "top", false, false, true, false, false) --dxDrawText("Ping1", 850, 200, 1050, 700, tocolor(255, 255, 255, 255), 1.00, "bankgothic", "center", "top", false, false, true, false, false) for _, player in ipairs ( getElementsByType ( "player" ) ) do dxDrawText ( getPlayerName ( player ), name_X, name_Y, name_X * 1.2, name_Y * 1.2, tocolor ( 255, 255, 255, 255 ), 1.0, "pricedown" ) dxDrawText ( tostring ( getPlayerPing ( player ) ), ping_X, name_Y, ping_X * 1.2, name_Y * 1.2, tocolor ( 255, 255, 255, 255 ), 1.0, "pricedown" ) name_Y = ( name_Y + text_h * 1.5 ) end end )
-
Use the same loop as for names, and add a new dxDrawText which draws the player ping.
-
GUIEditor = { button = {}, window = {}, edit = {} } addEventHandler("onClientResourceStart", resourceRoot, function() GUIEditor.window[1] = guiCreateWindow(5, 122, 1366, 498, "Backup Server - Spawn System", false) guiWindowSetSizable(GUIEditor.window[1], false) GUIEditor.button[1] = guiCreateButton(54, 96, 558, 137, "Military", false, GUIEditor.window[1]) guiSetProperty(GUIEditor.button[1], "NormalTextColour", "FF00FE06") GUIEditor.button[2] = guiCreateButton(749, 96, 558, 137, "Resistance", false, GUIEditor.window[1]) guiSetProperty(GUIEditor.button[2], "NormalTextColour", "FFFE0000") GUIEditor.edit[1] = guiCreateEdit(45, 265, 567, 223, "Players spawned in the Military Class must protect the people of SA from the Zombie Infection.", false, GUIEditor.window[1]) GUIEditor.edit[2] = guiCreateEdit(744, 260, 567, 223, "Players spawned in the Resistance Class must destroy the Military Troops, and take control of SA.", false, GUIEditor.window[1]) showCursor(true) end ) showCursor ( false ) addEventHandler ( "onClientGUIClick", root, function ( ) if ( source == GUIEditor.button[1] ) then triggerServerEvent ( "Military", localPlayer ) guiSetVisible ( GUIEditor_window[1], false ) showCursor ( false ) elseif ( source == GUIEditor.button[2] ) then triggerServerEvent ( "Resistance", localPlayer ) guiSetVisible ( GUIEditor_window[1], false ) showCursor ( false ) end end ) addEvent("setSpawnVisible",true) addEventHandler("setSpawnVisible",root, function () guiSetVisible( GUIEditor_window[1], true ) setTimer( function () showCursor( true ) end, 1000,1) end )
-
Well, you can rename the settings to something like: "business_blip".
-
These are all the weapon skill IDs.
-
The problem is that you used weapon IDs as stat IDs, but that's wrong. function onSpawn ( ) giveWeapon ( source, 24, 300 ) setPedStat ( source, 73, 1000 ) setPedStat ( source, 75, 1000 ) giveWeapon ( source, 26, 300 ) giveWeapon ( source, 32, 300 ) giveWeapon ( source, 31, 300 ) giveWeapon ( source, 46, 1 ) giveWeapon ( source, 24, 300 ) giveWeapon ( source, 34, 20 ) givePlayerMoney ( source, 2500 ) end addEventHandler ( "onPlayerSpawn", getRootElement(), onSpawn )
-
Seems like if you use setting names such as: "business.key" the value returned from get ( ) is a boolean ( false ).
-
Ya le resolvi el problema por skype.
-
Change 'thePlayer' with 'source'.
-
You are using it on the same resource?
-
local text_h = dxGetFontHeight ( 1, "bankgothic" ) addEventHandler("onClientRender",root, function ( ) local name_X = 350 local team_X = 700 local ping_X = 950 local name_Y = 200 local namend_Y = 700 if ( not getKeyState ( "tab" ) ) then return end if ( name_Y > namend_Y ) then return end dxDrawRectangle(250, 100, 800, 600, tocolor(0, 100, 255, 150), false) dxDrawText("Belgium-Reallife", 250, 100, 1050, 200, tocolor(255, 255, 255, 255), 2.00, "bankgothic", "center", "center", false, false, true, false, false) dxDrawLine(250, 200, 1050, 200, tocolor(255, 255, 255, 255), 1, false) dxDrawLine(550, 200, 550, 700, tocolor(255, 255, 255, 255), 1, false) dxDrawLine(850, 200, 850, 700, tocolor(255, 255, 255, 255), 1, false) --dxDrawText("Team1", 550, 200, 850, 700, tocolor(255, 255, 255, 255), 1.00, "bankgothic", "center", "top", false, false, true, false, false) --dxDrawText("Ping1", 850, 200, 1050, 700, tocolor(255, 255, 255, 255), 1.00, "bankgothic", "center", "top", false, false, true, false, false) for _, player in ipairs ( getElementsByType ( "player" ) ) do dxDrawText ( getPlayerName ( player ), name_X, name_Y, name_X * 1.2, name_Y * 1.2, tocolor ( 255, 255, 255, 255 ), 1.0, "pricedown" ) name_Y = ( name_Y + text_h * 1.5 ) end end )
-
That's not really possible, since you can't get the account password.
-
function createTeamsOnStart ( ) teamstaff = createTeam ( "AMIS", 226,8,246 ) end addEventHandler ( "onResourceStart", resourceRoot, createTeamsOnStart ) function togglestaffMode ( thePlayer ) local account = getPlayerAccount ( thePlayer ) if ( not account or isGuestAccount ( account ) ) then outputChatBox ( "Pääsy estetty.", thePlayer, 226,8,246 ) return end local accountName = getAccountName ( account ) if ( isObjectInACLGroup ( "user.".. accountName, aclGetGroup ( "amis" ) ) ) then outputChatBox ( "SPAWNASIT JUURI AMIKSEKSI.", thePlayer, 226,8,246 ) setPlayerTeam ( thePlayer, teamstaff ) setPlayerNametagColor ( thePlayer, 226,8,246 ) spawnPlayer ( thePlayer, 1460, 2779, 11 ) setElementModel ( thePlayer, 29 ) giveWeapon ( thePlayer, 5, 1 ) giveWeapon ( thePlayer, 22, 250 ) giveWeapon ( thePlayer, 25, 100 ) giveWeapon ( thePlayer, 32, 215 ) giveWeapon ( thePlayer, 34, 15 ) end end addCommandHandler ( "amis", togglestaffMode ) You had a missing 'end' P.S: I didn't understand the freeroam team part.