-
Posts
21,935 -
Joined
-
Last visited
-
Days Won
6
Everything posted by Castillo
-
-- Settings for when a player joins -- XYZ coördinates local joinX = -2462.3999023438 local joinY = 132.69999694824 local joinZ = 35.200000762939 -- Weapon and ammo local joinWeapon = 0 local joinAmmo = 0 -- Message when player joins local joinMessage = "Welcome to Belgium-Reallife." -- Skin that player gets local joinSkin = 0 -- Settings for when a player dies -- XYZ coördinates local spawnX = -2462.3999023438 local spawnY = 132.69999694824 local spawnZ = 35.200000762939 -- Weapon and ammo local spawnWeapon = 0 local spawnAmmo = 0 -- Skin that player gets local spawnSkin = 0 -- Settings for the amounts of money -- Money the killer gets local killerMoney = 0 -- Money removed from player when they die local deadPlayerMoney = 0 -- Money you get when you join local joinMoney = 0 local yakuzaPosition = { 0, 0, 5 } -- Functions -- This function spawns players when they join function spawnOnJoin() local x, y, z = joinX, joinY, joinZ if ( getPlayerTeam ( source ) == getTeamFromName ( "Yakuza" ) ) then x, y, z = unpack ( yakuzaPosition ) end spawnPlayer(source, x, y, z, 0 , joinSkin) fadeCamera(source, true) setCameraTarget(source, source) outputChatBox(joinMessage, source) giveWeapon(source, joinWeapon, joinAmmo) givePlayerMoney(source, joinMoney) end -- This function spawns players after they died function spawnOnDead(ammo, killer, weapon, bodypart) outputChatBox(getPlayerName(source).." died.") takePlayerMoney(source, deadPlayerMoney) if (killer) and (killer ~= source) then givePlayerMoney(killer, killerMoney) end local x, y, z = spawnX, spawnY, spawnZ if ( getPlayerTeam ( source ) == getTeamFromName ( "Yakuza" ) ) then x, y, z = unpack ( yakuzaPosition ) end setTimer(spawnPlayer, 3000, 1, source, x, y, z, 0, spawnSkin) setCameraTarget(source, source) setTimer(giveWeapon, 3000, 1, source, spawnWeapon, spawnAmmo) end -- Event handlers addEventHandler("onPlayerJoin", getRootElement(), spawnOnJoin) addEventHandler("onPlayerWasted", getRootElement(), spawnOnDead) Change this line: local yakuzaPosition = { 0, 0, 5 } 0, 0, 5 = coordinates.
-
So, what is the problem? you aren't restricting them or anything.
-
local files = { { name = "rims", model = 1075 }, { name = "wheel_sr6", model = 1075 }, { name = "wheel_sr3", model = 1075 }, } addEventHandler ( "onClientResourceStart", resourceRoot, function ( ) for index, file in ipairs ( files ) do engineImportTXD ( engineLoadTXD ( file.name ..".txd", file.model ), file.model ) engineReplaceModel ( engineLoadDFF ( file.name ..".dff", file.model ), file.model ) end end )
-
function loadMods( ) txd = engineLoadTXD( "infernus/fortune.txd" ) engineReplaceTXD( txd, 526) dff = engineLoadDFF( "infernus/fortune.dff" , 526 ) engineReplaceModel( dff, 526) end addEventHandler("onClientResourceStart", resourceRoot, loadMods)
-
When they join, they won't be on a team for sure.
-
You want to restrict all the other buttons but "Belépés" to "Admin" group?
-
So, joinX, joinY, joinZ should be for "Yakuz" and spawnX, spawnY, spawnZ for normal players? -- Settings for when a player joins -- XYZ coördinates local joinX = -2462.3999023438 local joinY = 132.69999694824 local joinZ = 35.200000762939 -- Weapon and ammo local joinWeapon = 0 local joinAmmo = 0 -- Message when player joins local joinMessage = "Welcome to Belgium-Reallife." -- Skin that player gets local joinSkin = 0 -- Settings for when a player dies -- XYZ coördinates local spawnX = -2462.3999023438 local spawnY = 132.69999694824 local spawnZ = 35.200000762939 -- Weapon and ammo local spawnWeapon = 0 local spawnAmmo = 0 -- Skin that player gets local spawnSkin = 0 -- Settings for the amounts of money -- Money the killer gets local killerMoney = 0 -- Money removed from player when they die local deadPlayerMoney = 0 -- Money you get when you join local joinMoney = 0 -- Functions -- This function spawns players when they join function spawnOnJoin() local x, y, z = spawnX, spawnY, spawnZ if ( getPlayerTeam ( source ) == getTeamFromName ( "Yakuza" ) ) then x, y, z = joinX, joinY, joinZ end spawnPlayer(source, x, y, z, 0 , joinSkin) fadeCamera(source, true) setCameraTarget(source, source) outputChatBox(joinMessage, source) giveWeapon(source, joinWeapon, joinAmmo) givePlayerMoney(source, joinMoney) end -- This function spawns players after they died function spawnOnDead(ammo, killer, weapon, bodypart) outputChatBox(getPlayerName(source).." died.") takePlayerMoney(source, deadPlayerMoney) if (killer) and (killer ~= source) then givePlayerMoney(killer, killerMoney) end local x, y, z = spawnX, spawnY, spawnZ if ( getPlayerTeam ( source ) == getTeamFromName ( "Yakuza" ) ) then x, y, z = joinX, joinY, joinZ end setTimer(spawnPlayer, 3000, 1, source, x, y, z, 0, spawnSkin) setCameraTarget(source, source) setTimer(giveWeapon, 3000, 1, source, spawnWeapon, spawnAmmo) end -- Event handlers addEventHandler("onPlayerJoin", getRootElement(), spawnOnJoin) addEventHandler("onPlayerWasted", getRootElement(), spawnOnDead)
-
MySQL is server side only, also: "mta_mysql.dll" /> doesn't need to be on meta.xml.
-
addEventHandler ( "onPlayerWasted", root, function ( _, killer ) if ( killer and killer ~= source ) then -- Do something end end )
-
You got many problems there, on the meta.xml you have one path, and on the script a different one, then you use 'onRecourceStart' which doesn't exist, you should use 'onClientResourceStart'.
-
This will set the health of the player to 10% everytime they spawn. addEventHandler ( "onPlayerSpawn", root, function ( ) setElementHealth ( source, 10 ) end )
-
That was answered here: viewtopic.php?f=13&t=45831
-
Try this: -- Settings for when a player joins -- XYZ coördinates local joinX = -2462.3999023438 local joinY = 132.69999694824 local joinZ = 35.200000762939 -- Weapon and ammo local joinWeapon = 0 local joinAmmo = 0 -- Message when player joins local joinMessage = "Welcome to Belgium-Reallife." -- Skin that player gets local joinSkin = 0 -- Settings for when a player dies -- XYZ coördinates local spawnX = -2462.3999023438 local spawnY = 132.69999694824 local spawnZ = 35.200000762939 -- Weapon and ammo local spawnWeapon = 0 local spawnAmmo = 0 -- Skin that player gets local spawnSkin = 0 -- Settings for the amounts of money -- Money the killer gets local killerMoney = 0 -- Money removed from player when they die local deadPlayerMoney = 0 -- Money you get when you join local joinMoney = 0 -- Functions -- This function spawns players when they join function spawnOnJoin() local x, y, z = joinX, joinY, joinZ if ( getPlayerTeam ( source ) == getTeamFromName ( "Yakuza" ) ) then x, y, z = spawnX, spawnY, spawnZ end spawnPlayer(source, x, y, z, 0 , joinSkin) fadeCamera(source, true) setCameraTarget(source, source) outputChatBox(joinMessage, source) giveWeapon(source, joinWeapon, joinAmmo) givePlayerMoney(source, joinMoney) end -- This function spawns players after they died function spawnOnDead(ammo, killer, weapon, bodypart) outputChatBox(getPlayerName(source).." died.") takePlayerMoney(source, deadPlayerMoney) if (killer) and (killer ~= source) then givePlayerMoney(killer, killerMoney) end local x, y, z = joinX, joinY, joinZ if ( getPlayerTeam ( source ) == getTeamFromName ( "Yakuza" ) ) then x, y, z = spawnX, spawnY, spawnZ end setTimer(spawnPlayer, 3000, 1, source, x, y, z, 0, spawnSkin) setCameraTarget(source, source) setTimer(giveWeapon, 3000, 1, source, spawnWeapon, spawnAmmo) end -- Event handlers addEventHandler("onPlayerJoin", getRootElement(), spawnOnJoin) addEventHandler("onPlayerWasted", getRootElement(), spawnOnDead)
-
Try this then: local playerClass = getAccountData (theCurrentAccount, "class") setElementData(source, "Class", playerClass) setAccountData (account, "class", tostring (getElementData (source, "Class")))
-
And is saved as element data? if so, on what data name?
-
That's because you created not just one GUI, you created like 5 of them which had mostly the same thing. GUIEditor = { memo = {}, staticimage = {}, window = {}, tab = {}, tabpanel = {}, } addEventHandler("onClientResourceStart", resourceRoot, function() GUIEditor.window[1] = guiCreateWindow(630, 262, 711, 563, "CzH|Racing DM/DD", false) guiWindowSetSizable(GUIEditor.window[1], false) guiSetVisible(GUIEditor.window[1],false) guiSetProperty(GUIEditor.window[1], "CaptionColour", "FF47FF00") GUIEditor.tabpanel[2] = guiCreateTabPanel(278, 29, 406, 509, false, GUIEditor.window[1]) GUIEditor.tab[3] = guiCreateTab("Rules", GUIEditor.tabpanel[2]) GUIEditor.memo[3] = guiCreateMemo(8, 9, 391, 467, " Rules :\n\n-1 Don't insult!\n\n-2 Do not spam!\n\n-3 Respect other players!\n\n-4 Respect the admins!\n\n-5 Don't swear!\n\n-6 Don't ask for admin! else Mute/Kick/Ban\n 5min/ --- /1 hour\n-7 English and Dutch only in global chat!\n\n-8 \n\n-9\n\n-10\n\n-11\n\n-12\n\n-13\n\n-14\n\n-15", false, GUIEditor.tab[3]) GUIEditor.tab[4] = guiCreateTab("Members", GUIEditor.tabpanel[2]) GUIEditor.memo[4] = guiCreateMemo(10, 10, 386, 467, "Leaders :\n- CzH|Rocket\n- CzHTwister\n\nSub leaders :\n-----------------\n\nMembers :\n----------------", false, GUIEditor.tab[4]) GUIEditor.staticimage[1] = guiCreateStaticImage(10, 350, 267, 204, ":race/img/title.png", false, GUIEditor.window[1]) GUIEditor.memo[5] = guiCreateMemo(22, 54, 247, 289, "Welcome to CzH|Racing,\n\nI hope you will enjoy this server.\nBefore you play please read the rules ->\nIf there are any problems please contact me on skype : sandro-,- \nIf you wanna join CzH please contact :\nsandro-,- or Itzzzzmarvin on skype.\n\n\nNews :\n--------------------------------------------------------.--------------------------------------------------------.--------------------------------------------------------.--------------------------------------------------------.--------------------------------------------------------.--------------------------------------------------------.--------------------------------------------------------.", false, GUIEditor.window[1]) end ) function showwindow () guiSetVisible( GUIEditor.window[1], not guiGetVisible( GUIEditor.window[1] ) ) showCursor( guiGetVisible( GUIEditor.window[1] ) ) guiSetInputEnabled( guiGetVisible( GUIEditor.window[1] ) ) end addCommandHandler("czh",showwindow) bindKey("F7","down",showwindow)
-
Event handlers has to go inside the "onClientResourceStart" function. GUIEditor = { memo = {}, button = {}, edit = {}, checkbox = {}, label = {}, } addEventHandler("onClientResourceStart", resourceRoot, function() bRegister = guiCreateButton(527, 719, 138, 52, "Register", false) bLogin = guiCreateButton(673, 719, 83, 53, "Login", false) tgLabel = guiCreateLabel(336, 477, 217, 64, "The Goodies!", false) guiSetFont(tgLabel, "sa-header") guiLabelSetColor(tgLabel, 86, 249, 5) tbLabel = guiCreateLabel(733, 482, 220, 53, "The Baddies!", false) guiSetFont(tbLabel, "sa-header") guiLabelSetColor(tbLabel, 254, 0, 0) vLabel = guiCreateLabel(607, 482, 116, 54, "VS.", false) guiSetFont(vLabel, "sa-header") uLabel = guiCreateLabel(338, 575, 169, 60, "Username", false) guiSetFont(uLabel, "sa-header") pLabel = guiCreateLabel(338, 649, 168, 61, "Password", false) guiSetFont(pLabel, "sa-header") rCbox = guiCreateCheckBox(529, 638, 220, 17, "Remember My Details?", false, false) guiSetFont(rCbox, "clear-normal") mRead = guiCreateMemo(569, 247, 171, 203, " PLEASE READ!", false) guiMemoSetReadOnly(mRead, true) uEdit = guiCreateEdit(527, 589, 229, 39, "", false) pEdit = guiCreateEdit(526, 663, 227, 37, "", false) guiEditSetMasked ( pEdit, true ) addEventHandler ( "onClientGUIClick", bLogin, onClickBtn, false ) addEventHandler ( "onClientGUIClick", rLogin, onClickBtn2, false ) local playername = getPlayerName(localPlayer) guiSetText(LoginUsername, "") guiSetText(EditRegisterUsername, "") guiSetText(LoginUsername, playername) guiSetText(EditRegisterUsername, playername) guiSetInputEnabled(true) showCursor ( true ) end ) function onClickBtn ( button, state ) if (source == bLogin) then triggerServerEvent ( "onLogin", getRootElement(), localPlayer, guiGetText(uEdit), guiGetText(pEdit)) end end function onClickBtn2 ( button, state ) if (source == bRegister) then triggerServerEvent ( "onRegister", getRootElement(), localPlayer, guiGetText(uEdit), guiGetText(pEdit)) end end function hideLoginWindow() guiSetInputEnabled(false) guiSetVisible ( GUIEditor_Window[1], false ) showCursor ( false ) end addEvent( "hideLoginWindow", true ) addEventHandler( "hideLoginWindow", getRootElement(), hideLoginWindow )
-
Doesn't work GUI is only client side, all the script has to be client side.
-
function showwindow () guiSetVisible( GUIEditor.window[1], not guiGetVisible( GUIEditor.window[1] ) ) showCursor( guiGetVisible( GUIEditor.window[1] ) ) guiSetInputEnabled( guiGetVisible( GUIEditor.window[1] ) ) end addCommandHandler("czh",showwindow) bindKey("F7","down",showwindow)
-
Are you sure that you get no errors at all? checked debugscript IN GAME?