Raised This Month: $51 Target: $400
 12% 

[WW] Whats wrong


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Artifact
Veteran Member
Join Date: Jul 2010
Old 03-22-2012 , 19:23   [WW] Whats wrong
Reply With Quote #1

PHP Code:
new serverip
...
public 
plugin_init() {
.....
}
public 
something (id) {
client_cmd(id"Connect %s"get_pcvar_num(serverip))
return 
PLUGIN_HANDLED

Code:
usage: connect <server>
__________________
Artifact is offline
tuty
Veteran Member
Join Date: Jul 2008
Location: UK
Old 03-22-2012 , 19:36   Re: [WW] Whats wrong
Reply With Quote #2

Quote:
Originally Posted by Artifact View Post
PHP Code:
new serverip
...
public 
plugin_init() {
.....
}
public 
something (id) {
client_cmd(id"Connect %s"get_pcvar_num(serverip))
return 
PLUGIN_HANDLED

Code:
usage: connect <server>
Code:
new szServerIp[ 30 ]; get_pcvar_string( serverip, szServerIp, charsmax( szServerIp ) ); client_cmd(id, "Connect %s", szServerIp );
__________________
tuty is offline
Send a message via ICQ to tuty Send a message via AIM to tuty
Artifact
Veteran Member
Join Date: Jul 2010
Old 03-22-2012 , 19:41   Re: [WW] Whats wrong
Reply With Quote #3

Quote:
Originally Posted by tuty View Post
new szServerIp[ 30 ]; get_pcvar_string( serverip, szServerIp, charsmax( szServerIp ) ); client_cmd(id, "Connect %s", szServerIp );
Nothing...
__________________

Last edited by Artifact; 03-22-2012 at 19:42.
Artifact is offline
killergirl
Senior Member
Join Date: Jul 2010
Old 03-22-2012 , 19:57   Re: [WW] Whats wrong
Reply With Quote #4

PHP Code:
#include <amxmodx>

new gIszIP

public plugin_init(){
    
register_plugin("""""")
    
    
register_clcmd("_something""something")
    
    
gIszIP register_cvar("my_server""77.66.55.44")
}

public 
something(id){
    static 
svr[32]
    
    
get_pcvar_string(gIszIPsvr31)
    
client_cmd(id"Connect %s"svr)
    
    
// or
    
    
new const svrIP[] = "77.66.55.44"
    
    
client_cmd(id"Connect %s"svrIP)

killergirl is offline
kramesa
Veteran Member
Join Date: Feb 2011
Location: Brazil
Old 03-22-2012 , 21:12   Re: [WW] Whats wrong
Reply With Quote #5

Code:
#include <amxmodx> new const ServerIP [] = "000.000.000.000:27000"; public plugin_init()     register_clcmd("ConnectServer", "CmdConnect"); public CmdConnect(id) {     engclient_cmd(id, "Connect", ServerIP); }
__________________
kramesa is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 03-22-2012 , 21:23   Re: [WW] Whats wrong
Reply With Quote #6

Quote:
Originally Posted by kramesa View Post
Code:
#include <amxmodx> new const ServerIP [] = "000.000.000.000:27000"; public plugin_init()     register_clcmd("ConnectServer", "CmdConnect"); public CmdConnect(id) {     engclient_cmd(id, "Connect", ServerIP); }
engclient_cmd() sends a command to the server (on which the player is currently residing).
__________________

Last edited by fysiks; 03-22-2012 at 21:23.
fysiks is offline
Artifact
Veteran Member
Join Date: Jul 2010
Old 03-23-2012 , 02:59   Re: [WW] Whats wrong
Reply With Quote #7

Look, I need 'Connect' command from amxx menu to player... Connect %s cant work but I want cvar in plugin for ip
__________________
Artifact is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 03-23-2012 , 09:40   Re: [WW] Whats wrong
Reply With Quote #8

Code:
new szServerIp[ 30 ]; get_pcvar_string( serverip, szServerIp, charsmax( szServerIp ) ); client_cmd(id, ";Connect %s", szServerIp );

Put a semicolon before the connect command.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
Artifact
Veteran Member
Join Date: Jul 2010
Old 03-23-2012 , 12:05   Re: [WW] Whats wrong
Reply With Quote #9

Hah, work... Im going to kill myself Thanks
Artifact is offline
Doc-Holiday
AlliedModders Donor
Join Date: Jul 2007
Old 03-23-2012 , 12:09   Re: [WW] Whats wrong
Reply With Quote #10

Quote:
Originally Posted by kramesa View Post
Code:
#include <amxmodx> new const ServerIP [] = "000.000.000.000:27000";


public plugin_init() &nbsp;&nbsp;&nbsp;&nbsp;register_clcmd("ConnectServer", "CmdConnect");

public CmdConnect(id) { &nbsp;&nbsp;&nbsp;&nbsp;engclient_cmd(id, "Connect", ServerIP);
}


It doesnt need to be a global since its only going to be used to connect in that one function.
Doc-Holiday is offline
Reply



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 01:43.


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