Help - giving +Rep -
Peter Alex - 22.07.2012
I'll explain really brief:
I made a mapping literally inside the building, but whenever I enter I get pushed down out of it, regardless the floor's solidity, that's due to the collision, so the only way I can make it compatible is use the Removebuildingforplayer function. I need a script that when you /enter the area to removebuildingforplayer, and to removebuildingforplayer only when you are inside, at the wall's maximum X,Y,Z distance.
I tried doing it myself using IsPlayerInArea, however I suck too much at Pawno, therefore I request your help.
I only need the pattern, I'll place the top coordonates myself.
Cheers.
Re: Help - giving +Rep -
Kindred - 22.07.2012
pawn Код:
CMD:enter(playerid, params[])
{
if(IsPlayerInRangeOfPoint(playerid, blablabla)) // checks if in range of the /enter point
{
SetPlayerPos(playerid, NewPosX, NewPosY, NewPosZ); //Sets there new position
RemoveBuildingForPlayer(playerid, .....);
return 1;
}
else if(IsPlayerInRangeOfPoint(playerid, blablabla)) // Checks if near the exit door
{
SetPlayerPos(playerid, OldPosX, OldPosY, OldPosZ);
}
return 1;
}
Like this? BTW, if you are trying to restore the building after it is removed, it is not possible.
Re: Help - giving +Rep -
[MM]RoXoR[FS] - 22.07.2012
Remove Restore Building
Re: Help - giving +Rep -
Kindred - 22.07.2012
- Removed -
Re: Help - giving +Rep -
Peter Alex - 22.07.2012
Quote:
Originally Posted by Kindred
pawn Код:
CMD:enter(playerid, params[]) { if(IsPlayerInRangeOfPoint(playerid, blablabla)) // checks if in range of the /enter point { SetPlayerPos(playerid, NewPosX, NewPosY, NewPosZ); //Sets there new position RemoveBuildingForPlayer(playerid, .....); return 1; } else if(IsPlayerInRangeOfPoint(playerid, blablabla)) // Checks if near the exit door { SetPlayerPos(playerid, OldPosX, OldPosY, OldPosZ); } return 1; }
Like this? BTW, if you are trying to restore the building after it is removed, it is not possible.
|
The problem with this is that probably when somebody'll approach the exterior side of the building, it will be removed as well. I need something that calculates only the range of the interior (I have recorded the top X & Y points - the building is a L shaped one, therefore two pair of coordonates:
170.14, -152.19
145.39, -159.22
&
171.84, -153.91
162.93, -178.30
)
Re: Help - giving +Rep -
Kindred - 22.07.2012
Uhhh, it only works if they do /enter AT that point within the distance of the IsPlayerInRangeOfPoint.
So lets say I'm just walking around near the position, it would not be removed unless I /enter.
Re: Help - giving +Rep -
Peter Alex - 22.07.2012
Quote:
Originally Posted by Kindred
Uhhh, it only works if they do /enter AT that point within the distance of the IsPlayerInRangeOfPoint.
So lets say I'm just walking around near the position, it would not be removed unless I /enter.
|
The mapping is a request that will be used on a server with other 5000 /enter teleports. What should I do?
Re: Help - giving +Rep -
Kindred - 22.07.2012
You can always make a seperate IsPlayerInRangeOfPoint if the other one does not remove the building (obviously).
I don't think it would be that much of a waste of lines.
Re: Help - giving +Rep -
Peter Alex - 22.07.2012
Alright, thanks for the help.
+Rep.
Re: Help - giving +Rep -
Peter Alex - 22.07.2012
I have a problem:
Quote:
E:\SA-MP Server\gamemodes\Server.pwn(83) : error 001: expected token: ",", but found "-rational value-"
E:\SA-MP Server\gamemodes\Server.pwn(83) : error 001: expected token: ";", but found ")"
E:\SA-MP Server\gamemodes\Server.pwn(83) : error 029: invalid expression, assumed zero
E:\SA-MP Server\gamemodes\Server.pwn(83) : fatal error 107: too many error messages on one line
|
Код:
if (strcmp("/enter", cmdtext, true, 10) == 0)
{
if(IsPlayerInRangeOfPoint(playerid, 1.0, 172.66, -152.10, 1.72)) // checks if in range of the /enter point
{
SetPlayerPos(playerid, 170.75, -153.94, 1.81); //Sets there new position
RemoveBuildingForPlayer(playerid, 13200, 158.3594, -176.3047, 5.5703, 0.25);
RemoveBuildingForPlayer(playerid, 12923, 158.3594, -176.3047, 5.5703, 0.25);
return 1;
}
else if(IsPlayerInRangeOfPoint(playerid, 7.0 170.85, -153.85, 1.48)) // Checks if near the exit door
{
SetPlayerPos(playerid, 172.24, -152.26, 1.81);
}
return 1;
}