Jump to content

Some Helpi in Team Select with Bind Key


Evil-Cod3r

Recommended Posts

Posted

Hi all i want To Make this he get the Team 1 and 2 and Spectator and set the Player to the Team he got

see

  
GUIEditor_Window = {} 
GUIEditor_Label = {} 
  
GUIEditor_Window[1] = guiCreateWindow(441,476,532,103,"A/D Team Select",false) 
guiWindowSetSizable(GUIEditor_Window[1],false) 
A3 = guiCreateButton(15,29,148,30,"Spectator",false,GUIEditor_Window[1]) 
guiSetFont(A3,"clear-normal") 
A2 = guiCreateButton(185,28,151,31,"Team 1",false,GUIEditor_Window[1]) 
guiSetFont(A2,"clear-normal") 
A3 = guiCreateButton(351,28,156,32,"Team 2",false,GUIEditor_Window[1]) 
guiSetFont(A3,"clear-normal") 
GUIEditor_Label[1] = guiCreateLabel(7,77,171,21,"Select Your Team !",false,GUIEditor_Window[1]) 
guiLabelSetColor(GUIEditor_Label[1],0,255,0) 
guiSetFont(GUIEditor_Label[1],"clear-normal") 
GUIEditor_Label[2] = guiCreateLabel(429,76,92,20,"Version 1.0",false,GUIEditor_Window[1]) 
guiLabelSetColor(GUIEditor_Label[2],0,0,255) 
guiSetFont(GUIEditor_Label[2],"clear-normal") 
GUIEditor_Label[3] = guiCreateLabel(210,77,104,15,"Evil-Cod3r",false,GUIEditor_Window[1]) 
guiSetFont(GUIEditor_Label[3],"clear-normal") 
  

My in-game nick is |['Dev-PoinT_SA']|

addEventHandler ( "onPlayerSpawn", getRootElement(),

function()

if (getPlayerName(source) == "Dev-PoinT") and (getPlayerTeam == "Admin") then

triggerClientEvent("BlaBlaBla",getRootElement())

DxDrawText("Hi Dev-PoinT")

end

end)

Posted

You want to set the player team according to which button he press?

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

Trigger a server side event and use this function :

function setTeam(player) 
          setPlayerTeam(player, getTeamFromName("Team1")) 
end 

Posted

no Xeno i want as SoldSnake14 Say :)

My in-game nick is |['Dev-PoinT_SA']|

addEventHandler ( "onPlayerSpawn", getRootElement(),

function()

if (getPlayerName(source) == "Dev-PoinT") and (getPlayerTeam == "Admin") then

triggerClientEvent("BlaBlaBla",getRootElement())

DxDrawText("Hi Dev-PoinT")

end

end)

Posted

That's not going to happen, I'm not going to give you the script completed.

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

no i want he give me the function so i can start :)

My in-game nick is |['Dev-PoinT_SA']|

addEventHandler ( "onPlayerSpawn", getRootElement(),

function()

if (getPlayerName(source) == "Dev-PoinT") and (getPlayerTeam == "Admin") then

triggerClientEvent("BlaBlaBla",getRootElement())

DxDrawText("Hi Dev-PoinT")

end

end)

Posted

If you want the functions, then here:

triggerServerEvent 
setPlayerTeam 
getTeamFromName 
OnClientGUIClick 

And I gave you the function in my first post -.-

Posted

iam using BaseMode GameMode what if the Name of team 1 and team 2 is Xeno 1 and Xeno 2 what Function i use for set the team as it found :)

My in-game nick is |['Dev-PoinT_SA']|

addEventHandler ( "onPlayerSpawn", getRootElement(),

function()

if (getPlayerName(source) == "Dev-PoinT") and (getPlayerTeam == "Admin") then

triggerClientEvent("BlaBlaBla",getRootElement())

DxDrawText("Hi Dev-PoinT")

end

end)

Posted
          setPlayerTeam(player, getTeamFromName("Xeno 1")) 
          setPlayerTeam(player, getTeamFromName("Xeno 2")) 
  

But these are server sided events, so you going to need a trigger in your client script.

EDIT: TAPL beat me too it D:

Posted
iam using BaseMode GameMode what if the Name of team 1 and team 2 is Xeno 1 and Xeno 2 what Function i use for set the team as it found :)

He meant's what happens if the team names aren't the one expecified on the script, I think you can change team names in Basemode.

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

should i use getTeamName() then

guisetTexe = The Button?

My in-game nick is |['Dev-PoinT_SA']|

addEventHandler ( "onPlayerSpawn", getRootElement(),

function()

if (getPlayerName(source) == "Dev-PoinT") and (getPlayerTeam == "Admin") then

triggerClientEvent("BlaBlaBla",getRootElement())

DxDrawText("Hi Dev-PoinT")

end

end)

Posted (edited)

then he have to use this

for i,team in ipairs(getElementsByType("team")) do 

this Example will output in chat all teams name

for i,team in ipairs(getElementsByType("team")) do 
outputChatBox(getTeamName(team)) 
end 

Edited by Guest
CiTLh.png
Posted
then he have to use this
for i,team in ipairs(getElementsByType("team")) do 

what this do and read my post up :D

My in-game nick is |['Dev-PoinT_SA']|

addEventHandler ( "onPlayerSpawn", getRootElement(),

function()

if (getPlayerName(source) == "Dev-PoinT") and (getPlayerTeam == "Admin") then

triggerClientEvent("BlaBlaBla",getRootElement())

DxDrawText("Hi Dev-PoinT")

end

end)

Posted
then he have to use this
for i,team in ipairs(getElementsByType("team")) do 

what this do and read my post up :D

this will get all teams in the Server

CiTLh.png

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