20.08.2012, 04:17
Title, basically. Which streamer or code should I use for barriers or just openable gates?
#include <a_samp>
new Gate, bool:GateClosed = true;
public OnGameModeInit()
{
Gate = CreateObject(16775, 400.93, 2482.12, 19.52, 3.14, 0.0, 0.0, 0.0, 100.0);
return 1;
}
CMD:/gate(playerid, params[])
{
if(GateClosed){
if(IsPlayerInRangeOfPoint(playerid, 0.00, 400.93, 2482.12, 19.52, 3.14)){
GateClosed = false;
MoveObject(Gate, 403.99, 2482.45, 19.52, 3.14, 3.0, 0.0, 0.0, 0.0);
return SendClientMessage(playerid, 0xFFFFFFFF, "You have open this gate");
}
}
else{
if(IsPlayerInRangeOfPoint(playerid, 0.00, 400.93, 2482.12, 19.52, 3.14)){
GateClosed = true;
MoveObject(Gate, 400.93, 2482.12, 19.52, 3.14, 3.0, 0.0, 0.0, 0.0);
return SendClientMessage(playerid, 0xFFFFFFFF, "You have close this gate");
}
}
}