AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Little Trouble CAL-CZ Config (https://forums.alliedmods.net/showthread.php?t=21890)

Anarchist 12-13-2005 02:10

Little Trouble CAL-CZ Config
 
Hi, well. I think im over my head in this plugin, but its an idea..

Code:

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

public plugin_init() {
        register_plugin("StnCALMod","1.0","Anarch!st")
        register_clcmd("say /pregame",cmd_pg, ADMIN_KICK,"- Custom Second To None Cal-Open Plugin Command")
        register_clcmd("say /prelo3",cmd_prelive, ADMIN_KICK,"- Custom Second To None Cal-Open Plugin Command")
        register_clcmd("say /lo3",cmd_live, ADMIN_KICK,"- Custom Second To None Cal-Open Plugin Command")
        register_clcmd("say /halftime",cmd_half, ADMIN_KICK,"- Custom Second To None Cal-Open Plugin Command")
        register_clcmd("say /stop","cmd_endall", ADMIN_KICK,"- Custom Second To None Cal-Open Plugin Command")
}
public cmd_pg() {
        client_print(0,print_chat,const message[],^-[A]narch!st CAL- Config Plugin-^)
        server_exec("exec pregame.cfg")
        PLUGIN_CONTINUE
}
public cmd_prelive() {
        client_print(0,print_chat,const message[], CAL-Open Config has been Started)
        client_print(0,print_chat,const message[], Type ready in chat to start the match!)
        client_print(0,print_chat,const message[], Match will not start until both teams confirm they are ready)
        PLUGIN_CONTINUE
}
public cmd_half() {
        client_print(0,print_chat,const message[], Good Half Everyone)
        server_exec("sv_restartround 1")
        PLUGIN_CONTINUE
}
public cmd_endall() {
        client_print(0,print_chat,const message[], This Match Has Been Stopped, Thanks for Playing)
        server_exec("sv_restartround 1")
        server_exec("exec server.cfg")
        PLUGIN_CONTINUE
}
public cmd_live() {
        server_exec("exec lo3.cfg")
        client_print(0,print_chat,const message[], Good Luck, Have Fun, and Please Talk in Teamsay, The match is starting!)
        PLUGIN_CONTINUE
}

I get errors every line, I think Ive underestimated the difficulty[/quote]

teame06 12-13-2005 02:30

Code:
#include <amxmodx> public plugin_init() {    register_plugin("StnCALMod","1.0","Anarch!st")    register_clcmd("say /pregame", "cmd_pg", ADMIN_KICK,"- Custom Second To None Cal-Open Plugin Command")    register_clcmd("say /prelo3", "cmd_prelive", ADMIN_KICK,"- Custom Second To None Cal-Open Plugin Command")    register_clcmd("say /lo3", "cmd_live", ADMIN_KICK,"- Custom Second To None Cal-Open Plugin Command")    register_clcmd("say /halftime", "cmd_half", ADMIN_KICK,"- Custom Second To None Cal-Open Plugin Command")    register_clcmd("say /stop","cmd_endall", ADMIN_KICK,"- Custom Second To None Cal-Open Plugin Command") } public cmd_pg() {    client_print(0,print_chat,"-[A]narch!st CAL- Config Plugin-")    server_cmd("exec pregame.cfg")    return PLUGIN_CONTINUE } public cmd_prelive() {    client_print(0,print_chat,"CAL-Open Config has been Started")    client_print(0,print_chat, "Type ready in chat to start the match!")    client_print(0,print_chat,"Match will not start until both teams confirm they are ready")    return PLUGIN_CONTINUE } public cmd_half() {    client_print(0, print_chat, "Good Half Everyone")    server_cmd("sv_restartround 1")    return PLUGIN_CONTINUE } public cmd_endall() {    client_print(0,print_chat, "This Match Has Been Stopped, Thanks for Playing")    server_cmd("sv_restartround 1")    server_cmd("exec server.cfg")    return PLUGIN_CONTINUE } public cmd_live() {    server_cmd("exec lo3.cfg")    client_print(0,print_chat," Good Luck, Have Fun, and Please Talk in Teamsay, The match is starting!")    return PLUGIN_CONTINUE }


Not sure if Admin flags work in say... I don't know.

Anarchist 12-13-2005 22:00

Thanks, I added some new parts to it aswell, but now im having a problem checking if the user has admin...

In the documentations:

is_user_admin (id)
but what does it return it as? Or how can i do this..

teame06 12-13-2005 22:06

Code:
if(is_user_admin(id)) { }

But this will return true if the person even just has reserve flag.

Jordan 12-13-2005 22:20

You could also make them all concmds:

Code:
public plugin_init() {    register_plugin("StnCALMod","1.0","Anarch!st")    register_concmd("amx_pregame", "cmd_pg", ADMIN_KICK,"- Custom Second To None Cal-Open Plugin Command")    register_concmd("amx_prelo3", "cmd_prelive", ADMIN_KICK,"- Custom Second To None Cal-Open Plugin Command")    register_concmd("amx_lo3", "cmd_live", ADMIN_KICK,"- Custom Second To None Cal-Open Plugin Command")    register_concmd("amx_halftime", "cmd_half", ADMIN_KICK,"- Custom Second To None Cal-Open Plugin Command")    register_concmd("amx_stop","cmd_endall", ADMIN_KICK,"- Custom Second To None Cal-Open Plugin Command") } public cmd_pg() {    client_print(0,print_chat,"-[A]narch!st CAL- Config Plugin-")    server_cmd("exec pregame.cfg")    return PLUGIN_CONTINUE } public cmd_prelive() {    client_print(0,print_chat,"CAL-Open Config has been Started")    client_print(0,print_chat, "Type ready in chat to start the match!")    client_print(0,print_chat,"Match will not start until both teams confirm they are ready")    return PLUGIN_CONTINUE } public cmd_half() {    client_print(0, print_chat, "Good Half Everyone")    server_cmd("sv_restartround 1")    return PLUGIN_CONTINUE } public cmd_endall() {    client_print(0,print_chat, "This Match Has Been Stopped, Thanks for Playing")    server_cmd("sv_restartround 1")    server_cmd("exec server.cfg")    return PLUGIN_CONTINUE } public cmd_live() {    server_cmd("exec lo3.cfg")    client_print(0,print_chat," Good Luck, Have Fun, and Please Talk in Teamsay, The match is starting!")    return PLUGIN_CONTINUE }

Anarchist 12-13-2005 22:32

And lose the easy setup? Nah, Thanks though.

Xanimos 12-13-2005 22:36

change the function names to public cmd_*(id , level , cid) and then add the following to the top of all the functions
Code:
if(!cmd_access(id , level , cid , 0)) return PLUGIN_CONTINUE
And then its only availible for admins.

aLpiNe^cLuBz 12-13-2005 23:24

I'm not trying to flame or anything, but usually scrim servers dont have amxx therfore they can't use this plugin.

Anarchist 12-13-2005 23:36

For my own self pleasure, I would like to make it. Its a start of what I HOPE is a long scripting/coding hobby.

aLpiNe^cLuBz 12-13-2005 23:44

Ah, ok. Good luck. :D


All times are GMT -4. The time now is 15:56.

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