> I'm trying to create a function in which users will be able to exchange
"Money." They can do this through a command, with this syntax: givemoney
<part of targetname> <ammount>
>
<snip>
>
> If you could find a solution, i'd appreciate it.
> --

In this code...

  while( ((target = (CBasePlayer *)UTIL_FindEntityByClassname(target,
"player")) != NULL) && !FNullEnt(target->edict())){
   CLIENT_PRINTF(pEntity,print_console,UTIL_VarArgs("Ok"));
   strcpy(targetname,STRING(target->pev->netname));
   buffer = strcasestr(targetname,arg1);

...target->edict() can be non-null, but target>-pev->netname can be NULL.

The engine will reuse player slots after they have been allocated and the
player has left the server.  The edict pointer will still be valid (pointing
to an unused player slot) but the name will be null.  You should test for a
null netname as well as a null edict pointer.

Jeffrey "botman" Broome


_______________________________________________
To unsubscribe, edit your list preferences, or view the list archives, please visit:
http://list.valvesoftware.com/mailman/listinfo/hlcoders

Reply via email to