Jump to content

How put password in teams?


tootao123

Recommended Posts

i put this code work and not spawn

addEventHandler( 'onClientGUIClick', button_Open,

function()

if guiGetText( passwordEditField ) == 'somePassword' then

triggerServerEvent( 'openDoor', getLocalPlayer() ); --open your door if password is correct

else

outputChatBox( 'Incorrect password' );

end;

end

, false );

?

Link to comment

i put this code work and not spawn

addEventHandler( 'onClientGUIClick', button_Open,

function()

if guiGetText( passwordEditField ) == 'somePassword' then

triggerServerEvent( 'openDoor', getLocalPlayer() ); --open your door if password is correct

else

outputChatBox( 'Incorrect password' );

end;

end

, false );

?

Link to comment

i not see the if the password is correct

add my msn [email protected] or make this :

if teamSelection == "Tunestars" then
 setPlayerTeam ( source, teamTune )
       local x,y,z
       x = -1952
       y = 280
       z = 35
         spawnPlayer ( source, x,y,z  ) 
       fadeCamera(source, true)
 giveWeapon ( source, 1, 1 )
 giveWeapon ( source, 4, 1 )
 giveWeapon ( source, 24, 500 )
 giveWeapon ( source, 28, 500 )
 giveWeapon ( source, 31, 500 )
 giveWeapon ( source, 41, 1000 )
 giveWeapon ( source, 39, 50 )
setElementHealth ( source, 100 )
 setPlayerNametagColor ( source, 0,100,255 )
         setPedSkin ( source, math.random(46,48) )
  setPedArmor ( source, 100 )
   playSoundFrontEnd ( source, 45 )
setTime ( hour, mins+1 )
end

Link to comment

i not see the if the password is correct

add my msn [email protected] or make this :

if teamSelection == "Tunestars" then  setPlayerTeam ( source, teamTune )        local x,y,z        x = -1952        y = 280        z = 35          spawnPlayer ( source, x,y,z  )         fadeCamera(source, true)  giveWeapon ( source, 1, 1 )  giveWeapon ( source, 4, 1 )  giveWeapon ( source, 24, 500 )  giveWeapon ( source, 28, 500 )  giveWeapon ( source, 31, 500 )  giveWeapon ( source, 41, 1000 )  giveWeapon ( source, 39, 50 ) setElementHealth ( source, 100 )  setPlayerNametagColor ( source, 0,100,255 )          setPedSkin ( source, math.random(46,48) )	  setPedArmor ( source, 100 )    playSoundFrontEnd ( source, 45 ) setTime ( hour, mins+1 )end

Link to comment

I don't understand your script and you haven't told us how it must work so I edited it by my self.

Server-side

teamTune = createTeam("Tunestars",r,g,b) -- edit this
function tuneTeam ()
setPlayerTeam ( source, teamTune )
local x,y,z
local x = -1952
local y = 280
local z = 35
spawnPlayer ( source, x,y,z  ) 
fadeCamera(source, true)
giveWeapon ( source, 1, 1 )
giveWeapon ( source, 4, 1 )
giveWeapon ( source, 24, 500 )
giveWeapon ( source, 28, 500 )
giveWeapon ( source, 31, 500 )
giveWeapon ( source, 41, 1000 )
giveWeapon ( source, 39, 50 )
setElementHealth ( source, 100 )
setPlayerNametagColor ( source, 0,100,255 )
setPedSkin ( source, math.random(46,48) )
setPedArmor ( source, 100 )
playSoundFrontEnd ( source, 45 )
setTime ( hour, mins+1 )
end
addEvent("setTeamTune", true)
addEventHandler("setTeamTune", getRootElement(), tuneTeam)

Client-side

function teamWithPassword()
-- create some gui elements window, button and edit window
addEventHandler("onClientGUIClick", submitButton,
function ()
local elText = guiGetText(edit_label)
if (elText == "passwordForTuneTeam") then
triggerServerEvent("setTeamTune", getLocalPlayer())
else 
outputChatBox("The password is incorrect")
end
end)

Link to comment

well im gonna show u how must work this,

client-side

if campos =="Tunestars" then
guiSetText(weapon1,"Weapons:")
guiSetText(weapon2,"Brass Knuckles")
guiSetText(weapon3,"Knife")
guiSetText(weapon4,"Deagle")
guiSetText(weapon5,"Uzi")
guiSetText(weapon6,"M4")
guiSetText(weapon7,"Spraycan")
guiSetText(weapon8,"Stachel Charges")
guiSetText(weapon9,"")
guiSetText(info,"")
setTimer ( guiStaticImageLoadImage, 500, 1, picture, "skins/tune.png" )
	theta = rad(50)
distance = 20
x,y,z = 2201.7375488281, 1392.9350585938, 10.8203125
end

server-side

if teamSelection == "Tunestars" then
setPlayerTeam ( source, teamTune )
local x,y,z
       x = 2201.7375488281
       y = 1392.9350585938
       z = 10.8203125
spawnPlayer ( source, x,y,z  ) 
fadeCamera(source, true)
giveWeapon ( source, 1, 1 )
giveWeapon ( source, 4, 1 )
giveWeapon ( source, 24, 500 )
giveWeapon ( source, 28, 500 )
giveWeapon ( source, 31, 500 )
giveWeapon ( source, 41, 1000 )
setElementHealth ( source, 100 )
setPlayerNametagColor ( source, 0,100,255 )
setPedSkin ( source, math.random(46,48) )
playSoundFrontEnd ( source, 45 )
setTime ( hour, mins+1 )
end

this is on scoreboard

teamTune 	= createTeam ( "Tunestars", 255,255,15 )

local teams = {
"Tunestars",

if im right this must be.

Link to comment

if i'm right is this :

if teamSelection == "Tunestars" then
 
     teamTune = createTeam("Tunestars",r,g,b) -- edit this
 
     function tuneTeam ()
 
       setPlayerTeam ( source, teamTune )
 
             local x,y,z
 
            local x = -1952
 
           local y = 280
 
            local z = 35
 
               spawnPlayer ( source, x,y,z  )
 
             fadeCamera(source, true)
 
       giveWeapon ( source, 1, 1 )
 
       giveWeapon ( source, 4, 1 )
 
       giveWeapon ( source, 24, 500 )
 
       giveWeapon ( source, 28, 500 )
 
       giveWeapon ( source, 31, 500 )
 
       giveWeapon ( source, 41, 1000 )
 
       giveWeapon ( source, 39, 50 )
 
     setElementHealth ( source, 100 )
 
       setPlayerNametagColor ( source, 0,100,255 )
 
               setPedSkin ( source, math.random(46,48) )
 
          setPedArmor ( source, 100 )
 
         playSoundFrontEnd ( source, 45 )
 
     setTime ( hour, mins+1 )
 
     end

the team for put and spawn ?

Link to comment

not work

i put in teams.lua and not work

when i start server appear incorrect value addEventHandler'

if teamSelection == "Tunestars" then
 setPlayerTeam ( source, teamTune )
       local x,y,z
       x = -1952
       y = 280
       z = 35
         spawnPlayer ( source, x,y,z  ) 
       fadeCamera(source, true)
 giveWeapon ( source, 1, 1 )
 giveWeapon ( source, 4, 1 )
 giveWeapon ( source, 24, 500 )
 giveWeapon ( source, 28, 500 )
 giveWeapon ( source, 31, 500 )
 giveWeapon ( source, 41, 1000 )
 giveWeapon ( source, 39, 50 )
setElementHealth ( source, 100 )
 setPlayerNametagColor ( source, 0,100,255 )
         setPedSkin ( source, math.random(46,48) )
  setPedArmor ( source, 100 )
   playSoundFrontEnd ( source, 45 )
setTime ( hour, mins+1 )
end
function teamWithPassword()
 
    GUIEditor_Window = {}
GUIEditor_Button = {}
GUIEditor_Edit = {}
 
GUIEditor_Window[1] = guiCreateWindow(330,248,179,63,"Password",false)
guiWindowSetMovable(GUIEditor_Window[1],false)
GUIEditor_Edit[1] = guiCreateEdit(9,25,133,27,"",false,GUIEditor_Window[1])
GUIEditor_Button[1] = guiCreateButton(145,24,23,27,"GO",false,GUIEditor_Window[1])
GUIEditor_Button[2] = guiCreateButton(9,-133,26,63,"",false,GUIEditor_Window[1])
 
        addEventHandler("onClientGUIClick", submitButton,
 
             function ()
 
                    local elText = guiGetText(edit_label)
 
                     if (elText == "passwordfortuneteam") then
 
                        triggerServerEvent("setTeamTune", getLocalPlayer())
 
                     else
 
                           outputChatBox("The password is incorrect")
 
              end

Link to comment

Get attention where i posted script and i wrote that the script is server side and client side. And make them in two different lua files and make them client side and server side in meta.xml file. Like this

<meta>
<info author="Someguy" description="Counterstrike remake" type="gamemode" />
<script src="buymenu.lua" type="client" />
       <script src="server.lua" type="server" />
</meta>

Link to comment

Hi guys, i see someone its doing big problems here that part its a part of a game mode so if u dont have the other parts the game mode wont work i already tested this client-side and server-side alone and wont work, i also tested to make that on the game mode and it dont gives any warning or error but it wont work the gui dont shows.

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