AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Bomb Features Plugin (https://forums.alliedmods.net/showthread.php?t=40267)

xnn 06-25-2006 15:08

Bomb Features Plugin
 
Congrats for the new forums. All the stuff it's better organized and much more easy to find now :)
Now, here comes my problem. I made a plugin that plays a sound when the bomb is planted or defused, and it should write in chat that "someone" planted or defused the bomb. It only shows "planted the bomb" or "defused the bomb" without the name of the player. Can you please help me? Thanks alot. I'm still a beginner, but I'm willing to learn :)

Code:

/* ------------------------------------- */
/* Bomb Features Plugin created by xenon */
/*        http://www.cszone.ro/          */
/*        http://www.amxmodx.org/        */
/* ------------------------------------- */

#include <amxmodx>
#include <cstrike>

public plugin_init() {
        register_plugin("Bomb Features","1.00","xenon")
        register_event("SendAudio", "bmb_plant", "a", "2&%!MRAD_BOMBPL")
        register_event("SendAudio", "bmb_def", "a", "2&%!MRAD_BOMBDEF")
}

public bmb_plant() {
        new planter = read_data(2)
        new name[32]
        get_user_name(planter,name,31)
               
        client_cmd(0,"stopsound")
        client_cmd(0,"spk misc/planted")
        client_print(0,print_chat,"%s planted the bomb!",planter)
       
        return PLUGIN_HANDLED
}

public bmb_def() {
        new defuser = read_data(2)
        new name[32]
        get_user_name(defuser,name,31)
       
        client_cmd(0,"stopsound")
        client_cmd(0,"spk misc/defused")
        client_print(0,print_chat,"%s defused the bomb!",defuser)
       
        return PLUGIN_HANDLED
}

public plugin_precache() {
        precache_sound("misc/planted.wav")
        precache_sound("misc/defused.wav")

        return PLUGIN_CONTINUE
}


v3x 06-25-2006 17:11

Re: Bomb Features Plugin
 
You could use the CSX module forwards: http://www.amxmodx.org/funcwiki.php?...bomb&go=search

VEN 06-25-2006 19:44

Re: Bomb Features Plugin
 
Or consult CS Bomb Scripting FAQ/Tutorial

xnn 06-26-2006 11:43

Re: Bomb Features Plugin
 
Thanks alot guys. Didn't knew about that resources... :(


All times are GMT -4. The time now is 08:09.

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