AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Argument question (https://forums.alliedmods.net/showthread.php?t=54332)

nooblet 04-23-2007 01:00

Argument question
 
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?

pRED* 04-23-2007 01:16

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

Should work I think...

nooblet 04-23-2007 01:22

Re: Argument question
 
Thanks a LOT! I am going to try that right now (wondering why I didn't think of that >_>)

PM 04-23-2007 13:39

Re: Argument question
 
Because it is completly unintuitive unless you know how strings work in Pawn.

pRED* 04-23-2007 18:15

Re: Argument question
 
Pawn needs pointers and structs...
So much easier..

Styles 04-23-2007 23:10

Re: Argument question
 
no no leave that shit to c++ please lol

also unintuitive BIG word lol.


All times are GMT -4. The time now is 06:43.

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