Jump to content

Problems


Jaysds1

Recommended Posts

Posted

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.

  • Replies 365
  • Created
  • Last Reply

Top Posters In This Topic

Posted

Don't add it without editting it don't just copy paste if you looked at it you would have watched the comment edit it to check if the player is admin.

Posted

Looks like again you just copied it and paste, you should edit it and you should look at the code someone is giving you.

Posted

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.

Posted

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) 
  

Posted

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) 

Posted

I have a problem with this resource I created, When I start the resource it keeps kicking people out of the server and says that the client-side lua doesn't work.

How do I make this resource work?

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

Posted (edited)

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
Posted
karlis, Were all friends here trying to help each other, come on,

And Castillo Thanks.

LOL??? You dont help anyone? You just give answers like LOL? or YA ill send ya?

Posted

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) 
  

Posted

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) 

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