ULX

Author Topic: Encouraging members to wear tag  (Read 2311 times)

0 Members and 1 Guest are viewing this topic.

Offline PAL-18

  • Full Member
  • ***
  • Posts: 142
  • Karma: 1
Encouraging members to wear tag
« on: May 30, 2014, 07:59:12 PM »
I have a few members in my gaming community who simply refuse to wear the tag, even for a few minutes and I was wondering if a coder who has some time to kill can make the following:

Players who are given reserve permission on the server who are also wearing the tag in their name get the reserved slot.  But if the player isn't wearing the tag, they dont get the reserved slot.

Thanks in advance for anyone considering to help me.

Offline Valgoid

  • Full Member
  • ***
  • Posts: 103
  • Karma: -15
  • Wanna Be Lua King
Re: Encouraging members to wear tag
« Reply #1 on: June 07, 2014, 09:48:07 PM »
Alright,
first off make 2 groups, one for the vip who want to wear tags, and another one for the vip who dont want to wear tabs. Name ulx group for the vips who want to have one "VIP" and the others "VIP1". Then, set the permissions from there.

Edit: Hope this helps you.

Offline MrPresident

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 2728
  • Karma: 430
    • |G4P| Gman4President
Re: Encouraging members to wear tag
« Reply #2 on: June 07, 2014, 10:01:01 PM »
I think he wants it to be dynamic. Detect if the player is wearing the tag and then allow them to join as reserved if they are.

Offline Cobalt

  • Full Member
  • ***
  • Posts: 216
  • Karma: 44
  • http://steamcommunity.com/id/__yvl/
Re: Encouraging members to wear tag
« Reply #3 on: June 07, 2014, 10:08:33 PM »
Code: [Select]
function CheckTag( ply )
if string.find( ply:Nick(), "your tag here" ) then
return true
else
return false
end
end

hook.Add( "PlayerInitialSpawn", "CheckName", function( ply )
if CheckTag( ply ) then
ply.tag = true
else
ply.tag = false
end
end )

hook.Add( "ULibPlayerNameChanged", "CheckNameChange", function( ply )
if IsValid( ply ) then
if CheckTag( ply ) then
if ply.tag = false then
ply:ChatPrint( "Thank you for putting on the tag." )
end
ply.tag = true
else
ply.tag = false
end
end
end )

Actually this won't work but you need to check for the tag in the ulx code for reserved slots. Use the same method. Then use the above when you want to give people wearing the tag other benefits in-game.
« Last Edit: June 07, 2014, 10:12:54 PM by Cobalt »

Offline Valgoid

  • Full Member
  • ***
  • Posts: 103
  • Karma: -15
  • Wanna Be Lua King
Re: Encouraging members to wear tag
« Reply #4 on: June 07, 2014, 10:10:26 PM »
Ok, thanks Cobalt, I think I might use that script.

Offline PAL-18

  • Full Member
  • ***
  • Posts: 142
  • Karma: 1
Re: Encouraging members to wear tag
« Reply #5 on: June 11, 2014, 11:43:49 AM »
Awesome! Many thanks

Offline PAL-18

  • Full Member
  • ***
  • Posts: 142
  • Karma: 1
Re: Encouraging members to wear tag
« Reply #6 on: June 13, 2014, 04:48:09 PM »
Code: [Select]
function CheckTag( ply )
if string.find( ply:Nick(), "your tag here" ) then
return true
else
return false
end
end

hook.Add( "PlayerInitialSpawn", "CheckName", function( ply )
if CheckTag( ply ) then
ply.tag = true
else
ply.tag = false
end
end )

hook.Add( "ULibPlayerNameChanged", "CheckNameChange", function( ply )
if IsValid( ply ) then
if CheckTag( ply ) then
if ply.tag = false then
ply:ChatPrint( "Thank you for putting on the tag." )
end
ply.tag = true
else
ply.tag = false
end
end
end )

Actually this won't work but you need to check for the tag in the ulx code for reserved slots. Use the same method. Then use the above when you want to give people wearing the tag other benefits in-game.

I assume, i should add that code to "addons\ulx\lua\ulx\modules\slots.lua" but where in that file?