Raised This Month: $ Target: $400
 0% 

Multi Argument cmds


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
DarlD
Senior Member
Join Date: Aug 2004
Old 12-26-2005 , 17:21   Multi Argument cmds
Reply With Quote #1

im trying to create a cmd that will allow the player to define multiple options.
ex.: amx_slap <target> <damage> <times>

I dont really have any idea on how to approche this.

i though maybe a read_argv would do it.[/small]
__________________
DarlD is offline
Send a message via MSN to DarlD
v3x
Veteran Member
Join Date: Oct 2004
Location: US
Old 12-26-2005 , 17:27  
Reply With Quote #2

Code:
new arg1[33], arg2[33], arg3[33]; read_argv(1, arg1, 32); read_argv(2, arg2, 32); read_argv(3, arg3, 32); new target = cmd_target(id, arg1, 0); new damage = str_to_num(arg2); new times = str_to_num(arg3);
__________________
What am I doing these days? Well, I run my own Rust server. It's heavily modded. If you'd like to join, the ip is 167.114.101.67:28116

I also created a website called Rust Tools. It will calculate and tell you the raw amounts of resources needed to craft items.
v3x is offline
teame06
i have a hat
Join Date: Feb 2005
Location: Hat City
Old 12-26-2005 , 17:28  
Reply With Quote #3

Blah... v3x beat me.
__________________
No private support via Instant Message
GunGame:SM Released
teame06 is offline
Send a message via AIM to teame06
Wolle
Member
Join Date: Jun 2005
Location: Berlin / Germany
Old 12-26-2005 , 18:07  
Reply With Quote #4

I though these";" aren't necessary when scripting in PAWN?
Wolle is offline
Send a message via AIM to Wolle
teame06
i have a hat
Join Date: Feb 2005
Location: Hat City
Old 12-26-2005 , 18:22  
Reply With Quote #5

No, it not needed.
__________________
No private support via Instant Message
GunGame:SM Released
teame06 is offline
Send a message via AIM to teame06
Brad
AMX Mod X Team Member
Join Date: Jun 2004
Old 12-26-2005 , 19:05  
Reply With Quote #6

Not needed but I would argue that it's a good habit to get into. Especially so if you plan on expanding on your programming skills.
Brad is offline
Wolle
Member
Join Date: Jun 2005
Location: Berlin / Germany
Old 12-27-2005 , 06:06  
Reply With Quote #7

Quote:
Originally Posted by Brad
Not needed but I would argue that it's a good habit to get into. Especially so if you plan on expanding on your programming skills.
Good point, as long this behaviour doesn't cause the code to behave funny at some point.
Wolle is offline
Send a message via AIM to Wolle
Twilight Suzuka
bad
Join Date: Jul 2004
Location: CS lab
Old 12-27-2005 , 11:47  
Reply With Quote #8

They are needed, if you don't want to end up with fifty billion errors if you make a stupid mistake.
__________________
Twilight Suzuka is offline
Send a message via AIM to Twilight Suzuka Send a message via MSN to Twilight Suzuka
Wolle
Member
Join Date: Jun 2005
Location: Berlin / Germany
Old 12-27-2005 , 11:51  
Reply With Quote #9

Quote:
Originally Posted by Twilight Suzuka
They are needed, if you don't want to end up with fifty billion errors if you make a stupid mistake.
Do you have an example?
Just so I know what to look for.
Wolle is offline
Send a message via AIM to Wolle
Reply


Thread Tools
Display Modes

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 15:55.


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