Raised This Month: $ Target: $400
 0% 

Plugin Not Reading


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
owned
Member
Join Date: Jul 2007
Old 07-26-2007 , 02:48   Plugin Not Reading
Reply With Quote #1

I'm not sure if this is the correct forum [if not please move].

I created a plugin, when the user connects it checks if the person is an admin, if they are it prints a message about an admin connecting, if not, just says player is connect, then it plays a random sound. The same routine for disconnecting.

PHP Code:
/*
* PLUGIN CREATED BY MARREC
* MARREC IS THE CO-OWNER OF FNM
* PLUGIN IS NOT TO BE RE-USED ON
*    ANY SERVER WITH OR WITH
*    OUT PERMISSION FROM
*    ANY BODY IN FNM
* ALL PLUGIN CONTENT IS 100%
*    HAND-CREATED, USING
*    NO HELP FROM ANOTHER
*    PLUGIN
*/

#include <amxmodx>
#include <amxmisc>
#include <cstrike>

#define PLUGIN "FnM Connect/Disconnect Sound and Print"
#define VERSION "1.0"
#define AUTHOR "MARREC"


public plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
register_clcmd("say /play1","PlaySound(1,1)")
    
register_clcmd("say /play2","PlaySound(2,1)")
    
register_clcmd("say /play3","PlaySound(1,2)")
    
register_clcmd("say /play4","PlaySound(2,2)")
    
}

public 
plugin_precache(){
    
precache_sound("sound/fnm/welcome1.wav")
    
precache_sound("sound/fnm/welcome2.wav")
    
precache_sound("sound/fnm/leave1.wav")
    
precache_sound("sound/fnm/leave2.wav")
}

public 
client_connect(id){
    
    if(
access(id,ADMIN_ADMIN)){
        new 
name[33], authID[33]
        
        
get_user_name(id,name,32)
        
get_user_authid(id,authID,32)
        
        
client_print(0,print_chat,">>> AN ADMIN HAS CONNECTED <<<")
        
client_print(0,print_chat,"Admin: %s [%s] has connected to FnM",name,authID)
    }else {
        new 
name[33],authID[33]
        
        
get_user_name(id,name,32)
        
get_user_authid(id,authID,32)
        
        
client_print(0,print_chat,">>> A NEW PLAYER HAS CONNECTED <<<")
        
client_print(0,print_chat,"Player: %s [%s] has connected to FnM",name,authID)
    }
    
    new 
sound_num random_num(1,2)
    
PlaySound(sound_num,1)
    
    return 
PLUGIN_CONTINUE

}

public 
client_disconnect(id){
    
    if(
access(id,ADMIN_ADMIN)){
        new 
name[33], authID[33]
        
        
get_user_name(id,name,32)
        
get_user_authid(id,authID,32)
        
        
client_print(0,print_chat,">>> AN ADMIN HAS DISNNECTED <<<")
        
client_print(0,print_chat,"Admin: %s [%s] has disconnected from FnM",name,authID)
    }else {
        new 
name[33],authID[33]
        
        
get_user_name(id,name,32)
        
get_user_authid(id,authID,32)
        
        
client_print(0,print_chat,">>> A PLAYER HAS DISCONNECTED <<<")
        
client_print(0,print_chat,"Player: %s [%s] has disconnected from FnM",name,authID)
    }
    
    new 
sound_num random_num(1,2)
    
PlaySound(sound_num,2)
    
    return 
PLUGIN_CONTINUE
}

public 
PlaySound(num,x){
    new 
num,x
    
if(== 1){
        switch(
num){
            case 
1emit_sound(0CHAN_VOICE"fnm/welcome1.wav"VOL_NORMATTN_NORM0PITCH_NORM)
            case 
2emit_sound(0CHAN_VOICE"fnm/welcome2.wav"VOL_NORMATTN_NORM0PITCH_NORM)
        }
    }

    
    if(
== 2){
        switch(
num){
            case 
1emit_sound(0CHAN_VOICE"fnm/leave1.wav"VOL_NORMATTN_NORM0PITCH_NORM)
            case 
2emit_sound(0CHAN_VOICE"fnm/leave2.wav"VOL_NORMATTN_NORM0PITCH_NORM)
        }
    }
    
    return 
PLUGIN_CONTINUE


*NOTE: I was testing on a LAN server installed with AMXX.
owned is offline
 


Thread Tools
Display Modes

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 23:00.


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