MisterQuestions Posted August 30, 2014 Share Posted August 30, 2014 Hi! on this time im creating a CW Script...And i need some help, like in the cw admin panel, they are 2 boxes for the teams, and 2 for the color.So you should put the names Like: TeamBox1 = TeamName1 ColorBox1= #ff9e00 How to make when you click on set, creates the teams with the color? Link to comment
MisterQuestions Posted August 31, 2014 Author Share Posted August 31, 2014 Mmm a question...how to send the text of the editbox to the server side to create the team Link to comment
MisterQuestions Posted August 31, 2014 Author Share Posted August 31, 2014 Mmm a question...how to send the text of the editbox to the server side to create the team Link to comment
Anubhav Posted August 31, 2014 Share Posted August 31, 2014 Client: - Remember to attach a event handler ( onClientGUIClick maybe? ) function someFunc() local edit = guiGetText(editBoxName) if edit == "" then return end triggerServerEvent("createMyTeam", localPlayer, edit) end Server: addEvent("createMyTeam", true) addEventHandler("createMyTeam", root, function(team) createTeam(team) end ) Link to comment
MisterQuestions Posted August 31, 2014 Author Share Posted August 31, 2014 so i will put a event onClientGUIClick for the buttons and its possible to make that on a dxText set the color from a editbox? Like i have created a editbox for the color, how i should use it to when i click set getText and aply color to the dxDrawed Text? Link to comment
Anubhav Posted August 31, 2014 Share Posted August 31, 2014 local r,g,b,a = 255, 255, 255, 255 addEventHandler('onClientRender', root, function() dxDrawText ( playerZoneName, 44, screenHeight - 41, screenWidth, screenHeight, tocolor ( r, g, b, a ), 1.02, "pricedown" ) end r,g,b,a = 255, 0, 255, 200 ) Do something like this. Link to comment
MisterQuestions Posted August 31, 2014 Author Share Posted August 31, 2014 And from html?? Link to comment
Anubhav Posted August 31, 2014 Share Posted August 31, 2014 And from html?? Use PHP_SDK. Link to comment
MisterQuestions Posted August 31, 2014 Author Share Posted August 31, 2014 No i refer from htm color code like "ff0000" how to make when i click set it update the dxText color? Link to comment
'LinKin Posted August 31, 2014 Share Posted August 31, 2014 Use variables outside the onClientRender event For example; local r, g, b = 255, 255, 255 And in the function when you click 'set' you change those variables' values. Link to comment
MisterQuestions Posted August 31, 2014 Author Share Posted August 31, 2014 And last...how to keep update the alive playes on the team?? Link to comment
Anubhav Posted August 31, 2014 Share Posted August 31, 2014 What do you mean by update them? Link to comment
MisterQuestions Posted August 31, 2014 Author Share Posted August 31, 2014 yes like when next map starts, get alive players in team, and if one dies update the alive players on team text Link to comment
Anubhav Posted August 31, 2014 Share Posted August 31, 2014 https://wiki.multitheftauto.com/wiki/Ge ... yersInTeam ( use full function ) and use spawnPlayer Link to comment
MisterQuestions Posted August 31, 2014 Author Share Posted August 31, 2014 no, i refer when a player die's update the alive players in team Link to comment
Anubhav Posted August 31, 2014 Share Posted August 31, 2014 Made a function for you function getDeadPlayersInTeam(theTeam) local theTable = { } local players = getPlayersInTeam(theTeam) for i,v in pairs(players) do if isPedDead(v) then theTable[#theTable+1]=v end end return theTable end -- I modified a function from MTA;SA wiki. use this also; spawnPlayer() Link to comment
Et-win Posted September 1, 2014 Share Posted September 1, 2014 on(Client)PlayerWasted Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now