Hey
Ich habe hier jede menge tore die sich per Hupen öffnen. nun möchte ich dir auch wieder schließen
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if(newkeys == 2)
{
if(IsPlayerInRangeOfPoint(playerid,35.0,785.21752929688,-1152.5002441406,25.338731765747))
{
if(IsPlayerInAnyVehicle(playerid))
{
if((gTeam[playerid] == Team_Lcn) || (gTeam[playerid] == Team_Cops_LS) || (gTeam[playerid] == Team_Cops_SF) || (gTeam[playerid] == Team_Cops_LV) || (gTeam[playerid] == Team_Army))
{
MoveObject(Gate,785.19549560547,-1152.5858154297,19.337205886841,5);
SendClientMessage(playerid,0x00FFFFFF," Das Tor wird geöffnet, mit /lcnzu3 schließt es sich wieder!");
SetTimer("TorZu",7000,5);
}
}
}
if(IsPlayerInRangeOfPoint(playerid,35.0,659.38079833984, -1226.9169921875, 17.772813796997))
{
if((gTeam[playerid] == Team_Lcn) || (gTeam[playerid] == Team_Cops_LS) || (gTeam[playerid] == Team_Cops_SF) || (gTeam[playerid] == Team_Cops_LV) || (gTeam[playerid] == Team_Army))
{
MoveObject(Tor,659.38079833984, -1226.9169921875, 11.933019638062,5);
SendClientMessage(playerid,0x00FFFFFF," Das Tor schließt sich automatisch!");
SetTimer("TorZua",7000,5);
}
}
if(IsPlayerInRangeOfPoint(playerid,35.0,664.91796875, -1309.1516113281, 15.234329223633))
{
if((gTeam[playerid] == Team_Lcn) || (gTeam[playerid] == Team_Cops_LS) || (gTeam[playerid] == Team_Cops_SF) || (gTeam[playerid] == Team_Cops_LV) || (gTeam[playerid] == Team_Army))
{
MoveObject(Tora,664.91796875, -1309.1516113281, 9.2983379364014,5);
SendClientMessage(playerid,0x00FFFFFF," Das Tor schließt sich automatisch!");
SetTimer("TorZub",7000,5);
}
}
if(IsPlayerInRangeOfPoint(playerid,35.0,1588.3731689453, -1637.9205322266, 15.202335357666))
{
if((gTeam[playerid] == Team_Cops_LS) || (gTeam[playerid] == Team_Cops_SF) || (gTeam[playerid] == Team_Cops_LV || gTeam[playerid] == Team_Army))
{
MoveObject(Torb,1588.3731689453, -1637.9205322266, 9.0614814758301,5);
SendClientMessage(playerid,0x00FFFFFF," Das Tor schließt sich automatisch!");
SetTimer("TorZuc",7000,5);
}
}
if(IsPlayerInRangeOfPoint(playerid,35.0,-1625.0412597656, 688.38006591797, 8.9608917236328))
{
if((gTeam[playerid] == Team_Cops_LS) || (gTeam[playerid] == Team_Cops_SF) || (gTeam[playerid] == Team_Cops_LV || gTeam[playerid] == Team_Army))
{
MoveObject(sfpdtora,-1612.5405273438, 688.38006591797, 8.9608917236328,5);
MoveObject(sfpdtorb,-1646.3940429688, 688.61962890625, 8.9608917236328,5);
SendClientMessage(playerid,0x00FFFFFF," Das Tor schließt sich automatisch!");
SetTimer("sfpd",7000,5);
}
}
if(IsPlayerInRangeOfPoint(playerid,35.0,214.324509, 1875.621460, 13.821650))
{
if(gTeam[playerid] == Team_Army)
{
MoveObject(Torc,221.486938, 1875.621460, 13.821650,5);
SendClientMessage(playerid,0x00FFFFFF," Das Tor schließt sich automatisch!");
SetTimer("Armya",7000,5);
}
}
if(IsPlayerInRangeOfPoint(playerid,35.0,344.927734, 1797.697021, 20.162949))
{
if(gTeam[playerid] == Team_Army)
{
MoveObject(Tord,335.799896, 1792.531616, 20.162949,5);
SendClientMessage(playerid,0x00FFFFFF," Das Tor schließt sich automatisch!");
SetTimer("Armyb",7000,5);
}
}
if(IsPlayerInRangeOfPoint(playerid,35.0,2561.2890625, 1687.5361328125, 12.601446151733))
{
if((gTeam[playerid] == Team_Yakis) || (gTeam[playerid] == Team_Cops_LS) || (gTeam[playerid] == Team_Cops_SF) || (gTeam[playerid] == Team_Cops_LV || gTeam[playerid] == Team_Army))
{
MoveObject(yaki1,2561.2890625, 1687.5361328125, 6.3437042236328,5);
MoveObject(yaki2,2561.2890625, 1698.9415283203, 6.3437042236328,5);
SendClientMessage(playerid,0x00FFFFFF," Das Tor schließt sich automatisch!");
SetTimer("yakia",7000,5);
}
}
if(IsPlayerInRangeOfPoint(playerid,35.0,2521.0141601563, 1817.2668457031, 12.593704223633))
{
if((gTeam[playerid] == Team_Yakis) || (gTeam[playerid] == Team_Cops_LS) || (gTeam[playerid] == Team_Cops_SF) || (gTeam[playerid] == Team_Cops_LV || gTeam[playerid] == Team_Army))
{
MoveObject(yaki3,2521.0141601563, 1817.2668457031, 6.0937042236328,5);
MoveObject(yaki4,2521.0141601563, 1828.8211669922, 6.0937042236328,5);
SendClientMessage(playerid,0x00FFFFFF," Das Tor schließt sich automatisch!");
SetTimer("yakib",7000,5);
}
}
if(IsPlayerInRangeOfPoint(playerid,35.0,-505.68963623047, 2593.0224609375, 55.247055053711))
{
if((gTeam[playerid] == Team_Aq) || (gTeam[playerid] == Team_Cops_LS) || (gTeam[playerid] == Team_Cops_SF) || (gTeam[playerid] == Team_Cops_LV) || (gTeam[playerid] == Team_Army))
{
MoveObject(aq,-505.68963623047, 2593.0224609375, 49.200023651123,5);
SendClientMessage(playerid,0x00FFFFFF," Das Tor schließt sich automatisch!");
SetTimer("alq",7000,5);
}
}
if(IsPlayerInRangeOfPoint(playerid,35.0,2237.5051269531, 2448.4162597656, 9.7439851760864))
{
if((gTeam[playerid] == Team_Cops_LS) || (gTeam[playerid] == Team_Cops_SF) || (gTeam[playerid] == Team_Cops_LV) || (gTeam[playerid] == Team_Army))
{
MoveObject(lvpd1,2237.5051269531, 2458.0124511719, 9.7439851760864,5);
SendClientMessage(playerid,0x00FFFFFF," Das Tor schließt sich automatisch!");
SetTimer("lvpda",7000,5);
}
}
if(IsPlayerInRangeOfPoint(playerid,35.0,2293.984375, 2497.3408203125, 5.0468287467957))
{
if((gTeam[playerid] == Team_Cops_LS) || (gTeam[playerid] == Team_Cops_SF) || (gTeam[playerid] == Team_Cops_LV) || (gTeam[playerid] == Team_Army))
{
MoveObject(lvpd2,2293.984375, 2497.3408203125, -1.3090114593506,5);
SendClientMessage(playerid,0x00FFFFFF," Das Tor schließt sich automatisch!");
SetTimer("lvpdb",7000,5);
}
}
if(IsPlayerInRangeOfPoint(playerid,35.0,2335.5688476563, 2444.4643554688, 7.8502683639526))
{
if((gTeam[playerid] == Team_Cops_LS) || (gTeam[playerid] == Team_Cops_SF) || (gTeam[playerid] == Team_Cops_LV) || (gTeam[playerid] == Team_Army))
{
MoveObject(lvpd3,2335.5688476563, 2444.4643554688, 0.69032859802246,5);
SendClientMessage(playerid,0x00FFFFFF," Das Tor schließt sich automatisch!");
SetTimer("lvpdc",7000,5);
}
}
}
return 1;
}