IsPlayerInRangeOfPOint issue - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: IsPlayerInRangeOfPOint issue (
/showthread.php?tid=485579)
IsPlayerInRangeOfPOint issue -
KingyKings - 04.01.2014
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
Re: IsPlayerInRangeOfPOint issue -
Pottus - 04.01.2014
This is a really bad use of OnPlayerUpdate() and IsPlayerInRangeOfPoint() when all you need is dynamic areas.
Re: IsPlayerInRangeOfPOint issue -
Mic_H - 04.01.2014
Код:
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..