IsPlayerInRangeOfPOint issue
#1

Hello guys,

So i have IsPlayerInRangeOfPoint and yes, its working completely fine exept i have changed the Virtual world that players are in when this is used and it no longer works.

If the player is in world 0 it works however if in any other world it does not.

Here is my code..

Код:
public OnPlayerUpdate(playerid)
{

	if(IsPlayerInRangeOfPoint(playerid, 12.0, 997.0865,-7995.4355,44.1828))
	{

	if(IsPlayerInRangeOfPoint(playerid, 12.0, 248.5794,3768.5403,24.7804))
	{
	    if(PlayerWinner[playerid] == 0)
	    {
	        new mystring[200], name[200];
         	GetPlayerName(playerid, name, 24);
          	format(mystring, 128, "{FF0000}(%s (%d)){00FFFC} Has Completed Skydive Challenge!(/sdc) And Earned 50 Score! ", name, playerid);
           	SendClientMessageToAll(-1,  mystring);
           	SetPlayerScore(playerid, GetPlayerScore(playerid) + 50);
	        PlayerWinner[playerid] = 1;
	        SetPlayerPos(playerid, 413.7531,2454.8821,16.4844);
	        SetPlayerVirtualWorld(playerid, 0);
	    }
	}
If anybody could tell me a solution it would be great..

P.S The world the player is in is Virtual World 3. Thanks
Reply
#2

This is a really bad use of OnPlayerUpdate() and IsPlayerInRangeOfPoint() when all you need is dynamic areas.
Reply
#3

Код:
public OnPlayerUpdate(playerid)
{

	if(IsPlayerInRangeOfPoint(playerid, 12.0, 997.0865,-7995.4355,44.1828))
	{

	if(IsPlayerInRangeOfPoint(playerid, 12.0, 248.5794,3768.5403,24.7804))//Is this like inside this ^ one?
	{ 
	    if(PlayerWinner[playerid] == 0)
	    {
	        new mystring[200], name[200];
         	GetPlayerName(playerid, name, 24);
          	format(mystring, 128, "{FF0000}(%s (%d)){00FFFC} Has Completed Skydive Challenge!(/sdc) And Earned 50 Score! ", name, playerid);
           	SendClientMessageToAll(-1,  mystring);
           	SetPlayerScore(playerid, GetPlayerScore(playerid) + 50);
	        PlayerWinner[playerid] = 1;
	        SetPlayerPos(playerid, 413.7531,2454.8821,16.4844);
	        SetPlayerVirtualWorld(playerid, 0);
	    }
	}
Edit: If you are using 128 for mystring and 24 for name[=LIMIT].. Use "new mystring[128], name[24]".. It aint gonna fix anything but will save memory..
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)