Jump to content

CW Script...Some help please?


Recommended Posts

Posted

Hi! :D 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?

Posted

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 
) 
  

Posted

so i will put a event onClientGUIClick for the buttons :D 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?

Posted
  
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.

Posted

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.

Posted

Made a function for you :P

  
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() 
  

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...