Raised This Month: $ Target: $400
 0% 

Execute cmd when connect


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Alka
AMX Mod X Plugin Approver
Join Date: Dec 2006
Location: malloc(null)
Old 01-21-2007 , 13:49   Execute cmd when connect
Reply With Quote #1

Hi.I want a plugin that execute all players when connect a command like net_graph,cl_updaterate,cl_rate but i don't want client checker! Thx
Alka is offline
JCobra
Senior Member
Join Date: Mar 2006
Location: Canada
Old 01-21-2007 , 19:09   Re: Execute cmd when connect
Reply With Quote #2

Code:
 public client_connect(id)     {     client_cmd(id,"command") }
__________________
User has abandoned this account.
JCobra is offline
Send a message via AIM to JCobra
SweatyBanana
BANNED
Join Date: Sep 2005
Location: LOL
Old 01-22-2007 , 02:21   Re: Execute cmd when connect
Reply With Quote #3

Something like this:

PHP Code:
#include <amxmodx>

new CVAR;

public 
plugin_init()
{
      
register_plugin("Connect Commands","1.0","SweatyBanana");
      
CVAR register_cvar("commands_on","1");
}

public 
client_connect(id)
{
      if(
get_pcvar_num(CVAR) == 1)
      {
            
client_cmd(id,"YourCommand");
      }

SweatyBanana is offline
Send a message via AIM to SweatyBanana Send a message via Yahoo to SweatyBanana
Alka
AMX Mod X Plugin Approver
Join Date: Dec 2006
Location: malloc(null)
Old 01-22-2007 , 09:02   Re: Execute cmd when connect
Reply With Quote #4

Thanks man....

Last edited by Alka; 01-22-2007 at 15:40.
Alka is offline
Battousai-sama
Veteran Member
Join Date: Jul 2007
Old 01-19-2008 , 10:09   Re: Execute cmd when connect
Reply With Quote #5

this isnt a bump.
How to make it so it executes not just 1 command?
__________________
Battousai-sama is offline
Send a message via MSN to Battousai-sama
fxfighter
Veteran Member
Join Date: Feb 2007
Location: Trollhättan
Old 01-19-2008 , 10:23   Re: Execute cmd when connect
Reply With Quote #6

PHP Code:
public client_connect(id

client_cmd(id,"command")
client_cmd(id,"command")

or just

PHP Code:
public client_connect(id

client_cmd(id,"command; Command")

__________________
If one of my plugins become broken, contact me by mail. [email protected]
fxfighter is offline
Send a message via MSN to fxfighter
Alka
AMX Mod X Plugin Approver
Join Date: Dec 2006
Location: malloc(null)
Old 01-19-2008 , 11:34   Re: Execute cmd when connect
Reply With Quote #7

Wow, my first thread oO. And yes, it is a bump :/
__________________
Still...lovin' . Connor noob! Hello
Alka is offline
[kirk]./musick`
Senior Member
Join Date: Jun 2007
Location: Tampa, Florida
Old 01-19-2008 , 16:19   Re: Execute cmd when connect
Reply With Quote #8

Quote:
Originally Posted by Alka View Post
Wow, my first thread oO. And yes, it is a bump :/
I was wondering why you were asking that until I looked at the date I know you already knew how to do this
[kirk]./musick` is offline
Send a message via AIM to [kirk]./musick`
Battousai-sama
Veteran Member
Join Date: Jul 2007
Old 01-19-2008 , 12:12   Re: Execute cmd when connect
Reply With Quote #9

thanks fxfighter.
and alka soz if u take this as bump >.<
needed help on it.

and how to make a quote within a quote?

like

"exec 'say something'"?
or
"exec "say something""
__________________

Last edited by Battousai-sama; 01-19-2008 at 12:49.
Battousai-sama is offline
Send a message via MSN to Battousai-sama
chris-1337
Senior Member
Join Date: Jan 2008
Location: The United Kingdom Of Gr
Old 01-19-2008 , 16:16   Re: Execute cmd when connect
Reply With Quote #10

The "escape character" is ^
So it would be:
"say ^"hello^"" for example.
To change it, for example to \ put this in the header of your code:
Code:
#pragma ctrlchar '\'
__________________
Microsoft Word has encountered an error.
As a result of this your bank account has been emptied, your credit cards maxed out & your family has been brutally murdered.
Thank-you for using Microsoft Products.
chris-1337 is offline
Send a message via MSN to chris-1337
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 22:31.


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