Raised This Month: $ Target: $400
 0% 

[ Solved ] Player rights and sound


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
xPaw
Retired AMX Mod X Moderator
Join Date: Jul 2008
Old 08-24-2008 , 11:20   [ Solved ] Player rights and sound
Reply With Quote #1

[ Solved, Thanks Exolent ;) ]
__________________

Last edited by xPaw; 08-24-2008 at 12:45.
xPaw is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 08-24-2008 , 11:26   Re: Player rights and sound
Reply With Quote #2

Quote:
i tryed to make
Show your code. ;)
__________________
Arkshine is offline
xPaw
Retired AMX Mod X Moderator
Join Date: Jul 2008
Old 08-24-2008 , 11:34   Re: Player rights and sound
Reply With Quote #3

PHP Code:
#include <amxmodx>
#include <amxmisc>

#define PLUGIN "Adm Connect Sound"
#define VERSION "1.0"
#define AUTHOR "xPaw"


public plugin_init()
    
register_plugin(PLUGINVERSIONAUTHOR)

public 
plugin_precache()
{
    
precache_sound("sounds/misc/admin.mp3")
    
precache_sound("sounds/misc/headadmin.mp3")
    
precache_sound("sounds/misc/vip.mp3")
}
    
public 
client_connect(id)
{
    if(
get_user_flags(id) && ADMIN_RESERVATION)
        
client_cmd(0"mp3 play sounds/misc/vip.mp3")
        
    if(
get_user_flags(id) && ADMIN_RCON)
        
client_cmd(0"mp3 play sounds/misc/headadmin.mp3")
        
    if(
get_user_flags(id) && ADMIN_ADMIN)
        
client_cmd(0"mp3 play sounds/misc/admin.mp3")

__________________
xPaw is offline
Dunn0
Member
Join Date: Feb 2008
Old 08-24-2008 , 12:26   Re: Player rights and sound
Reply With Quote #4

try do this with false and true somethink like if user connects and got flag reservation play sound else if user got reservation && ADMIN_RCON dont play i think u get idea
Dunn0 is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 08-24-2008 , 12:31   Re: Player rights and sound
Reply With Quote #5

1. Cache the get_user_flags() value.
2. The correct way to check flags is (flags & ADMIN_*). Only 1 &.
3. Use else if() statements so that the ones after wont be used.

Code:
#include <amxmodx> #include <amxmisc> #define PLUGIN "Adm Connect Sound" #define VERSION "1.0" #define AUTHOR "xPaw" public plugin_init()     register_plugin(PLUGIN, VERSION, AUTHOR) public plugin_precache() {     precache_sound("sounds/misc/admin.mp3")     precache_sound("sounds/misc/headadmin.mp3")     precache_sound("sounds/misc/vip.mp3") }     public client_connect(id) {     new flags = get_user_flags(id)         if(flags & ADMIN_RESERVATION)     {         // player had reservation flag         client_cmd(0, "mp3 play sounds/misc/vip.mp3")     }     else if(flags & ADMIN_RCON)     {         // player didn't have reservation but has rcon         client_cmd(0, "mp3 play sounds/misc/headadmin.mp3")     }     else if(flags & ADMIN_ADMIN)     {         // player didn't have reservation or rcon, but still is an admin         client_cmd(0, "mp3 play sounds/misc/admin.mp3")     } }
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
xPaw
Retired AMX Mod X Moderator
Join Date: Jul 2008
Old 08-24-2008 , 12:37   Re: Player rights and sound
Reply With Quote #6

okay thanks, but if i'm headadmin i got reservation anyway, and its says i'm vip o.O ?
i need to make there check, rcon, admin and then reservation, right ?
__________________
xPaw is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 08-24-2008 , 12:41   Re: Player rights and sound
Reply With Quote #7

That won't work correctly because VIP players with reservation will be detected with ADMIN_ADMIN.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
xPaw
Retired AMX Mod X Moderator
Join Date: Jul 2008
Old 08-24-2008 , 12:42   Re: Player rights and sound
Reply With Quote #8

i make not ADMIN_KICK, not ADMIN_ADMIN, just mine error
__________________
xPaw is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 08-24-2008 , 12:43   Re: Player rights and sound
Reply With Quote #9

Then, yes. Do rcon, kick, then reservation.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
xPaw
Retired AMX Mod X Moderator
Join Date: Jul 2008
Old 08-24-2008 , 12:44   Re: Player rights and sound
Reply With Quote #10

okay thanks, +k
__________________
xPaw is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 03:10.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode