Jump to content

question


BorderLine

Recommended Posts

Posted

there is any way to detect if the player join for first time to the server?

Actual Nick: [XGN]BorderLine

Actual Clan: XLatino

Actual Status: Staff, Mod Level 1

(BOSS)Yakuza - [vS]Yakuza - [sXE]Yakuza - [uG]Yakuza - [FTLS]Racing - [XGN]Borderline

Posted

No, there isn't, but you can add serials to a My(SQL) table and check every time a player joins.

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

thx, ill try it

Actual Nick: [XGN]BorderLine

Actual Clan: XLatino

Actual Status: Staff, Mod Level 1

(BOSS)Yakuza - [vS]Yakuza - [sXE]Yakuza - [uG]Yakuza - [FTLS]Racing - [XGN]Borderline

Posted

yes

local firstTime = 0 
  
function onLogin() 
    if getElementData(source, "firstTime") == 1 then 
        firstTime = 0 
    else 
        setElementData ( source, "firstTime", 1 ) 
        firstTime = 1 
        asd(source) 
    end 
end 
addEventHandler("onPlayerJoin", getRootElement(), onLogin) 
  
function asd(source) 
    if firstTime == 1 then 
        outputChatBox("Player "..getPlayerName(source).."Joined first time!", getRootElement()) 
    else 
        outputChatBox("Player "..getPlayerName(source).."Just join on the server", getRootElement()) 
    end 
end 

357ac0078264.jpg

- Working on [php/HTML/Mysql/Lua/Java Scripts/Web Design/3D Modeling]

Posted
there is any way to detect if the player join for first time to the server?

You can use account data also(If you're going to use accounts even).

Posted
there is any way to detect if the player join for first time to the server?

You can use account data also(If you're going to use accounts even).

he can't use account if player not logged.

to detect if the player join

357ac0078264.jpg

- Working on [php/HTML/Mysql/Lua/Java Scripts/Web Design/3D Modeling]

Posted
yes
local firstTime = 0 
  
function onLogin() 
    if getElementData(source, "firstTime") == 1 then 
        firstTime = 0 
    else 
        setElementData ( source, "firstTime", 1 ) 
        firstTime = 1 
        asd(source) 
    end 
end 
addEventHandler("onPlayerJoin", getRootElement(), onLogin) 
  
function asd(source) 
    if firstTime == 1 then 
        outputChatBox("Player "..getPlayerName(source).."Joined first time!", getRootElement()) 
    else 
        outputChatBox("Player "..getPlayerName(source).."Just join on the server", getRootElement()) 
    end 
end 

This will just work temporary, he can just store player serials on a SQLite table.

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

Well, im dont know nothing about sql, so i did the @Qwerty~ ide.

And i have this.

I want show a panel for select skin when player join for first time.

client

function selectskin() 
  
GUIEditor_Window = {} 
GUIEditor_Button = {} 
GUIEditor_Label = {} 
  
select = guiCreateWindow(150,126,306,198,"Welcome to Biohazard Serer",false)  
GUIEditor_Label[1] = guiCreateLabel(102,24,111,19,"Select your gender",false,select) 
GUIEditor_Button[1] = guiCreateButton(29,74,88,41,"Male",false,select) 
GUIEditor_Button[2] = guiCreateButton(188,74,88,41,"Female",false,select) 
GUIEditor_Label[2] = guiCreateLabel(18,139,230,22,"This will select your skin",false,select) 
GUIEditor_Label[3] = guiCreateLabel(17,162,244,26,"Only can chose when you join on first time",false,select) 
end 
addEvent( "onSelect", true ) 
addEventHandler( "onSelect", getLocalPlayer(), selectskin ) 

server

local firstTime = 0 
  
function onLogin() 
    if getElementData(source, "firstTime") == 1 then 
        firstTime = 0 
    else 
        setElementData ( source, "firstTime", 1 ) 
        firstTime = 1 
        asd(source) 
    end 
end 
addEventHandler("onPlayerJoin", getRootElement(), onLogin) 
  
function asd(source) 
    if firstTime == 1 then 
        triggerClientEvent(source,"onSelect",source) 
    else 
        outputChatBox("*"..getPlayerName(source).." welcome to Biohazard server", source) 
    end 
end 

The problem is, the gui show all time before to login, and i changed the onPlayerJoin to onPlayerLogin and when im login with new accounts or old accounts, still showing. I mean dont show gui to FIrst login

Actual Nick: [XGN]BorderLine

Actual Clan: XLatino

Actual Status: Staff, Mod Level 1

(BOSS)Yakuza - [vS]Yakuza - [sXE]Yakuza - [uG]Yakuza - [FTLS]Racing - [XGN]Borderline

Posted (edited)
local firstTime = 0 
  
function onLogin() 
    if getElementData(source, "firstTime") == 1 then 
        firstTime = 0 
    else 
        setElementData ( source, "firstTime", 1 ) 
        firstTime = 1 
        asd(source) 
    end 
end 
addEventHandler("onPlayerJoin", getRootElement(), onLogin) 
  
function asd(source) 
    if firstTime == 1 then 
        triggerServerEvent(source,"onSelect1",source) 
    else 
        outputChatBox("*"..getPlayerName(source).." welcome to Biohazard server", source) 
    end 
end 
  
function selectskin() 
  
    GUIEditor_Window = {} 
    GUIEditor_Button = {} 
    GUIEditor_Label = {} 
      
    select = guiCreateWindow(150,126,306,198,"Welcome to Biohazard Serer",false)  
    GUIEditor_Label[1] = guiCreateLabel(102,24,111,19,"Select your gender",false,select) 
    GUIEditor_Button[1] = guiCreateButton(29,74,88,41,"Male",false,select) 
    GUIEditor_Button[2] = guiCreateButton(188,74,88,41,"Female",false,select) 
    GUIEditor_Label[2] = guiCreateLabel(18,139,230,22,"This will select your skin",false,select) 
    GUIEditor_Label[3] = guiCreateLabel(17,162,244,26,"Only can chose when you join on first time",false,select) 
end 
addEvent( "onSelect", true ) 
addEventHandler( "onSelect", getLocalPlayer(), selectskin ) 
  
--server 
function TriGfor1Player ( source ) 
    triggerClientEvent ( source, "onSelect", source ) 
end 
addEvent( "onSelect1", true ) 
addEventHandler( "onSelect1", getRootElement(), TriGfor1Player ) 

Client CAN'T CALL Client

if u not want trigger just remove it and use

local firstTime = 0 
  
function onLogin() 
    if getElementData(source, "firstTime") == 1 then 
        firstTime = 0 
    else 
        setElementData ( source, "firstTime", 1 ) 
        firstTime = 1 
        asd(source) 
    end 
end 
addEventHandler("onPlayerJoin", getRootElement(), onLogin) 
  
function asd(source) 
    if firstTime == 1 then 
        makeWindow() 
    else 
        outputChatBox("*"..getPlayerName(source).." welcome to Biohazard server", source) 
    end 
end 
  
function makeWindow() 
  
    GUIEditor_Window = {} 
    GUIEditor_Button = {} 
    GUIEditor_Label = {} 
      
    select = guiCreateWindow(150,126,306,198,"Welcome to Biohazard Serer",false)  
    GUIEditor_Label[1] = guiCreateLabel(102,24,111,19,"Select your gender",false,select) 
    GUIEditor_Button[1] = guiCreateButton(29,74,88,41,"Male",false,select) 
    GUIEditor_Button[2] = guiCreateButton(188,74,88,41,"Female",false,select) 
    GUIEditor_Label[2] = guiCreateLabel(18,139,230,22,"This will select your skin",false,select) 
    GUIEditor_Label[3] = guiCreateLabel(17,162,244,26,"Only can chose when you join on first time",false,select) 
end 

Edited by Guest

357ac0078264.jpg

- Working on [php/HTML/Mysql/Lua/Java Scripts/Web Design/3D Modeling]

Posted

@Qwerty: Don't you get that he want's a script which will save on his/her account if he first joined or not? your script will just save temporary element data. He doesn't want to check if he's the first player that joined the server.

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
@Qwerty: Don't you get that he want's a script which will save on his/her account if he first joined or not? your script will just save temporary element data. He doesn't want to check if he's the first player that joined the server.

he can call server and save in root (but if server will restarted , this will not work)

so he can save it in xml or sql/msql

or just make a check accounts..

but xml not good idea, if saved all on server and xml file > 3mb server will supre sloooow, :D

357ac0078264.jpg

- Working on [php/HTML/Mysql/Lua/Java Scripts/Web Design/3D Modeling]

Posted

If you add the event "onPlayerJoin" i supose this was a serverside ..

Well ill test it

Actual Nick: [XGN]BorderLine

Actual Clan: XLatino

Actual Status: Staff, Mod Level 1

(BOSS)Yakuza - [vS]Yakuza - [sXE]Yakuza - [uG]Yakuza - [FTLS]Racing - [XGN]Borderline

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