How to make a moveable gate with a rang? - 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: How to make a moveable gate with a rang? (
/showthread.php?tid=480723)
How to make a moveable gate with a rang? -
Le3aT - 12.12.2013
How can i make a moveable gate with a range and if he isn't in rane it will type error or sth
THANKS
Re: How to make a moveable gate with a rang? -
mahdi499 - 12.12.2013
My idea needs ZCMD:
pawn Код:
CMD:/gate(playerid, params[])
{
if(IsPlayerInRangeOfPoint(playerid, Range, GateX, GateY, GateZ)){
// Open gate
} else
{
// You're not in range
}
return 1
}
Re: How to make a moveable gate with a rang? -
Sawalha - 12.12.2013
first at the top of script
pawn Код:
// at OnGameModeIntnew gate
= CreateObject
(modelID, X, Y, Z, X rotation, Y rotation, Z rotation, DrawDistance
);
// you may use samp map editor or if mta map editor, use http://www.convertffs.com to convert an object from mta to samp..
then as example cmd
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
if(!strcmp(cmdtext, "/gate", true))
{
if(IsPlayerInRangeOfPoint(playerid, float:distance, x, y, z)) // check if the player at the place
{
SetObjectPos(gate, X, Y,Z); // you can get the pos when you create the gate opens
}
else // if other
{
SendClientMessage(playerid, RED, "You are not near the gate!");
}
return 1;
}
return 0;
}