-
Posts
306 -
Joined
-
Last visited
-
Days Won
1
Everything posted by Klesh
-
Yes works fine, thanks a lot castillo and my error was here: if player and player then local damage = 0 if not b and not c then damage = a end local health = math.floor((getElementHealth(player)-250-damage)/750*100) setElementData(player, "Health", health.."%") elseif player then setElementData(player, "Health", "---") end end The Fix: function scoreboardHealthUpdate() if source and getElementType(source) == "player" then local health = math.floor(getElementHealth(source)) setElementData(source, "Health", health.."%") end end
-
Its only in-game the health player have and to know if this is hack or not: Example: I kill someone with Hunter or grenades but i cant see the player with that you see the player health.
-
Yes but is not useless, im making a complete server as you can see, but will be Freeroam like yours. "UFS"
-
Hi to everyone, im doing a health script and this shows the health of the player on the scoreboard but some code is wrong and is not showing, here is the code: Server-Side: addEventHandler("onResourceStart", getResourceRootElement(getThisResource()), function() exports.scoreboard:addScoreboardColumn("Health") end) function scoreboardHealthUpdate(a,b,c) if getElementType(source) == "player" then player = source elseif getElementHealth(source) == "player" then player = getElementHealth(source) end if player and player then local damage = 0 if not b and not c then damage = a end local health = math.floor((getElementHealth(player)-250-damage)/750*100) setElementData(player, "Health", health.."%") elseif player then setElementData(player, "Health", "---") end end addEventHandler("onPlayerDamage", getRootElement(), scoreboardHealthUpdate) addEventHandler("onPlayerSpawn", getRootElement(), scoreboardHealthUpdate) addEventHandler("onPlayerLogin", getRootElement(), scoreboardHealthUpdate) addEventHandler("onPlayerWasted", getRootElement(), scoreboardHealthUpdate)
-
Yes works, but the login button no works, login button only hide the window and the player no log in. Something wrong in the code?
-
Nice Work 50p, like always your scripts help people, i gonna try this, im scripting with GUI, should be great, good job and good luck.
-
Yes i didn't see, but is the same, look this: Try to test, this resource is for MTA: community.
-
I think is not that, i create the window with GUIeditor so the size and coord are good, maybe some value is wrong. Here is the line 3: Server-side: function loginHandler(username,password) end addEvent(submitLogin, true) addEventHandler("submitLogin",root,loginHandler) function loginHandler(username,password) if username == user and password == apple then if (client) then spawnPlayer(client, 1959.55, -1714.46, 10) setCameraTarget(client, client) outputChatBox("You succesfully logged, your stats will be saved.") end else outPutChatBox("Invalid username and password, please re-connect and try again.",client) end end addEvent("submitLogin",true) addEventHandler("submitLogin",root,loginHandler)
-
Showing the cursor and the welcome message works, but the window still not showing.
-
No showing yet, its maybe because i have to add a function with playerJoin or some code is wrong.
-
Being no showing, maybe the error is in the server-side?
-
Hello, im making a simple gui,is Window login GUI but i have problems with the ( " end, ) ") and that nears, maybe have other error from somewhere because the login window is not showing: Client-Side: function createLoginWindow() wdwLogin = guiCreateWindow(787,419,187,323,"Login System by Sparrow",true) lblUser = guiCreateLabel(22,40,142,17,"Username ",true,wdwLogin) lblPass = guiCreateLabel(25,167,127,20,"Password",true,wdwLogin) edtUser = guiCreateEdit(21,71,141,32,"",true,wdwLogin) edtPass = guiCreateEdit(23,202,141,32,"",true,wdwLogin) guiEditSetMaxLength(edtUser, 50) guiEditSetMaxLength(edtPass, 50) btnLogin = guiCreateButton(31,263,133,41,"Login",true,wdwLogin) guiSetFont(btnLogin,"sa-header") guiSetVisible(wdwLogin, true) addEventHandler("onClientResourceStart", getResourceRootElement(getThisResouce()), function () createLoginWindow() outPutChatBox("Welcome to MTA:SA Server, please log in.") if (wdwLogin ~= nil) then guiSetVisible (wdwLogin ,true) else outPutChatBox("An unexpected error was ocurred and the log in Window was not created") end showCursor(true) guiSetInputEnbled(true) end ) function createLoginWindow () addEventHandler("onClientGUIClick", btnLogin, clientSubmitLogin, false) end function clientSubmitLogin (button,state) if button == "left" and state =="up" then guiSetInputEnabled(false) guiSetVisible(wdwLogin, false) showCursor(false) end end function clientSubmitLogin (button,state) if button =="left" and state == "up" then local username = getGuiText(edtUser) local password =getGuiText(edtPass) if username and password then triggerServerEvent("submitLogin", getRootElement (), username, password) guiSetInputEnable(false) guiSetVisible(wdwLogin, false) else outputChatBox("Please enter a username and password") end end end Thanks for any help.
-
Maybe in the MTA 1.1 you can, i think so. You must wait, take it easy.
-
Thanks is fixed! But i need to know what error was have in the script!
-
Yes i used, but i can see the errors if it have, i test the debug and nothing and as you can see i put a picture before your post your code, with your code, maybe is my pc or the sscript is not build correctly, but thanks i need a little hhelp with this.
-
Being no showing the players online: No warnins or Errors found with debugscript 3. I try to follow the code of wiki.mta: function clientsideResourceStart () local playerList = guiCreateGridList ( 0.80, 0.10, 0.15, 0.60, true ) -- Create the grid list local column = guiGridListAddColumn( playerList, "Player", 0.85 ) -- Create a 'players' column in the list if ( column ) then -- If the column was successfully created for id, playeritem in ipairs(getElementsByType("player")) do --Loop through all the players, adding them to the table local row = guiGridListAddRow ( playerList ) guiGridListSetItemText ( playerList, row, column, getPlayerName ( playeritem ), false, false ) end end end addEventHandler ( "onClientResourceStart", getRootElement(), clientsideResourceStart )] I see this here
-
Wrong Topic, move this to Scripting Topic.
-
Not Works, is only showing the players Column but not the players are currently playing in the server. Uploaded with ImageShack.us
-
Hi community of MTA:SA, i make a script and this shows what players are in the server (starting GUI Scripting "Testing Scripts") and in the following code the players not showing in the list or gridlist: Client-Side: Player_Window = guiCreateWindow(22,226,189,359,"Players List by Sparrow",false) local Player_Grid = guiCreateGridList(16,57,156,288,false,Player_Window) guiGridListAddColumn(Player_Grid,"Player",0.2) guiGridListSetSelectionMode(Player_Grid,2) Hide_Button = guiCreateButton(38,23,116,26,"<Hide Window>",false,Player_Window) addCommandHandler("players", function () guiSetVisible(Player_Window, true) showCursor(true, false) end, false) addEventHandler("onClientGUIClick", Hide_Button, function (button) if (button == "left") then guiSetVisible(Player_Window, false) showCursor(false) end end, false) showCursor(true) function show() local column = guiGridListAddColumn(Player_Grid,"Player",0.2) if ( column ) then --If the column has been created, fill it with players for id, player in ipairs(getElementsByType("player")) do local row = guiGridListAddRow ( Player_Grid ) guiGridListSetItemText ( Player_Grid, row, column, getPlayerName ( player ), false, false ) end end end function Show() local player = guiGridListGetItemText (Player_Grid, guiGridListGetSelectedItem (Player_Grid), 1) end
-
And the edit bar too, the size are not the same and maybe the panel need something more, for example getPlayerName.
-
The answer you want can be here.
-
function BrokenLightsDesligarBlip (thePlayerOrVehicle, matchingDimension) if ( (getVehicleLightState ( thePlayerOrVehicle, 0 ) == 1) and (getVehicleLightState ( thePlayerOrVehicle, 1 ) == 1) ) then destroyElement (blip) end end addEventHandler ( "onColShapeLeave", getRootElement(),BrokenLightsBlip ) 1- Function is Created? I dind't see the function is being created, but you can created. 2- Another think, you must to put the script in english, is for help you, the scripters can understand what you want.
-
I Already fixed Thanks to all community.
-
I try to do a new one, but the GUI Not Open. helpSystemPanelWindow = guiCreateWindow(302,145,397,459,"Help System by Klesh",false) UnknowTab = guiCreateTabPanel(27,43,347,368,false,helpSystemPanelWindow) ServerInfoTab = guiCreateTab("Server Information",UnknowTab) OwnerLabelServerInfo = guiCreateLabel(16,27,169,27,"Owner :",false,ServerInfoTab) guiLabelSetColor(OwnerLabelServerInfo,0,247,255) KleshLabelServerInfo = guiCreateLabel(16,65,169,27,"- Klesh",false,ServerInfoTab) LeadersLabelServerInfo = guiCreateLabel(17,113,169,27,"Leaders :",false,ServerInfoTab) localPlayer = getLocalPlayer() guiLabelSetColor(LeadersLabelServerInfo,0,247,255) LeadersKleshLabelServerInfo = guiCreateLabel(17,154,169,27,"- Klesh",false,ServerInfoTab) LeadersPr1vat3LabelServerInfo = guiCreateLabel(18,187,169,27,"- Pr1v4t3",false,ServerInfoTab) JoinLabelServerInfo = guiCreateLabel(18,226,169,27,"Join by an invitation is open.",false,ServerInfoTab) guiLabelSetColor(JoinLabelServerInfo,0,247,255) ClanWebLabelServerInfo = guiCreateLabel(18,266,189,25,"Clan Web Site is in construction.",false,ServerInfoTab) guiLabelSetColor(ClanWebLabelServerInfo,0,247,255) GeneralRulesTab = guiCreateTab("General Rules",UnknowTab) RulesLabelGeneralRules = guiCreateLabel(14,21,156,28,"Rules",false,GeneralRulesTab) guiLabelSetColor(RulesLabelGeneralRules,0,247,255) guiSetFont(RulesLabelGeneralRules,"default-bold-small") RespectLabelGeneralRules = guiCreateLabel(15,71,323,21,"- Respect other players.",false,GeneralRulesTab) DontLabelGeneralRules = guiCreateLabel(15,106,323,21,"- Don't ask how to be an admin.",false,GeneralRulesTab) SpamLabelGeneralRules = guiCreateLabel(16,142,323,21,"- Spam or Flood in the chat can get a mute.",false,GeneralRulesTab) CheatLabelGeneralRules = guiCreateLabel(16,176,323,21,"- Cheat is not allowed in this server.",false,GeneralRulesTab) UseLabelGeneralRules = guiCreateLabel(16,210,323,21,"- Use the /report system i've you spotted a hacker.",false,GeneralRulesTab) OnlyLabelGeneralRules = guiCreateLabel(16,243,323,21,"- Only can enter on the clan with an invitation.",false,GeneralRulesTab) CommandsTab = guiCreateTab("Commands",UnknowTab) MeCommandsLabel = guiCreateLabel(18,22,131,23,"Me Commands",false,CommandsTab) guiLabelSetColor(MeCommandsLabel,0,247,255) HiLabelCommands = guiCreateLabel(16,67,303,23,"/hi : Hi to Everyone!",false,CommandsTab) ByeLabelCommands = guiCreateLabel(15,105,303,23,"/bb : Bye Bye to Everyone!",false,CommandsTab) wbLabelCommands = guiCreateLabel(15,140,303,23,"/wb : Welcome Back!!",false,CommandsTab) tytLabelCommands = guiCreateLabel(14,174,303,23,"/tyt : Thank you too!",false,CommandsTab) ggLabelCommands = guiCreateLabel(13,212,303,23,"/gg : Good Game!",false,CommandsTab) tyLabelCommand = guiCreateLabel(13,248,303,23,"/ty : Thank you!",false,CommandsTab) lmLabelCommands = guiCreateLabel(11,284,303,23,"/lm : This will be my last map!",false,CommandsTab) AcceptRulesButton = guiCreateButton(95,423,209,24,"I accept with the rules",false,helpSystemPanelWindow) function onresourceStart () bindKey ("F9", "down", helpSystemPanelWindow) end addEventHandler("onClientResourceStart", getResourceRootElement(getThisResource()), onresourceStart) function showhelpSystemPanelWindow () getVisible = guiGetVisible (helpSystemPanelWindow) if (getVisible == true) then guiSetVisible (helpSystemPanelWindow, false) showCursor (false) end if (getVisible == false) then guiSetVisible (helpSystemPanelWindow, true) showCursor (true) end addEventHandler("onClientResourceStart", getResourceRootElement( getThisResource() ), function() addEventHandler("onClientPlayerJoin", getRootElement(), updateplayersList) outputChatBox("Resource Helpgui v0.1 Started! press F9 to use it!",0,255,0) outputChatBox("Author: Klesh",255,255,0) end )
-
I have this code: addEventHandler("onClientResourceStart",resourceRoot, ServerRulesWindow = guiCreateWindow(272,134,521,480,"Server Rules by Klesh",false) GUIEditor_TabPanel[1] = guiCreateTabPanel(52,76,424,339,false,ServerRulesWindow) GUIEditor_Tab[1] = guiCreateTab("Information Server",GUIEditor_TabPanel[1]) GUIEditor_Label[1] = guiCreateLabel(18,32,183,23,"CSS Owner :",false,GUIEditor_Tab[1]) guiLabelSetColor(GUIEditor_Label[1],0,247,255) GUIEditor_Label[2] = guiCreateLabel(18,69,114,25,"- Klesh",false,GUIEditor_Tab[1]) GUIEditor_Label[3] = guiCreateLabel(18,107,114,25,"CSS Leaders :",false,GUIEditor_Tab[1]) guiLabelSetColor(GUIEditor_Label[3],0,247,255) GUIEditor_Label[4] = guiCreateLabel(19,147,114,25,"- Klesh",false,GUIEditor_Tab[1]) GUIEditor_Label[5] = guiCreateLabel(19,180,114,25,"- Pr1v4t3",false,GUIEditor_Tab[1]) GUIEditor_Label[6] = guiCreateLabel(19,216,114,25,"Web Site :",false,GUIEditor_Tab[1]) guiLabelSetColor(GUIEditor_Label[6],0,247,255) GUIEditor_Label[7] = guiCreateLabel(114,214,261,20,"\"The Web Site of the Clan is on Construccion.\"",false,GUIEditor_Tab[1]) guiLabelSetColor(GUIEditor_Label[7],255,0,0) GUIEditor_Label[8] = guiCreateLabel(20,263,375,22,"The join is open, only with an invitation!",false,GUIEditor_Tab[1]) guiLabelSetColor(GUIEditor_Label[8],255,0,0) GUIEditor_Tab[2] = guiCreateTab("General Rules",GUIEditor_TabPanel[1]) GUIEditor_Label[9] = guiCreateLabel(12,18,166,26,"Server Rules",false,GUIEditor_Tab[2]) guiLabelSetColor(GUIEditor_Label[9],255,0,0) guiSetFont(GUIEditor_Label[9],"default-bold-small") GUIEditor_Label[10] = guiCreateLabel(10,56,166,26,"- Respect other players.",false,GUIEditor_Tab[2]) GUIEditor_Label[11] = guiCreateLabel(9,91,192,22,"- Don't ask how to be an admin.",false,GUIEditor_Tab[2]) GUIEditor_Label[12] = guiCreateLabel(8,124,265,19,"- Only you can enter on the with an invitation.",false,GUIEditor_Tab[2]) GUIEditor_Label[13] = guiCreateLabel(9,158,283,19,"- The spam or flood in the chat can get muted.",false,GUIEditor_Tab[2]) GUIEditor_Label[14] = guiCreateLabel(9,193,283,19,"- The Cheats are not allowed in this server.",false,GUIEditor_Tab[2]) GUIEditor_Label[15] = guiCreateLabel(8,228,283,19,"- Use the report system if you spotted a hacker.",false,GUIEditor_Tab[2]) GUIEditor_Tab[3] = guiCreateTab("Commands",GUIEditor_TabPanel[1]) GUIEditor_Label[16] = guiCreateLabel(16,22,102,24,"Me Commands :",false,GUIEditor_Tab[3]) guiLabelSetColor(GUIEditor_Label[16],0,247,255) GUIEditor_Label[17] = guiCreateLabel(16,69,399,20,"- /hi : Hi to Everybody",false,GUIEditor_Tab[3]) GUIEditor_Label[18] = guiCreateLabel(14,98,399,20,"- /bb : Bye Bye to Everybody",false,GUIEditor_Tab[3]) GUIEditor_Label[19] = guiCreateLabel(13,129,399,20,"- /brb : Will be right Back!",false,GUIEditor_Tab[3]) GUIEditor_Label[20] = guiCreateLabel(13,159,399,20,"- /tyt : Thank you too!!",false,GUIEditor_Tab[3]) GUIEditor_Label[21] = guiCreateLabel(12,192,399,20,"- /ty : Thanks to you!!",false,GUIEditor_Tab[3]) GUIEditor_Label[22] = guiCreateLabel(12,224,399,20,"- /gg : Good Game!",false,GUIEditor_Tab[3]) GUIEditor_Label[23] = guiCreateLabel(11,256,399,20,"The constant abuse of the commands can get ban.",false,GUIEditor_Tab[3]) guiLabelSetColor(GUIEditor_Label[23],0,247,255) AcceptButtom = guiCreateButton(148,430,224,30,"I Accept with The Rules",false,ServerRulesWindow) PlayerNameLabel = guiCreateLabel(143,39,236,18,"Welcome to CSS Window Help.",false,ServerRulesWindow) guiLabelSetColor(PlayerNameLabel,0,247,255) guiLabelSetHorizontalAlign(PlayerNameLabel,"center",false) guiSetFont(PlayerNameLabel,"clear-normal") function onresourceStart () bindKey ("F9", "down", ServerRulesWindow) end addEventHandler("onClientResourceStart", getResourceRootElement(getThisResource()), onresourceStart) function ServerRulesWindow () getVisible = guiGetVisible (ServerRulesWindow) playerName = getPlayerName ( getLocalPlayer() ) if (getVisible == true) then guiSetVisible (ServerRulesWindow, false) showCursor (false) end if (getVisible == false) then guiSetVisible (ServerRulesWindow, true) showCursor (true) local playerName = getPlayerName ( getLocalPlayerName() ) guiSetText ( PlayerNameLabel, "Welcome to CSS Window Help: [ " .. playerName .. " ]" ) end end ) client-side Why dont open the GUI with f9?
