CMD:gate(playerid, params[])
{
static Float:degree, GateOpen;
degree = 0.5;
while(degree > 360.0) degree -= 360.0;
while(degree < 0.0) degree += 360.0;
if(PlayerInfo[playerid][pTeam] == 6)
{
if(GateOpen == 1)
{
MoveDynamicObject(ObjClosed, -85.40625000,-1120.18261719, degree, 0.5);
//SetDynamicObjectRot(ObjClosed, -85.40625000,-1120.18261719, degree);
GateOpen = 0;
}
else if(GateOpen == 0)
{
MoveDynamicObject(ObjClosed, -85.40692139,-1120.18322754, degree, 0.5);
//SetDynamicObjectRot(ObjClosed, 0.0, 0.0, degree);
GateOpen = 1;
}
}
else
{
SendClientMessage(playerid, COLOR_ORANGE, "INFO: {FFFFFF}You are not an Courier.");
}
return 1;
}
CMD:ogate(playerid, params[])
{
new Float:degree;
degree = 0.3;
if(PlayerInfo[playerid][pTeam] == 6)
{
//MoveDynamicObject(ObjClosed, -85.40625000,-1120.18261719, -0.0001, 0.5);
SetDynamicObjectRot(ObjClosed, -85.40625000,-1120.18261719, -0.0001);
}
else
{
SendClientMessage(playerid, COLOR_ORANGE, "INFO: {FFFFFF}You are not an Courier.");
}
return 1;
}
CMD:cgate(playerid, params[])
{
new Float:degree;
degree = 0.0001;
if(PlayerInfo[playerid][pTeam] == 6)
{
//MoveDynamicObject(ObjClosed, -85.40692139,-1120.18322754, 0.0001, 0.5);
SetDynamicObjectRot(ObjClosed, -85.40692139,-1120.18322754, 0.0001);
}
else
{
SendClientMessage(playerid, COLOR_ORANGE, "INFO: {FFFFFF}You are not a Courier.");
}
return 1;
}
new bool:GATE_STATUS;
COMMAND:gate(playerid,params[])
{
if(PlayerInfo[playerid][pTeam] == 6) {
switch(GATE_STATUS) {
case false:
{
MoveDynamicObject(ObjClosed, -85.40625000,-1120.18261719, 4321, 0.5);
}
case true:
{
MoveDynamicObject(ObjClosed, -85.40692139,-1120.18322754, 1234, 0.5);
}
}
}
else {
return SendClientMessage(playerid, COLOR_ORANGE, "INFO: {FFFFFF}You are not an Courier.");
}
return true;
}
public OnDynamicObjectMoved(objectid)
{
switch(objectid) {
case ObjClosed:
{
new Float:x, Float:y, Float:z;
GetDynamicObjectPos(ObjClosed, x, y, z);
if(x == -85.40625000 && y == -1120.18261719 && z == 4321) {
GATE_STATUS = true;
}
else if(x == -85.40625000 && y == -1120.18261719 && z == 1234) {
GATE_STATUS = false;
}
}
}
return true;
}
...the coords are messed up, I know they're the correct ones though.
|
public OnDynamicObjectMoved(objectid)
{
switch(objectid) {
case ObjClosed: // This line.
{
SendClientMessageToAll(COLOR_YELLOW, "ObjClosed object found.");
new Float:x, Float:y, Float:z, string[128];
SendClientMessageToAll(COLOR_YELLOW, "Getting Coords.");
GetDynamicObjectPos(ObjClosed, x, y, z);
SendClientMessageToAll(COLOR_YELLOW, "Matching coords.");
if(GATE_STATUS == 0) {
GATE_STATUS = 1;
format(string, sizeof(string), "GATE: X = %f, Y = %f, Z = %f. Gate Status = %d", x, y, z, GATE_STATUS);
SendClientMessageToAll(COLOR_YELLOW, string);
}
else if(GATE_STATUS == 1) {
SendClientMessageToAll(COLOR_YELLOW, "Matching Coords #2");
GATE_STATUS = 0;
format(string, sizeof(string), "GATE: X = %f, Y = %f, Z = %f. Gate Status = %d", x, y, z, GATE_STATUS);
SendClientMessageToAll(COLOR_YELLOW, string);
}
}
}
return 1;
}
error 008: must be a constant expression; assumed zero