Jump to content

trigger


manve1

Recommended Posts

hey guys, i need help on triggering server side, and making server side, this time however im trying to make alive player system for race DD servers and i couldn't find on on the community

client:

function make() 
label = guiCreateLabel( 0, 0.9525, 1, 1, "ALIVE: " .. getAlivePlayers .. "", true) 
guiSetFont ( label, "sa-header" ) 
guiLabelSetColor ( label, 255, 175, 0 ) 
end 

no server side :( thats the problem + trigger server side

EDIT: i know this code is gonna be again 100% wrong

Link to comment

getAlivePlayers is a server side function.

function getAlivePlayers ( ) 
    local players = { } 
    for _, player in ipairs ( getElementsByType ( "player" ) ) do 
        if ( getElementHealth ( player ) > 0 ) then 
            table.insert ( players, player ) 
        end 
    end 
  
    return players 
end 

function make ( ) 
    label = guiCreateLabel ( 0, 0.9525, 1, 1, "ALIVE: ".. #getAlivePlayers ( ), true ) 
    guiSetFont ( label, "sa-header" ) 
    guiLabelSetColor ( label, 255, 175, 0 ) 
end 

Link to comment
no i even tryied changing position of the label to center of screen still nope

Do you need it to be in function?

Try without function.

label = guiCreateLabel ( 0.5, 0.5, 0.2, 0.5, "ALIVE: ".. #getAlivePlayers ( ), true ) 
guiSetFont ( label, "sa-header" ) 
guiLabelSetColor ( label, 255, 175, 0 ) 

Link to comment
how does it work for you but not me??

http://i.imgur.com/3VoY8.png

P.S. Picture is too big for mta forums, so just click on the link.

could you post client+ server side of yours? cuz i got your bit as client and alive players from solid ( the server side )

You didn't understanding what Solid said.

There no need for server side.

The function that Solid has post it, made to use in client side.

Link to comment

I got other problems now :| i got now so confused :|

meta:


and why i got confused:

mpbe3.png

If you can help me, post meta how should look.

and is i take client out of meta, it gets new error, when i make to 1 script, it gets another error... so i got so confused with this now.

Link to comment

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