codeluaeveryday Posted October 3, 2011 Posted October 3, 2011 (edited) Hello all, my name is Chris, and i am currently developing a script which will be shared, i am a beginner, but it has some pretty useful stuff. It will be made public soon. For anyone which helps me with this script/project will be credited when released. Here i am trying to create a setting which changes the color of the text, BUT, thats not my only problem, the nick is fine, the join message wont work at all. Anyone aware why? The meta: <meta> <info author="[EGL]Chris" version="0.5" type="script" name="Essentials" description="This script add's alot of features for admin's and players. Hope you like it." /> <settings> <setting name="*language" value="english" /> <setting name="*color" value="255,200,100" /> </settings> <script src="admintag.lua" type="server" /> <script src="admincommands.lua" type="server" /> <script src="ip+serial.lua" type="server" /> <script src="welcome.lua" type="server" /> <script src="joinquit.lua" type="server" /> </meta> local color = get('joinquitcolor') local root = getRootElement() local name = getPlayerName(source) local old = oldNick local new = newNick local ip = getPlayerIP (thePlayer) local version = getPlayerVersion (playerSource) local country = call(getResourceFromName("admin"), "getPlayerCountry", source) function playerjoin(root) outputChatBox(name.." has joined the server. ["..country.."] ["..ip.."] ["..version.."]",root,color) end addEventHandler("onPlayerJoin",root,playerjoin) function playerquit(reason) if reason == Disconnected then outputChatBox(name.." has disconnected from the server",root, color) elseif (reason == Kicked) then outputChatBox(name.." has been kicked from the server",root,color) elseif (reason == Banned) then outputChatBox(name.." has been banned from the server",root,color) elseif (reason == TimedOut) then outputChatBox(name.." has lost connection with the server",root,color) end end addEventHandler("onPlayerJoin",getRootElement(),playerquit) function playernickchange(oldNick,newNick) outputChatBox("* "..old.." has changed his name to "..new,root,255,100,100) end Edited October 5, 2011 by Guest Tutorials: => getOnlineAdmins() => [TUT] Better Join Country => [TUT] Updating admin countries => [TUT] Updating admin flags Server: K@N Zombies / Freeroam
^Dev-PoinT^ Posted October 3, 2011 Posted October 3, 2011 Joinquit is ClientFunction use triggerClientEvent you lost This function playernickchange(oldNick,newNick) outputChatBox("* "..old.." has changed his name to "..new,root,255,100,100) addEventHandler('onClientPlayerChangeNick', root, playernickchange)
codeluaeveryday Posted October 3, 2011 Author Posted October 3, 2011 Hello all, my name is Chris, and i am currently developing a script which will be shared, i am a beginner, but it has some pretty useful stuff. It will be made public soon.For anyone which helps me with this script/project will be credited when released. Here i am trying to create a setting which changes the color of the text, BUT, thats not my only problem, the nick is fine, the join message wont work at all. Anyone aware why? The meta: <meta> <info author="[EGL]Chris" version="0.5" type="script" name="Essentials" description="This script add's alot of features for admin's and players. Hope you like it." /> <settings> <setting name="*language" value="english" /> <setting name="*color" value="255,200,100" /> </settings> <script src="admintag.lua" type="server" /> <script src="admincommands.lua" type="server" /> <script src="ip+serial.lua" type="server" /> <script src="welcome.lua" type="server" /> <script src="joinquit.lua" type="server" /> </meta> local color = get('joinquitcolor') local root = getRootElement() local name = getPlayerName(source) local old = oldNick local new = newNick local ip = getPlayerIP (thePlayer) local version = getPlayerVersion (playerSource) local country = call(getResourceFromName("admin"), "getPlayerCountry", source) function playerjoin(root) outputChatBox(name.." has joined the server. ["..country.."] ["..ip.."] ["..version.."]",root,color) end addEventHandler("onPlayerJoin",root,playerjoin) function playerquit(reason) if reason == Disconnected then outputChatBox(name.." has disconnected from the server",root, color) elseif (reason == Kicked) then outputChatBox(name.." has been kicked from the server",root,color) elseif (reason == Banned) then outputChatBox(name.." has been banned from the server",root,color) elseif (reason == TimedOut) then outputChatBox(name.." has lost connection with the server",root,color) end end addEventHandler("onPlayerJoin",getRootElement(),playerquit) function playernickchange(oldNick,newNick) outputChatBox("* "..old.." has changed his name to "..new,root,255,100,100) end thanks i see your point, i fixed the script to be client, but still the join message wont work. Anyone else? btw, i think its something todo witht he country and serial, and ip. Tutorials: => getOnlineAdmins() => [TUT] Better Join Country => [TUT] Updating admin countries => [TUT] Updating admin flags Server: K@N Zombies / Freeroam
^Dev-PoinT^ Posted October 3, 2011 Posted October 3, 2011 Lol what is This? addEventHandler("onPlayerJoin",getRootElement(),playerquit) and getPlayerip, getPlayerVerison ,get, is server function and you but it on ClientFunction!
codeluaeveryday Posted October 3, 2011 Author Posted October 3, 2011 Lol what is This?addEventHandler("onPlayerJoin",getRootElement(),playerquit) and getPlayerip, getPlayerVerison ,get, is server function and you but it on ClientFunction! Are you deaf, i said i fixed it. Tutorials: => getOnlineAdmins() => [TUT] Better Join Country => [TUT] Updating admin countries => [TUT] Updating admin flags Server: K@N Zombies / Freeroam
TAPL Posted October 3, 2011 Posted October 3, 2011 you have two event onPlayerJoin try this local color = get('joinquitcolor') function playerjoin() local name = getPlayerName(source) local ip = getPlayerIP (source) local version = getPlayerVersion (source) local country = call(getResourceFromName("admin"), "getPlayerCountry", source) if country then outputChatBox(name.." has joined the server. ["..country.."] ["..ip.."] ["..version.."]",root,color) else outputChatBox(name.." has joined the server. [unknow] ["..ip.."] ["..version.."]",root,color) end end addEventHandler("onPlayerJoin",root,playerjoin) function playerquit(reason) local name = getPlayerName(source) if reason == "Quit" then outputChatBox(name.." has disconnected from the server",root, color) elseif (reason == "Kicked" ) then outputChatBox(name.." has been kicked from the server",root,color) elseif (reason == "Banned" ) then outputChatBox(name.." has been banned from the server",root,color) elseif (reason == "Timed out") then outputChatBox(name.." has lost connection with the server",root,color) end end addEventHandler("onPlayerQuit",root,playerquit) function playernickchange(oldNick, newNick) outputChatBox("* "..old.." has changed his name to "..new,root,255,100,100) end addEventHandler("onPlayerChangeNick", root, playernickchange) --------------------------------------------------- "[EGL]Chris" version="0.5" type="script" name="Essentials" description="This script add's alot of features for admin's and players. Hope you like it." /> "*language" value="english" /> "*joinquitcolor" value="255,200,100" />
codeluaeveryday Posted October 4, 2011 Author Posted October 4, 2011 you have two event onPlayerJoin try this local color = get('joinquitcolor') function playerjoin() local name = getPlayerName(source) local ip = getPlayerIP (source) local version = getPlayerVersion (source) local country = call(getResourceFromName("admin"), "getPlayerCountry", source) if country then outputChatBox(name.." has joined the server. ["..country.."] ["..ip.."] ["..version.."]",root,color) else outputChatBox(name.." has joined the server. [unknow] ["..ip.."] ["..version.."]",root,color) end end addEventHandler("onPlayerJoin",root,playerjoin) function playerquit(reason) local name = getPlayerName(source) if reason == "Quit" then outputChatBox(name.." has disconnected from the server",root, color) elseif (reason == "Kicked" ) then outputChatBox(name.." has been kicked from the server",root,color) elseif (reason == "Banned" ) then outputChatBox(name.." has been banned from the server",root,color) elseif (reason == "Timed out") then outputChatBox(name.." has lost connection with the server",root,color) end end addEventHandler("onPlayerQuit",root,playerquit) function playernickchange(oldNick, newNick) outputChatBox("* "..old.." has changed his name to "..new,root,255,100,100) end addEventHandler("onPlayerChangeNick", root, playernickchange) --------------------------------------------------- "[EGL]Chris" version="0.5" type="script" name="Essentials" description="This script add's alot of features for admin's and players. Hope you like it." /> "*language" value="english" /> "*joinquitcolor" value="255,200,100" /> TAPL, I ABSOLUTELY LOVE YOU!!! YOU ARE HELPING ME ALOT. THANK YOU. The join works perfectly, what about the nick that wont work lol, any idea's? Tutorials: => getOnlineAdmins() => [TUT] Better Join Country => [TUT] Updating admin countries => [TUT] Updating admin flags Server: K@N Zombies / Freeroam
TAPL Posted October 4, 2011 Posted October 4, 2011 local color = get('joinquitcolor') function playerjoin() local name = getPlayerName(source) local ip = getPlayerIP (source) local version = getPlayerVersion (source) local country = call(getResourceFromName("admin"), "getPlayerCountry", source) if country then outputChatBox(name.." has joined the server. ["..country.."] ["..ip.."] ["..version.."]",root,color) else outputChatBox(name.." has joined the server. [unknow] ["..ip.."] ["..version.."]",root,color) end end addEventHandler("onPlayerJoin",root,playerjoin) function playerquit(reason) local name = getPlayerName(source) if reason == "Quit" then outputChatBox(name.." has disconnected from the server",root, color) elseif (reason == "Kicked" ) then outputChatBox(name.." has been kicked from the server",root,color) elseif (reason == "Banned" ) then outputChatBox(name.." has been banned from the server",root,color) elseif (reason == "Timed out") then outputChatBox(name.." has lost connection with the server",root,color) end end addEventHandler("onPlayerQuit",root,playerquit) function playernickchange(old, new) outputChatBox("* "..old.." has changed his name to "..new,root,255,100,100) end addEventHandler("onPlayerChangeNick", root, playernickchange)
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now