Jump to content

Help with code


novo

Recommended Posts

Hi all.

I want make a command for setMaxPlayers :D

Here's my code:

function ( playerSource, commandName ) 
            numbermax = getMaxPlayers () 
  
            if not col2 then col2 = numbermax end 
  
            -- Set the vehicle's color 
            setMaxPlayers(numbermax) 
        end 
    end 
end 
addCommandHandler ( "setmax", ) 

My command is /setmax but i don't know to do /setmax option.

I don't know to fix that code.

PLZ HELP ME <3

Link to comment
Qué no entiendes?

No te pongas rudo conmigo, que yo trato de ayudarte DE OTRA MANERA.

TAPL, will he learn ANYTHING from that code? Did you make any comment for him?

(yet another user that will copy + paste, say thanks, come back asking for help, and the cycle repeats)

Link to comment

en vez de

setMaxPlayers ( numbermax )

pone

setMaxPlayers ( tonumber (numbermax) )

Cuando dices a setMaxPlayers que use "numbermax", le dices que ocupe UN TEXTO para la cantidad de jugadores, lo cual no tiene sentido. tonumber convierte el texto a un número y así lo hace funcionar :P

(BTW can anyone pls move this to Spanish subforum, ty)

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