Raised This Month: $ Target: $400
 0% 

find_player() problem ...


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
TheEagle
Junior Member
Join Date: Oct 2005
Old 10-17-2005 , 21:14   find_player() problem ...
Reply With Quote #1

Ok I'm pretty new to this stuff (last time I wrote a plugin was for amx 0.9.7 ) ... but a friend asked me to write a little plugin and since it didn't seem SO hard to do, I gave it a try. All fine, cept I'm running against a wall using the find_player() function.

Code:
public catch_say(id)
{
	if (g_playermode[id]==0) return PLUGIN_CONTINUE
	new message[192]
	new playername[32]
	new param[32]
	new player = 0
	read_args(message, 191)
	strtok(message,playername,32,param,32,' ')
	player = find_player("bhl",playername)
			
	if (!player) 
	{
		server_cmd("say Couldn't find player with: %s", playername)
		g_playermode[id]=0
		return PLUGIN_CONTINUE
	}
 
...
This function is called when a player "says" something using "messagemode". I then try to extract a playername as first word in the messagetext. But find_player("bhl"...) doesn't return a player number. But in the following error message I see that "playername" has exactly the value I expect it to have (the part of the playername extracted from the message). I also tried with all other flags of "find_player()" ... it's simply not working. But if I hardcode a playername e.g.

Code:
find_player("a","TheEagle")
it works.

Any1 got an idea what I am doing wrong?

(Amxx version 1.60, Metamod 1.18, Windows)
TheEagle is offline
Send a message via ICQ to TheEagle
 



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 23:36.


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