Is this right? - 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Is this right? (
/showthread.php?tid=147093)
Is this right? -
Luis- - 10.05.2010
Код:
if (strcmp("/enter", cmdtext, true) == 0)
{
SetPlayerPos(playerid, 4060.2734,-196.4038,59.2456); // Hospital, ID 0!
SetPlayerInterior(playerid, 0);
SetPlayerPos(playerid, 375.962463,-65.816848,1001.507812); // Burger Shot, ID 10!
SetPlayerInterior( playerid, 10);
return 1;
}
When i do /enter at the Hospital it just TP's me to the Burger shot?
Re: Is this right? -
Ragidon - 10.05.2010
You're telling it to move to 2 places. First the hospital, then the Burger shot. Use IsPlayerInRangeOfPoint.
https://sampwiki.blast.hk/wiki/IsPlayerInRangeOfPoint
e.g.
pawn Код:
if(!strcmp("/stadium",cmdtext))
{
if(IsPlayerInRangeOfPoint(playerid, 7.0, 2695.6880, -1704.6300, 11.8438))
{
SendClientMessage(playerid,0xFFFFFFFF,"You are near the Stadium entrance!");
}
else
{
SendClientMessage(playerid,0xFFFFFFFF,"You are not near the Stadium entrance!");
}
return 1;
}
Re: Is this right? -
ViruZZzZ_ChiLLL - 10.05.2010
Because the SetPlayerInterior(playerid, 0(wrong id)) is wrong
find the one that your looking for here
https://sampwiki.blast.hk/wiki/InteriorIDs
or here
http://weedarr.wikidot.com/interior
Oh w8, so you must /enter whenever you are near a checkpoint of the building?
Re: Is this right? -
Luis- - 10.05.2010
Quote:
Originally Posted by Ragidon
You're telling it to move to 2 places. First the hospital, then the Burger shot. Use IsPlayerInRangeOfPoint.
https://sampwiki.blast.hk/wiki/IsPlayerInRangeOfPoint
e.g.
pawn Код:
if(!strcmp("/stadium",cmdtext)) { if(IsPlayerInRangeOfPoint(playerid, 7.0, 2695.6880, -1704.6300, 11.8438)) { SendClientMessage(playerid,0xFFFFFFFF,"You are near the Stadium entrance!"); } else { SendClientMessage(playerid,0xFFFFFFFF,"You are not near the Stadium entrance!"); } return 1; }
|
Okay, I dont actually get what you mean?
Re: Is this right? -
Luis- - 10.05.2010
Quote:
Originally Posted by ViruZZzZ_ChiLLL
|
Yes.
Re: Is this right? -
Luis- - 10.05.2010
Bump?
Re: Is this right? -
ViruZZzZ_ChiLLL - 10.05.2010
Sorry but I don't know these sort of things

But it will be a lot easier if you make it OnPlayerEnterCheckPoint

without the command
Re: Is this right? -
Torran - 10.05.2010
Its putting you in burger shot because your doing this:
Your setting the players pos to coordinates for the hospital, You then change the interior for hospital. ID 0
Then after all that you set the players pos to coordinates for burger short, You then change the interior for burger shot. ID 10
So your putting the player in hospital and then as soon as thats done it puts you in burgershot, Use IsPlayerInRangeOfPoint to check if player is near a burger shot enterance or hospital