Jump to content

setPlayerTeam


Lloyd Logan

Recommended Posts

Posted

Hey, so i made a GUI and when you click "join" it sets you to the team, but its not working!

team = createTeam ( "Bus Driver", 0, 255, 0 )  
  
  
function teamSet(thePlayer, team) 
    setPlayerTeam( thePlayer, team) 
end 
addEvent("sTeam", true) 
addEventHandler("sTeam", thePlayer, teamSet) 

If you need an Intermediate scripter feel free to PM me as I will accept "almost" any job, STATUS: UNAVAILABLE

SCOTLAND, my hometown, and the Home of GTA!

Posted

Change "thePlayer" from addEventHandler to "root".

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
Change "thePlayer" from addEventHandler to "root".

I did that, the db 3 now says,

Bad Arguement @ 'setPlayerTeam'

If you need an Intermediate scripter feel free to PM me as I will accept "almost" any job, STATUS: UNAVAILABLE

SCOTLAND, my hometown, and the Home of GTA!

Posted
createTeam ( "Bus Driver", 0, 255, 0 ) 
      
function teamSet ( ) 
    local team = getTeamFromName ( "Bus Driver" ) 
    if team then 
        setPlayerTeam ( source, team ) 
    end 
end 
addEvent ( "sTeam", true) 
addEventHandler ( "sTeam", root, teamSet ) 

if not working, put your client code.

Posted

It now says, Bad 'player' pointer at @ 'setPlayerTeam'

client

function joinTeam(thePlayer) 
    triggerServerEvent("sTeam", getRootElement(), "teamSet") 
end 

It is triggering it, so i am guessing the problem is Server side? :?:

If you need an Intermediate scripter feel free to PM me as I will accept "almost" any job, STATUS: UNAVAILABLE

SCOTLAND, my hometown, and the Home of GTA!

Posted
function joinTeam() 
    triggerServerEvent("sTeam", localPlayer, "teamSet") 
end 

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
function joinTeam() 
    triggerServerEvent("sTeam", source, "teamSet") 
end 

Will this work with your code, or 3NAD's?

If you need an Intermediate scripter feel free to PM me as I will accept "almost" any job, STATUS: UNAVAILABLE

SCOTLAND, my hometown, and the Home of GTA!

Posted

Still nothing guys!

server

createTeam ("Bus Driver", 0, 255, 0 ) 
  
      
  
function teamSet ( ) 
    local team = getTeamFromName ( "Bus Driver" ) 
    if team then 
        setPlayerTeam ( source, team ) 
    end 
end 
addEvent ( "sTeam", true) 
addEventHandler ( "sTeam", root, teamSet ) 

client

function joinTeam() 
    triggerServerEvent("sTeam", source, "teamSet") 
end 

If you need an Intermediate scripter feel free to PM me as I will accept "almost" any job, STATUS: UNAVAILABLE

SCOTLAND, my hometown, and the Home of GTA!

Posted
At ' triggerServerEvent ', the source is not Defined.

use ' localPlayer '

Atlast!! It works, Thank You!

If you need an Intermediate scripter feel free to PM me as I will accept "almost" any job, STATUS: UNAVAILABLE

SCOTLAND, my hometown, and the Home of GTA!

Posted
At ' triggerServerEvent ', the source is not Defined.

use ' localPlayer '

I put put 'source' by mistake, then I changed it to 'localPlayer', but forum is working really slow.

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
At ' triggerServerEvent ', the source is not Defined.

use ' localPlayer '

I put put 'source' by mistake, then I changed it to 'localPlayer', but forum is working really slow.

No problem, i Saw it

Posted
At ' triggerServerEvent ', the source is not Defined.

use ' localPlayer '

I put put 'source' by mistake, then I changed it to 'localPlayer', but forum is working really slow.

Is that what was happening yesterday? I tried to get on sometimes it would let me and sometimes it would give me a HTTP 500 error. Normally the forums are ultra fast for me because of my connection l, oh well! :)

If you need an Intermediate scripter feel free to PM me as I will accept "almost" any job, STATUS: UNAVAILABLE

SCOTLAND, my hometown, and the Home of GTA!

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