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.

Business System viewtopic.php?f=108&t=35797

Notepad++ Syntax Highlighting & Auto Completion viewtopic.php?f=91&t=76726

SQLite Tutorial viewtopic.php?f=148&t=38203

  • Replies 365
  • Created
  • Last Reply

Top Posters In This Topic

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.

My in-game name: Jaysds1

Retired CMG Scripter

World Of Tanks GameMode (Open-Source): https://github.com/Jaysds1/mtasa-wot-gamemode

Online GUI-Editor (WIP): https://forum.mtasa.com/topic/47678-online-gui-editor/

 

sE5Qm.png

TiV3C.png

img.php?id=0&text=Lua%20Scripter

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) 
  

My in-game name: Jaysds1

Retired CMG Scripter

World Of Tanks GameMode (Open-Source): https://github.com/Jaysds1/mtasa-wot-gamemode

Online GUI-Editor (WIP): https://forum.mtasa.com/topic/47678-online-gui-editor/

 

sE5Qm.png

TiV3C.png

img.php?id=0&text=Lua%20Scripter

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) 

Business System viewtopic.php?f=108&t=35797

Notepad++ Syntax Highlighting & Auto Completion viewtopic.php?f=91&t=76726

SQLite Tutorial viewtopic.php?f=148&t=38203

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) 

Business System viewtopic.php?f=108&t=35797

Notepad++ Syntax Highlighting & Auto Completion viewtopic.php?f=91&t=76726

SQLite Tutorial viewtopic.php?f=148&t=38203

Posted

BTW, dont double post, and i think your pissing everyone off with your non sense questions, Attitude and your demanding mind set...

Founder of SAUR - Founder/Owner of ARC RPG

Posted

I would say you need to use callRemote (if it's possible to) and PHP knowledge.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

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?

Founder of SAUR - Founder/Owner of ARC RPG

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) 
  

My in-game name: Jaysds1

Retired CMG Scripter

World Of Tanks GameMode (Open-Source): https://github.com/Jaysds1/mtasa-wot-gamemode

Online GUI-Editor (WIP): https://forum.mtasa.com/topic/47678-online-gui-editor/

 

sE5Qm.png

TiV3C.png

img.php?id=0&text=Lua%20Scripter

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) 

Business System viewtopic.php?f=108&t=35797

Notepad++ Syntax Highlighting & Auto Completion viewtopic.php?f=91&t=76726

SQLite Tutorial viewtopic.php?f=148&t=38203

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