MoveDynamicObject - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Server (
https://sampforum.blast.hk/forumdisplay.php?fid=6)
+--- Forum: Server Support (
https://sampforum.blast.hk/forumdisplay.php?fid=19)
+--- Thread: MoveDynamicObject (
/showthread.php?tid=423866)
MoveDynamicObject -
Hussain - 19.03.2013
Sorry once again but i've bumped into a error....
I've made my command for the gates
Код:
CMD:mf(playerid, params[])
{
if(IsPlayerInRangeOfPoint(playerid, 10.0,324.6000100,-1185.6999500,75.4000000)) {
if (PlayerOrg[playerid] == 1) {
if(GateOpen == 0) {
MoveDynamicObject(gate, 969,318.1000100,-1190.9000200,75.4000000,0.0000000,0.7500000,218.2500000);// OPEN COORDS
GateOpen = 1;
}
else {
MoveDynamicObject(Gate, 969,324.6000100,-1185.6999500,75.4000000,0.0000000,0.7500000,218.2500000);// CLOSED COORDS
GateOpen = 0;
}
}
else return 0;
}
else {
SendClientMessage(playerid, COLOR_WHITE, "You are not in range of the gate.");
}
return 1;
}
Okay only thing is My gate shows up but when i do /mf
the gate disappears

can anyone help?
Re: MoveDynamicObject -
Hussain - 19.03.2013
Coords of my gates:
Код:
969,318.1000100,-1190.9000200,75.4000000,0.0000000,0.7500000,218.2500000 // gate open
969,324.6000100,-1185.6999500,75.4000000,0.0000000,0.7500000,218.2500000 // GATE CLOSED
Retrieved these using a MTA Converter
Re : MoveDynamicObject -
thegreathom - 19.03.2013
pawn Код:
CMD:gate(playerid,params[])
{
if(IsPlayerInRangeOfPoint(playerid, 10.0,324.6000100,-1185.6999500,75.4000000))//Gate 1
{
switch(Open)//Check whether the gate opened or closed
{
case true://If the gate opened
{
MoveObject(Gate,1428.6456, 242.0033, 20.3020,4);//Close the gate
Open = false;//false for closed
}
case false://If the gate closed
{
MoveObject(Gate,1426.5259, 237.4716, 20.3020,4);//Open the gate
Open = true;//true for opened
}
}
return 1;
}
SendClientMessage(playerid,ORANGE,"You're not close enough to the gate.");// Error message
return 1;
}
I don't use your coordinates, so now you will work on it

.
Re: Re : MoveDynamicObject -
Hussain - 19.03.2013
Quote:
Originally Posted by thegreathom
pawn Код:
CMD:gate(playerid,params[]) { if(IsPlayerInRangeOfPoint(playerid, 10.0,324.6000100,-1185.6999500,75.4000000))//Gate 1 { switch(Open)//Check whether the gate opened or closed { case true://If the gate opened { MoveObject(Gate,1428.6456, 242.0033, 20.3020,4);//Close the gate Open = false;//false for closed } case false://If the gate closed { MoveObject(Gate,1426.5259, 237.4716, 20.3020,4);//Open the gate Open = true;//true for opened } } return 1; } SendClientMessage(playerid,ORANGE,"You're not close enough to the gate.");// Error message return 1; }
I don't use your coordinates, so now you will work on it  .
|
fixed it a while ago but thanks