What callback should i use ? -
AnonScripter - 09.05.2014
Hey guys i put this marker as DynamicObject in the interiors, what callback should i use? to check if the player in the marker or not ? to send him to outside of the interior.
Re: What callback should i use ? -
AnonScripter - 09.05.2014
Quote:
Originally Posted by Ralfie
Hmm, you created it as an object...
|
Is there another method ?
Quote:
Originally Posted by Ralfie
try IsPlayerInTheRangeOfPoint, with the coords of the object
|
yeah i tried this, but i found a problem then, there are about 10 of 24/7 stores in the server, so i use virtual worlds, so how to use "IsPlayerInRangeOfPoint and check which virtual world is the player in ? cause each of virtual worlds has it's exit coordinates.
Re: What callback should i use ? -
Beckett - 09.05.2014
If the virtual world change the coordinates wont change, and you still can check if the player is at X,Y,Z location what is wrong with that?
Re: What callback should i use ? -
AnonScripter - 09.05.2014
Quote:
Originally Posted by Ralfie
Another method ? :)
CreatePickup(1559, 1, 0.0, 0.0, 5.0, -1);
public OnPlayerPickUpPickup(playerid, pickupid)
|
i think of that, but i think this will destroy the pickup maybe and will not create it again?
#This is the first time i'll use pickups in the server, so i don't know how it should work, that's why i'm asking :)
Quote:
Originally Posted by DaniceMcHarley
If the virtual world change the coordinates wont change, and you still can check if the player is at X,Y,Z location what is wrong with that?
|
Well here you go: Imagine that i have 2 stores with the same interior ids, but different places in map, 1 in Las Venturas and the other in San Fierro, so it must be there a different virtual worlds too.
So each object "1559" in these 2 stores must have different exit positions, the first 1 must send the player outside the store in las venturas and the other one must send the player outside the store in SF.
if you didn't get it, see this:
pawn Код:
if(IsPlayerInRangeOfPoint(playerid, 1.0, -12.232, 145.22, 14.2222) //The object that is in the store of LV (Virual World = 1)
{
SetPlayerInterior(playerid, 0);
SetPlayerVirtualWorld(playerid, 0);
SetPlayerPos(playerid, 43.44, 23.665, 3433.444); //outside the store that is in LV
}
if(IsPlayerInRangeOfPoint(playerid, 1.0, -12.232, 145.22, 14.2222) //The object that is in the store of SF (Same Coordinates) (Virual World = 2)
{
SetPlayerInterior(playerid, 0);
SetPlayerVirtualWorld(playerid, 0);
SetPlayerPos(playerid, 234.4222, 2343.2303, 2346.4421); //Not same coordinates because this store's outside in SF not LV
}
//So it will make a bug because IsPlayerInRangeOfPoint has the same coordinates but different outside coordinates, so that's the problem.
Re: What callback should i use ? -
Beckett - 09.05.2014
Ohh, I understand now but try checking for the virtual world too?
E.g:
pawn Код:
if(IsPlayerInRangeOfPoint(playerid, 1.0, -12.232, 145.22, 14.2222) //The object that is in the store of LV (Virual World = 1)
{
if(GetPlayerVirtualWorld(playerid) == 1)
{
SetPlayerInterior(playerid, 0);
SetPlayerVirtualWorld(playerid, 0);
SetPlayerPos(playerid, 43.44, 23.665, 3433.444); //outside the store that is in LV
}
}
Like that? ^^^
Re: What callback should i use ? -
AnonScripter - 09.05.2014
Is this possible ? o_O
Can i use GetPlayerVirtualWorld in "if" statement ?
Re: What callback should i use ? -
Beckett - 09.05.2014
Well I think so, just try it?
Re: What callback should i use ? -
Twizted - 09.05.2014
Quote:
Originally Posted by AnonScripter
Is this possible ? o_O
Can i use GetPlayerVirtualWorld in "if" statement ?
|
You can.
pawn Код:
if(GetPlayerVirtualWorld(playerid) == /*virtual world here*/)
{
// code.
}
Re: What callback should i use ? -
Beckett - 09.05.2014
Quote:
Originally Posted by Twizted
You can.
pawn Код:
if(GetPlayerVirtualWorld(playerid) == /*virtual world here*/) { // code. }
|
That's what I have exactly wrote ^
Re: What callback should i use ? -
AnonScripter - 09.05.2014
Thanks all for helping, Worked!