I got problem with gate pw when i tyoe /hgate and you not put password and only click open and the gate open how to fix it?
Код:
if(dialogid == 22)
{
if(response)
{
for(new i = 0; i < sizeof(GateInfo); i++)
{
new Float:X, Float:Y, Float:Z;
GetDynamicObjectPos(GateInfo[i][gGATE], X, Y, Z);
if (IsPlayerInRangeOfPoint(playerid,GateInfo[i][gRange], X, Y, Z))
{
if(strcmp(inputtext, GateInfo[i][gPass], true) == 0)
{
if(GateInfo[i][gStatus] == 0)
{
MoveDynamicObject(GateInfo[i][gGATE], GateInfo[i][gPosXM], GateInfo[i][gPosYM], GateInfo[i][gPosZM], GateInfo[i][gSpeed]);
SetDynamicObjectRot(GateInfo[i][gGATE], GateInfo[i][gRotXM],GateInfo[i][gRotYM],GateInfo[i][gRotZM]);
GateInfo[i][gStatus] = 1;
}
else
{
MoveDynamicObject(GateInfo[i][gGATE], GateInfo[i][gPosX], GateInfo[i][gPosY], GateInfo[i][gPosZ], GateInfo[i][gSpeed]);
SetDynamicObjectRot(GateInfo[i][gGATE], GateInfo[i][gRotX],GateInfo[i][gRotY],GateInfo[i][gRotZ]);
GateInfo[i][gStatus] = 0;
}
}
}
}
if(IsPlayerInRangeOfPoint(playerid, 20.0, 658.95,-1311.08,12.25))// Josh Sol's House - ID 275
{
if(strcmp(inputtext, House275Password) == 0)
{
format( string, sizeof( string ), "* %s uses their remote to open the gates.", GetPlayerNameEx( playerid ) );
ProxDetector(10.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
House275GateControl(1, 1);
SetTimerEx("House275GateControl", 6000, 0, "ii", 1, 0);
}
else return SendClientMessageEx(playerid, COLOR_GRAD2, " Invalid Password.");
}
else if(IsPlayerInRangeOfPoint(playerid, 20.0, 661.76,-1221.51,13.87))
{
if(strcmp(inputtext, House275Password) == 0)
{
format( string, sizeof( string ), "* %s uses their remote to open the gates.", GetPlayerNameEx( playerid ) );
ProxDetector(10.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
House275GateControl(0, 1);
SetTimerEx("House275GateControl", 6000, 0, "ii", 0, 0);
}
else return SendClientMessageEx(playerid, COLOR_GRAD2, " Invalid Password.");
}
else if(IsPlayerInRangeOfPoint(playerid, 20, 787.17,-1158.40,22.23))
{
if(strcmp(inputtext, House275Password) == 0)
{
format( string, sizeof( string ), "* %s uses their remote to open the gates.", GetPlayerNameEx( playerid ) );
ProxDetector(10.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
House275GateControl(2, 1);
SetTimerEx("House275GateControl", 6000, 0, "ii", 2, 0);
}
else return SendClientMessageEx(playerid, COLOR_GRAD2, " Invalid Password.");
}
else if(IsPlayerInRangeOfPoint(playerid, 20, 2185.5706,-1765.8832,13.3753))
{
if(strcmp(inputtext, House63Password) == 0)
{
if(House63GateStatus == 0)
{
format( string, sizeof( string ), "* %s uses their remote to open the gates.", GetPlayerNameEx( playerid ) );
ProxDetector(10.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
SetDynamicObjectRot(House63Gate, 0, 0, 0);
House63GateStatus = 1;
}
else
{
format( string, sizeof( string ), "* %s uses their remote to close the gates.", GetPlayerNameEx( playerid ) );
ProxDetector(10.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
SetDynamicObjectRot(House63Gate, 0, 90, 0);
House63GateStatus = 0;
}
}
else return SendClientMessageEx(playerid, COLOR_GRAD2, " Invalid Password.");
}
else if(IsPlayerInRangeOfPoint(playerid, 5, 1282.2277,-783.3154,1089.9375))
{
if(strcmp(inputtext, House310Password) == 0)
{
if(House310GateStatus[0] == 0)
{
format( string, sizeof( string ), "* %s uses their remote to open the gates.", GetPlayerNameEx( playerid ) );
ProxDetector(10.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
MoveDynamicObject(House310Gate[0], 1270.46154785,-783.73199463,1088.41235352, 4);
House310GateStatus[0] = 1;
}
else
{
format( string, sizeof( string ), "* %s uses their remote to close the gates.", GetPlayerNameEx( playerid ) );
ProxDetector(10.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
MoveDynamicObject(House310Gate[0], 1278.46154785,-783.73199463,1088.41235352, 4);
House310GateStatus[0] = 0;
}
}
else return SendClientMessageEx(playerid, COLOR_GRAD2, " Invalid Password.");
}
else if(IsPlayerInRangeOfPoint(playerid, 5, 1240.8258,-833.5141,1084.0078))
{
if(strcmp(inputtext, House310Password) == 0)
{
if(House310GateStatus[1] == 0)
{
format( string, sizeof( string ), "* %s uses their remote to open the gates.", GetPlayerNameEx( playerid ) );
ProxDetector(10.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
MoveDynamicObject(House310Gate[1], 1240.41088867,-834.78045654,1073.92053223, 4);
House310GateStatus[1] = 1;
}
else
{
format( string, sizeof( string ), "* %s uses their remote to close the gates.", GetPlayerNameEx( playerid ) );
ProxDetector(10.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
MoveDynamicObject(House310Gate[1], 1240.41088867,-834.78045654,1076.92053223, 4);
House310GateStatus[1] = 0;
}
}
else return SendClientMessageEx(playerid, COLOR_GRAD2, " Invalid Password.");
}
else if(IsPlayerInRangeOfPoint(playerid, 5, 1270.3916,-802.0000,1084.0078))
{
if(strcmp(inputtext, House310Password) == 0)
{
if(House310GateStatus[2] == 0)
{
format( string, sizeof( string ), "* %s uses their remote to open the gates.", GetPlayerNameEx( playerid ) );
ProxDetector(10.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
MoveDynamicObject(House310Gate[2], 1266.72741699,-802.41290283,1080, 4);
House310GateStatus[2] = 1;
}
else
{
format( string, sizeof( string ), "* %s uses their remote to close the gates.", GetPlayerNameEx( playerid ) );
ProxDetector(10.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
MoveDynamicObject(House310Gate[2], 1266.72741699,-802.41290283,1082.54785156, 4);
House310GateStatus[2] = 0;
}
}
else return SendClientMessageEx(playerid, COLOR_GRAD2, " Invalid Password.");
}
else if(IsPlayerInRangeOfPoint(playerid, 5, 1264.2648,-808.5170,1084.0078))
{
if(strcmp(inputtext, House310Password) == 0)
{
if(House310GateStatus[3] == 0)
{
format( string, sizeof( string ), "* %s uses their remote to open the gates.", GetPlayerNameEx( playerid ) );
ProxDetector(10.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
MoveDynamicObject(House310Gate[3], 1264.66577148,-814.11694336,1080, 4);
House310GateStatus[3] = 1;
}
else
{
format( string, sizeof( string ), "* %s uses their remote to close the gates.", GetPlayerNameEx( playerid ) );
ProxDetector(10.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
MoveDynamicObject(House310Gate[3], 1264.66577148,-814.11694336,1082.54785156, 4);
House310GateStatus[3] = 0;
}
}
else return SendClientMessageEx(playerid, COLOR_GRAD2, " Invalid Password.");
}
return 1;
}
}