AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Plugin Not Reading (https://forums.alliedmods.net/showthread.php?t=58423)

owned 07-26-2007 02:48

Plugin Not Reading
 
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.

vvg125 07-26-2007 02:54

Re: Plugin Not Reading
 
What do you mean by "not reading"?

owned 07-26-2007 02:59

Re: Plugin Not Reading
 
It says in "amx_plugins," UNKNOWN or BAD LOAD.

Lee 07-26-2007 03:09

Re: Plugin Not Reading
 
You can't pass parameters to a function when called by a client command.

owned 07-26-2007 03:13

Re: Plugin Not Reading
 
Well this is my first real plugin, could you help me on what's wrong?

Spanky McNutnut 07-26-2007 04:35

Re: Plugin Not Reading
 
Use the servers RCON and use the command amxx plugins

It will give a more detailed description of the error.

owned 07-26-2007 13:45

Re: Plugin Not Reading
 
It's giving me a bad load, what's wrong with the script?

YamiKaitou 07-26-2007 13:48

Re: Plugin Not Reading
 
Please provide the output of these commands when typed into the server console or through rcon


amxx plugins
amxx modules


Please note the space

owned 07-26-2007 14:07

Re: Plugin Not Reading
 
plugins:

Code:


Currently loaded plugins:
      name                    version  author            file            status 
 [  1] Admin Base              1.76d    AMXX Dev Team    admin.amxx      running 
 [  2] Admin Commands          1.76d    AMXX Dev Team    admincmd.amxx    running 
 [  3] Admin Help              1.76d    AMXX Dev Team    adminhelp.amxx  running 
 [  4] Slots Reservation      1.76d    AMXX Dev Team    adminslots.amxx  running 
 [  5] Multi-Lingual System    1.76d    AMXX Dev Team    multilingual.am  running 
 [  6] Menus Front-End        1.76d    AMXX Dev Team    menufront.amxx  running 
 [  7] Commands Menu          1.76d    AMXX Dev Team    cmdmenu.amxx    running 
 [  8] Players Menu            1.76d    AMXX Dev Team    plmenu.amxx      running 
 [  9] Maps Menu              1.76d    AMXX Dev Team    mapsmenu.amxx    running 
 [ 10] Admin Chat              1.76d    AMXX Dev Team    adminchat.amxx  running 
 [ 11] Anti Flood              1.76d    AMXX Dev Team    antiflood.amxx  running 
 [ 12] Scrolling Message      1.76d    AMXX Dev Team    scrollmsg.amxx  running 
 [ 13] Info. Messages          1.76d    AMXX Dev Team    imessage.amxx    running 
 [ 14] Admin Votes            1.76d    AMXX Dev Team    adminvote.amxx  running 
 [ 15] NextMap                1.76d    AMXX Dev Team    nextmap.amxx    running 
 [ 16] TimeLeft                1.76d    AMXX Dev Team    timeleft.amxx    running 
 [ 17] Pause Plugins          1.76d    AMXX Dev Team    pausecfg.amxx    running 
 [ 18] Stats Configuration    1.76d    AMXX Dev Team    statscfg.amxx    running 
 [ 19] AMX Mod Compat Engine  1.76.rc  AMXX Dev Team    amxmod_compat.a  running 
 [ 20] FnM Knife Switch        1.0      MARREC            fnmka.amxx      running 
 [ 21] unknown                unknown  unknown          fnmcdsap.amxx    bad load
 [ 22] Grab + Hook + Rope      1.0      GHW_Chronic      GHW_GHR.amxx    running 
 [ 23] amx_cheat              1.0      watch            cheat.amxx      running 
 [ 24] DeagsMapManage          2.30b    Deags            deagsmapmanage2  running 
( 21) Load fails: Module/Library "cstrike" required for plugin.  Check modules.


modules:

Code:


Currently loaded modules:
      name                    version  author              status   
 [ 1] MySQL                  1.76b    AMX Mod X Dev Team  running   
 [ 2] Fun                    1.76    AMX Mod X Dev Team  running   
 [ 3] Engine                  1.76    AMX Mod X Dev Team  running   
 [ 4] FakeMeta                1.76d    AMX Mod X Dev Team  running   
 [ 5] unknown                unknown  unknown              bad load 
5 modules, 4 correct

plugins.ini

Code:

; AMX Mod X plugins

; Admin Base - Always one has to be activated
admin.amxx        ; admin base (required for any admin-related)
;admin_sql.amxx        ; admin base - SQL version (comment admin.amxx)

; Basic
admincmd.amxx        ; basic admin console commands
adminhelp.amxx        ; help command for admin console commands
adminslots.amxx        ; slot reservation
multilingual.amxx    ; Multi-Lingual management

; Menus
menufront.amxx        ; front-end for admin menus
cmdmenu.amxx        ; command menu (speech, settings)
plmenu.amxx        ; players menu (kick, ban, client cmds.)
;telemenu.amxx        ; teleport menu (Fun Module required!)
mapsmenu.amxx        ; maps menu (vote, changelevel)

; Chat / Messages
adminchat.amxx        ; console chat commands
antiflood.amxx        ; prevent clients from chat-flooding the server
scrollmsg.amxx        ; displays a scrolling message
imessage.amxx        ; displays information messages
adminvote.amxx        ; vote commands

; Map related
nextmap.amxx        ; displays next map in mapcycle
;mapchooser.amxx        ; allows to vote for next map
timeleft.amxx        ; displays time left on map

; Configuration
pausecfg.amxx        ; allows to pause and unpause some plugins
statscfg.amxx        ; allows to manage stats plugins via menu and commands

; Enable to use AMX Mod plugins
amxmod_compat.amxx    ; AMX Mod backwards compatibility layer


; Custom - Add 3rd party plugins here
;bcm2.amxx debug
fnmka.amxx
fnmcdsap.amxx
GHW_GHR.amxx
cheat.amxx
deagsmapmanage230b.amxx

modules.ini

Code:


;;;
; To enable a module, remove the semi-colon (;) in front of its name.
; If it's not here, simply add it its name, one per line.
; You don't need to write the _amxx part or the file extension.
;;;

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; SQL Modules usually need to be enabled manually ;;
;; You can have any number on at a time.  Use      ;;
;;  amx_sql_type in sql.cfg to specify the default ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

mysql
;sqlite

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Put third party modules below here.              ;;
;; You can just list their names, without the _amxx ;;
;;  or file extension.                              ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;



;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; These modules will be auto-detected and loaded  ;;
;;  as needed.  You do not need to enable them here ;;
;;  unless you have problems.                      ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
fun
engine
fakemeta
cstrike
;geoip
;sockets
;regex
;nvault


YamiKaitou 07-26-2007 14:36

Re: Plugin Not Reading
 
Did you install the CStrike Addon?


All times are GMT -4. The time now is 22:59.

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