OnPlayerText question
#1

Well I was wondering..


I've never worked with OnPlayerText and I'm now trying to find out some more about it.
I tried to make a function where if a player speaks, only players in a radius of 25 could see the message but it didn't work out.

Code:
public OnPlayerText(playerid, text[])
{
	new string[56];
	new PlayerName[MAX_PLAYER_NAME];
	for(new i; i<MAX_PLAYERS; i++)
	new Float:XXX,Float:YYY,Float:ZZZ;
	GetPlayerPos(playerid, XXX, YYY, ZZZ);
	if(IsPlayerInRangeOfPoint(i, 25.0, XXX, YYY, ZZZ))
	{
    format(string, sizeof(string), "%s says: %s",PlayerName,text);
    SendClientMessage(i, 0xFF0000AA, string);
    }
	return 1;
}
Code:
C:\SAMP 0.3b Server R2\gamemodes\Unknown-RP.pwn(72) : error 003: declaration of a local variable must appear in a compound block
C:\SAMP 0.3b Server R2\gamemodes\Unknown-RP.pwn(72) : warning 221: label name "Float" shadows tag name
C:\SAMP 0.3b Server R2\gamemodes\Unknown-RP.pwn(72) : error 017: undefined symbol "XXX"
C:\SAMP 0.3b Server R2\gamemodes\Unknown-RP.pwn(72) : warning 215: expression has no effect
C:\SAMP 0.3b Server R2\gamemodes\Unknown-RP.pwn(73) : error 017: undefined symbol "XXX"
C:\SAMP 0.3b Server R2\gamemodes\Unknown-RP.pwn(74) : error 017: undefined symbol "i"
C:\SAMP 0.3b Server R2\gamemodes\Unknown-RP.pwn(77) : error 017: undefined symbol "i"
C:\SAMP 0.3b Server R2\gamemodes\Unknown-RP.pwn(72) : warning 203: symbol is never used: "Float"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


5 Errors.
So yea, looks like I did something terribly wrong, even though I use this at regular commands using SSCANF.
Heard of something like ProxDetectors but I don't understand shit about that.

If someone could help me out? Thanks
Reply


Messages In This Thread
OnPlayerText question - by Pawno_Master - 04.09.2010, 10:15
Re: OnPlayerText question - by iggy1 - 04.09.2010, 10:20
Re: OnPlayerText question - by Pawno_Master - 04.09.2010, 10:28
Re: OnPlayerText question - by iggy1 - 04.09.2010, 10:29
Re: OnPlayerText question - by General Abe - 04.09.2010, 10:30
Re: OnPlayerText question - by iggy1 - 04.09.2010, 10:37
Re: OnPlayerText question - by Pawno_Master - 04.09.2010, 15:33
Re: OnPlayerText question - by General Abe - 04.09.2010, 17:45

Forum Jump:


Users browsing this thread: 1 Guest(s)