Jump to content

Problems


Jaysds1

Recommended Posts

Is that your server side?? first you must edit it to check if he is an admin

and add it to onPlayerJoin

local admins = {} 
addEventHandler('onPlayerJoin', root, 
function() 
--if the player is admin here 
table.insert(admins, v) 
--end 
end 
) 

Now edit it and check if the player is admin.

Link to comment
  • Replies 365
  • Created
  • Last Reply

Top Posters In This Topic

NO, I just want to know how to do stuff like this, so when I create my new server I don't need help.

Do you think I really want to be on here trying to figure out how to create scripts... i just want to learn and don't come back to this forum, thats all.

Link to comment

Is it possible that a person could spawn on a random team?

Here is my script,

server-side:

  
  
addEvent("Random",true) 
addEventHandler("Random",getRootElement(), 
function() 
    if (source) then 
        setPlayerTeam" class="kw6">setPlayerTeam(source, math.random(teamB, teamS)) 
        if (source) and (teamB) then 
            spawnPlayer(source, x, y, z, 0, math.random(0,288),0, 0) 
            fadeCamera(source, true) 
            setCameraTarget(source, source) 
        elseif (source) and (teamS) then 
            spawnPlayer(source, x, y, z, 0, math.random(0,288),0, 0) 
            fadeCamera(source, true) 
            setCameraTarget(source, source) 
        end 
    end 
end) 
  

Link to comment

LOL math.random? and you are using it with teams variables?

You could make a table with the teams like this

local Teams = { 
[1] = 'First Team Name', 
[2] = 'Second Team Name' 
} 
addEvent("Random",true) 
addEventHandler("Random",getRootElement(), 
function() 
    if (source) then 
        local rand = math.random(1, 2) 
        setPlayerTeam(source, getTeamFromName(Teams[rand])) 
        if (source) and (Teams[rand]) then 
            spawnPlayer(source, x, y, z, 0, math.random(0,288),0, 0) 
            fadeCamera(source, true) 
            setCameraTarget(source, source) 
        end 
    end 
end) 

Link to comment
local Teams = { 
[1] = 'First Team Name', 
[2] = 'Second Team Name' 
} 
addEvent("Random",true) 
addEventHandler("Random",getRootElement(), 
function() 
    if (source) then 
        local rand = math.random(1, 2) 
        if getTeamFromName(Teams[rand]) then 
             setPlayerTeam(source, getTeamFromName(Teams[rand])) 
             spawnPlayer(source, x, y, z, 0, math.random(0,288),0, 0) 
             fadeCamera(source, true) 
             setCameraTarget(source, source) 
        end 
    end 
end) 

Link to comment

How do you send people there password or username to there Email?

I DON'T CARE ANYMORE!

EDIT: as he edited the post, just fyi, this is reference for him saying the same thing when we say his attitude is bad.

Edited by Guest
Link to comment

When a player press Start Match it's suppose to spawnPlayer but the debugscript says that there is a bad Argument, but there isn't a bad argument, plus the random team script that JR10 gave me doesn't work.

Server-side only:

  
  
local Teams = { 
[1] = 'Black OPS', 
[2] = 'Spetsnaz', 
[3] = 'SOG', 
[4] = 'NVA', 
[5] = 'Tropas', 
[6] = 'OP40' 
} 
  
addEvent("Random",true) 
addEventHandler("Random",getRootElement(), 
function() 
    if (client) then 
        local rand = math.random(1, 2, 3, 4, 5, 6) 
        setPlayerTeam(client, getTeamFromName(Teams[rand])) 
        if (client) and (Teams[rand]) then 
            spawnPlayer(client, x, y, z, 0, math.random(0,288),0, 0) 
            fadeCamera(client, true) 
            setCameraTarget(client, client) 
        end 
    end 
end) 
  

Link to comment

Don't double post, use "EDIT".

And you edited my script wrong.

here:

local Teams = { 
[1] = 'Black OPS', 
[2] = 'Spetsnaz', 
[3] = 'SOG', 
[4] = 'NVA', 
[5] = 'Tropas', 
[6] = 'OP40' 
} 
  
addEvent("Random",true) 
addEventHandler("Random",getRootElement(), 
function() 
    if (client) then 
        local rand = math.random(1, 6) 
        if (getTeamFromName(Teams[rand])) then 
            spawnPlayer(client, x, y, z, 0, math.random(0,288),0, 0, getTeamFromName(Teams[rand])) 
            fadeCamera(client, true) 
            setCameraTarget(client, client) 
        end 
    end 
end) 

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