Not opening.. - 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: Not opening.. (
/showthread.php?tid=391970)
Not opening.. -
phil_lendon - 12.11.2012
I have two gates
pawn Код:
new impoundgate1;
new impoundgate2;
impoundgate1 = CreateDynamicObject(3049, 1901.51, -1865.99, 14.65, 0.00, 0.00, 0.00); //gate1
impoundgate2 = CreateDynamicObject(3050, 1892.43, -1865.98, 14.65, 0.00, 0.00, 180.00); //gate2
and I have the commands to open/close
pawn Код:
if(!strcmp(cmdtext, "/open", true)){
MoveObject(impoundgate1, 1901.51, -1865.99, 14.65, 0.00, 0.00, 274.66);
MoveObject(impoundgate2, 1892.43, -1865.98, 14.65, 0.00, 0.00, 266.03);
SendClientMessage(playerid, 0x0000BBAA, "Impound Opened");
return 1;
}
if(!strcmp(cmdtext, "/close", true)){
MoveObject(impoundgate1, 1901.51, -1865.99, 14.65, 0.00, 0.00, 0.00);
MoveObject(impoundgate2, 1892.43, -1865.98, 14.65, 0.00, 0.00, 180.00);
SendClientMessage(playerid, 0xAA3333AA, "Impound Closed");
return 1;
}
return 1;
}
}
The coords are right.. I think.. /open changes the coords so the doors are open and sideways making space and /close sets them shut.. I do it ic and get the message impound open/closed but doesnt do anythinh?
Re: Not opening.. -
XtremeR - 12.11.2012
this will work:
pawn Код:
if(!strcmp(cmdtext, "/open", true)){
MoveDynamicObject(impoundgate1, 1901.51, -1865.99, 14.65, 2.0);
MoveDynamicObject(impoundgate2, 1892.43, -1865.98, 14.65, 2.0);
SendClientMessage(playerid, 0x0000BBAA, "Impound Opened");
return 1;
}
if(!strcmp(cmdtext, "/close", true)){
MoveDynamicObject(impoundgate1, 1901.51, -1865.99, 14.65, 2.0);
MoveDynamicObject(impoundgate2, 1892.43, -1865.98, 14.65, 2.0);
SendClientMessage(playerid, 0xAA3333AA, "Impound Closed");
return 1;
}
return 1;
}
}