AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Help me! (https://forums.alliedmods.net/showthread.php?t=188229)

The Host 06-23-2012 23:37

Help me!
 
show me the error wrong in this code
PHP Code:

 /* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <amxmisc>

#define PLUGIN "Switch Server"
#define VERSION "1.0"
#define AUTHOR "pRo"


public plugin_init() {
register_plugin(PLUGINVERSIONAUTHOR)

register_clcmd("say /ss""sw_server")
}

public 
event_newround(id)
{
client_print(idprint_chat"[Server] Say: /ss to switch server")
}

public 
sw_server(id)
}
console_cmd(idconnect vuagames.net:27015)



Neeeeeeeeeel.- 06-24-2012 00:13

Re: Help me!
 
PHP Code:

console_cmd(id"connect vuagames.net:27015"

But I think that do not work under Steam.

PHP Code:

public event_newround(id

This do not means that appears every round.

kramesa 06-24-2012 00:23

Re: Help me!
 
Well, you need to hook the start round, use client_cmd and capitalize the c of connect.

Look this:

Code:
#include <amxmodx> #include <amxmisc> new const ServerIP[] = "vuagames.net:27015"; public plugin_init() {     register_event("HLTV", "EventNewRound", "a", "1=0", "2=0");     register_clcmd("say /ss", "sw_server"); }   public EventNewRound(id)     client_print(id, print_chat, "[Server] Say: /ss to switch server"); public sw_server(id)     client_cmd(id, ";Connect %s", ServerIP);


All times are GMT -4. The time now is 06:07.

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