Raised This Month: $ Target: $400
 0% 

Argument question


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
nooblet
New Member
Join Date: Dec 2005
Old 04-23-2007 , 01:00   Argument question
Reply With Quote #1

Alright, so I was curious if you could make an argument a string and have it where a user types a weapon and it enters it (for an include) here is an example of what I am trying to say:

myowninclue.inc
Code:
stock give_gun(index, weapon) {     give_item(index, "weapon_" + weapon) }

So they can decide on which weapon they are going to give to a player. Is this possible or what?
nooblet is offline
pRED*
Join Date: Dec 2006
Old 04-23-2007 , 01:16   Re: Argument question
Reply With Quote #2

Code:
stock give_gun(index, weapon[10]) {     new weaponname[20]     format(weaponname,19,"weapon_%s",weapon)          give_item(index, weaponname) }

Should work I think...
pRED* is offline
nooblet
New Member
Join Date: Dec 2005
Old 04-23-2007 , 01:22   Re: Argument question
Reply With Quote #3

Thanks a LOT! I am going to try that right now (wondering why I didn't think of that >_>)
__________________
Project Status
NooBX.inc - 70%
NooBX.amxx - 40%
nooblet is offline
PM
hello, i am pm
Join Date: Jan 2004
Location: Canalization
Old 04-23-2007 , 13:39   Re: Argument question
Reply With Quote #4

Because it is completly unintuitive unless you know how strings work in Pawn.
__________________
hello, i am pm
PM is offline
pRED*
Join Date: Dec 2006
Old 04-23-2007 , 18:15   Re: Argument question
Reply With Quote #5

Pawn needs pointers and structs...
So much easier..
pRED* is offline
Styles
Veteran Member
Join Date: Jul 2004
Location: California
Old 04-23-2007 , 23:10   Re: Argument question
Reply With Quote #6

no no leave that shit to c++ please lol

also unintuitive BIG word lol.
Styles is offline
Send a message via AIM to Styles
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 06:43.


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