Raised This Month: $ Target: $400
 0% 

Command to execute commands on client


Post New Thread Closed Thread   
 
Thread Tools Display Modes
Author Message
[KTA] KeItO
Member
Join Date: Aug 2005
Old 08-30-2005 , 01:42   Command to execute commands on client
#1

Okay, i just need the code to execute a command on a client.
[KTA] KeItO is offline
XxAvalanchexX
Veteran Member
Join Date: Oct 2004
Location: abort73.com
Old 08-30-2005 , 02:16  
#2

Code:
client_cmd(index,"command");
__________________
No longer around. Thanks your support, everyone! As always:
THIS ONES FOR YOU
3000 PTS
XxAvalanchexX is offline
jeppelykke
Member
Join Date: May 2005
Location: Hjørring, Denmark
Old 08-30-2005 , 06:18  
#3

Sorry to butt in, but just a question regarding the same command

How would i set it up to preform the same command on all clients i done this:

Code:
client_cmd(0,"enable_menu")

But gives error L 08/30/2005 - 11:158: [AMXX] Invalid player id 0

I need it to preform that command on all clients connect to server.
__________________
Best Regards
Jeppe Lykke, Denmark
jeppelykke is offline
Xanimos
Veteran Member
Join Date: Apr 2005
Location: Florida
Old 08-30-2005 , 09:08  
#4

Code:
for(new i = 1; i <= get_maxplayers() ; i++) { //Here you usually put an if() | ( is_user_alive(i) ) or ( is_user_connected(i) )     client_cmd(i,"command"); }
Xanimos is offline
Send a message via AIM to Xanimos Send a message via MSN to Xanimos
jeppelykke
Member
Join Date: May 2005
Location: Hjørring, Denmark
Old 08-30-2005 , 09:14  
#5

Cool thanx, i try have a look at it.

Thank you once again...
__________________
Best Regards
Jeppe Lykke, Denmark
jeppelykke is offline
XxAvalanchexX
Veteran Member
Join Date: Oct 2004
Location: abort73.com
Old 08-30-2005 , 13:57  
#6

Ugh, I'm tired of people doing silly things like that.... it's just like going from get_maxplayers() to the max entity count to perform actions on an entity.

Code:
new players[32], num, i; get_players(players, num); for(i=0;i<num;i++) {    client_cmd(players[i],"command"); }
__________________
No longer around. Thanks your support, everyone! As always:
THIS ONES FOR YOU
3000 PTS
XxAvalanchexX is offline
Johnny got his gun
Veteran Member
Join Date: Jan 2004
Location: Tokyo
Old 08-30-2005 , 14:25  
#7

Quote:
Originally Posted by Suicid3
Code:
for(new i = 1; i <= get_maxplayers() ; i++) { //Here you usually put an if() | ( is_user_alive(i) ) or ( is_user_connected(i) )     client_cmd(i,"command"); }
Avoid function calls in loops. get_maxplayers() would be called up to 32 times here.

Code:
new const MAXPLAYERS = get_maxplayers() for (new i = 1; i <= MAXPLAYERS; i++)     client_cmd(i, "command")
Here only called one time.
Johnny got his gun is offline
Devin
Junior Member
Join Date: Mar 2006
Old 03-19-2006 , 17:14  
#8

can someone just tell me the cmd to do in consle?
__________________
Hello plz +karma not -karma
Devin is offline
BAILOPAN
Join Date: Jan 2004
Old 03-19-2006 , 17:16  
#9

locked, you just bumped a very old post. one more thing like this and you're banned.
__________________
egg
BAILOPAN is offline
Closed Thread



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 14:20.


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