Help with gate - 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: Help with gate (
/showthread.php?tid=173408)
Help with gate -
zack3021 - 02.09.2010
I want my gate to be able to open only when the player is in rang of it.
Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/gateopen", cmdtext, true, 10) == 0)
{
MoveObject(mygate,2705.8347167969, 657.30255126953, 11.070308685303,3.0);
SendClientMessage(playerid,0xFFFF00FF,"You have just opened the Yard gate");
return 1;
}
if (strcmp("/gateclose", cmdtext, true, 10) == 0)
{
MoveObject(mygate,2706.0078125, 652.048828125, 11.070308685303,3.0);
SendClientMessage(playerid,0xFFFF00FF,"You have just closed the Yard gate");
return 1;
}
else
{
SendClientMessage(playerid,0xFF0000FF,"You are too far to open the gate");
return 0;
}
}
Re: Help with gate -
mmrk - 02.09.2010
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/gateopen", cmdtext, true, 10) == 0)
{
if (IsPlayerInRangeOfPoint(playerid,4.0,2705.8347167969, 657.30255126953, 11.070308685303))
{
MoveObject(mygate,2705.8347167969, 657.30255126953, 11.070308685303,3.0);
SendClientMessage(playerid,0xFFFF00FF,"You have just opened the Yard gate");
return 1;
}
else return SendClientMessage(playerid, 0xFFFF00FF, "You are not in range of point");
}
if (strcmp("/gateclose", cmdtext, true, 10) == 0)
{
if (IsPlayerInRangeOfPoint(playerid,4.0,2706.0078125, 652.048828125, 11.070308685303))
{
MoveObject(mygate,2706.0078125, 652.048828125, 11.070308685303,3.0);
SendClientMessage(playerid,0xFFFF00FF,"You have just closed the Yard gate");
return 1;
}
else return SendClientMessage(playerid, 0xFFFF00FF, "You are not in range of point");
}
}
It should work
Re: Help with gate -
CyNiC - 02.09.2010
Use if( IsPlayerInRangeOfPoint(playerid,range,pos X,pos Y,pos Z) ) before of MoveObjects.
Re: Help with gate -
zack3021 - 02.09.2010
I got error 017: undefined symbol "PlayerToPointStripped"
Re: Help with gate -
zack3021 - 02.09.2010
Anybody plz help
Re: Help with gate -
Vince - 02.09.2010
I can't find any PlayerToPointStripped in the code supplied ...
[This forum requires that you wait 120 seconds between posts. Please try again in 11 seconds.] - Dumb.
Re: Help with gate -
CyNiC - 02.09.2010
Quote:
Originally Posted by zack3021
Anybody plz help 
|
Ther user mmrk did upload with the IsPlayerInRangeOfPoint function.
Re: Help with gate -
zack3021 - 02.09.2010
NVM i fixed it.