I'm aware thats wrong, "warning: passing arg 2 of `get_eq_char' makes integer from pointer without a cast ". told me so heh. I was wondering if anyone knew how I could get this to work correctly?
Yes, the second argument, what you have as "argument" needs to be one of the defined wear locations, usually of the format "WEAR_*", like " WEAR_DUAL_WIELD", try one of those.
It may be more complicated than a simple atoi, because you might be trying to convert e.g. "body" to WEAR_BODY - atoi("body") will return 0. I'd imagine that there already is a routine written for this (check oset wear, or something like that) but if not it's fairly straightforward to write.
Basicly I'm trying to get it to check if the charecter is wearing what the argument says. I'm sure theres a simple way to go about this, thanks for helping so far, I think I'll check out do_remove. See if maby that can help.
The function get_eq_char() is used for determining what equipment is at a particular location (represented by an integer), not if the argument is worn the player. I'd suggest looking at do_remove as you said, or the mud progs that check is_worn or something like that. In any case it should be a simple linear search over ch->first_carrying to ch->last_carrying, making sure the wearloc is not -1.
Heh, I'm getting better and better at this coding thing, guess I just needed to spend a few hours not doing it. Figured out how, and thanks for the help guys.