AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Scooping out pieces of a string (https://forums.alliedmods.net/showthread.php?t=53593)

edeloa 04-07-2007 02:42

Scooping out pieces of a string
 
Hey all,

My ultimate goal is to get the name of the weapon a user is holding. So for example, when a player is holding an AK47, I want to have a variable holding "AK47".

get_weaponname() does something similar ... only it adds "weapon_" in front of the name .... so the AK47 would look like "weapon_AK47".

I'm looking for a way to scoop out "AK47" from "weapon_AK47"

This is what I have so far....
Code:

new weapName[32]
get_weaponname(wepID, weapName, 32)


teame06 04-07-2007 02:48

Re: Scooping out pieces of a string
 
Code:
client_print(0, print_chat, "%s", weapName[7]);

edeloa 04-07-2007 04:17

Re: Scooping out pieces of a string
 
thanks, this is exactly what I needed


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

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