Hall oLeute.
Ich habe da ein problem und zwar wollte ich das die Tore nach einer bestimmten Zeit Automatisch zu gehen. Jedoch geht das nicht. Bei meinem O-Amt Tor geht es Automatisch wieder zu. Habe vom O-Amt das mit dem SetTimer übernommen und es auch mal ohne dieses TowFreeState probiert da dieses für User ist wenn sie ihr Auto freikaufen vom O-Amt und habe bei Public MoveGate das //LSPD Tor hinzugetan. Hier einmal wie ich es gemacht habe:
Code
if(IsPlayerInRangeOfPoint(playerid,10,1588.900, -1638.000, 12.000))
{
if(isPlayerInFrakt(playerid,1) || isPlayerInFrakt(playerid,2) || isPlayerInFrakt(playerid,6) || isPlayerInFrakt(playerid,16) || isPlayerAnAdmin(playerid,6) && Spieler[playerid][pAdminOnduty] == true)
{
if(torstatus[2] == 0)
{
MoveDynamicObject(tor[2], 1588.900, -1638.000, 12.000-4.000,5);
torstatus[2] = 1;
PlayerHearMusicInRange(x,y,z,1035,5,1,500);//x,y,z,soundid,radius,timer an = 1 wenn aus = 0,zeit wann timer music/sound beendet
if(isPlayerInFrakt(playerid,1) || isPlayerInFrakt(playerid,2)|| isPlayerInFrakt(playerid,6)|| isPlayerInFrakt(playerid,11) || isPlayerInFrakt(playerid,16) || TowFreeState[playerid] == 1 || isPlayerAnAdmin(playerid,6) && Spieler[playerid][pAdminOnduty] == true)
{
SendClientMessage(playerid,WEISS,"Das Tor schließt sich in 5 Sekunden wieder!");
SetTimerEx("MoveGate",5000,0,"i",5);
TowFreeState[playerid] = 0;
}
return 1;
}
else
{
MoveDynamicObject(tor[2],1588.900, -1638.000, 12.000,5);
torstatus[2] = 0;
PlayerHearMusicInRange(x,y,z,1035,5,1,500);//x,y,z,soundid,radius,timer an = 1 wenn aus = 0,zeit wann timer music/sound beendet
return 1;
}
}
return SendClientMessage(playerid,GRAU,"Du bist nicht in der jeweiligen Fraktion.");
}
Alles anzeigen
Code
public MoveGate(torid)
{
switch(torid)
{
case 1: // Alkajails
{
if(torstatus[40] == 1) MoveDynamicObject(tor[40],2566.94,-1283.06,1044.36,2),torstatus[40] = 0;
if(torstatus[41] == 1) MoveDynamicObject(tor[41],2563.44,-1283.06,1044.36,2),torstatus[41] = 0;
if(torstatus[42] == 1) MoveDynamicObject(tor[42],2559.96,-1283.06,1044.36,2),torstatus[42] = 0;
if(torstatus[43] == 1) MoveDynamicObject(tor[43],2556.42,-1283.06,1044.36,2),torstatus[43] = 0;
if(torstatus[44] == 1) MoveDynamicObject(tor[44],2552.98,-1283.06,1044.36,2),torstatus[44] = 0;
if(torstatus[45] == 1) MoveDynamicObject(tor[45],2545.96,-1283.06,1044.36,2),torstatus[45] = 0;
if(torstatus[46] == 1) MoveDynamicObject(tor[46],2549.46,-1283.06,1044.36,2),torstatus[46] = 0;
if(torstatus[47] == 1) MoveDynamicObject(tor[47],2542.46,-1283.06,1044.36,2),torstatus[47] = 0;
if(torstatus[48] == 1) MoveDynamicObject(tor[48],2539.00,-1283.06,1044.36,2),torstatus[48] = 0;
if(torstatus[49] == 1) MoveDynamicObject(tor[49],2531.94,-1304.23,1044.36,2),torstatus[49] = 0;
if(torstatus[50] == 1) MoveDynamicObject(tor[50],2535.54,-1304.23,1044.36,2),torstatus[50] = 0;
if(torstatus[51] == 1) MoveDynamicObject(tor[51],2539.00,-1304.23,1044.36,2),torstatus[51] = 0;
if(torstatus[52] == 1) MoveDynamicObject(tor[52],2542.46,-1304.23,1044.36,2),torstatus[52] = 0;
if(torstatus[53] == 1) MoveDynamicObject(tor[53],2545.96,-1304.23,1044.36,2),torstatus[53] = 0;
if(torstatus[54] == 1) MoveDynamicObject(tor[54],2549.46,-1304.23,1044.36,2),torstatus[54] = 0;
if(torstatus[55] == 1) MoveDynamicObject(tor[55],2552.98,-1304.23,1044.36,2),torstatus[55] = 0;
if(torstatus[56] == 1) MoveDynamicObject(tor[56],2556.42,-1304.23,1044.36,2),torstatus[56] = 0;
if(torstatus[57] == 1) MoveDynamicObject(tor[57],2559.96,-1304.23,1044.36,2),torstatus[57] = 0;
if(torstatus[58] == 1) MoveDynamicObject(tor[58],2563.44,-1304.23,1044.36,2),torstatus[58] = 0;
if(torstatus[59] == 1) MoveDynamicObject(tor[59],2566.94,-1304.23,1044.36,2),torstatus[59] = 0;
}
case 3: // schranke an der fahrschule
{
MoveDynamicObject(tor[39],-2043.7734375,-80.568031311035,34.921920776367 - 0.01,0.01,0,270,0);
PlayerHearMusicInRange(-2043.7734375,-80.568031311035,34.921920776367,1035,5,1,500);
torstatus[39] = 0;
return 1;
}
case 4: // oamt tür 1
{
MoveDynamicObject(tor[4],1167.90002, 1362.92004, 10.87000,5);
torstatus[4] = 0;
PlayerHearMusicInRange(1167.90002, 1362.92004, 10.87000,1035,5,1,500);//x,y,z,soundid,radius,timer an = 1 wenn aus = 0,zeit wann timer music/sound beendet
return 1;
}
case 5: // oamt tor
{
MoveDynamicObject(tor[5],1144.25098, 1362.82690, 11.52900,5);
torstatus[5] = 0;
PlayerHearMusicInRange(1144.25098, 1362.82690, 11.52900,1035,5,1,500);//x,y,z,soundid,radius,timer an = 1 wenn aus = 0,zeit wann timer music/sound beendet
return 1;
}
case 6: // Alka Interior Gate
{
MoveDynamicObject(tor[20],2578.0500,-1288.9700,1044.3400,2);
torstatus[20] = 0;
PlayerHearMusicInRange(2578.0500,-1288.9700,1044.3400,1035,5,1,500);//x,y,z,soundid,radius,timer an = 1 wenn aus = 0,zeit wann timer music/sound beendet
return 1;
}
case 7: // Alka Interior Gate
{
MoveDynamicObject(tor[21],2571.5300,-1300.8199,1044.3400,2);
MoveDynamicObject(tor[22],2571.1499,-1300.7900,1044.3400,2);
torstatus[21] = 0;
torstatus[22] = 0;
PlayerHearMusicInRange(2571.5300,-1300.8199,1044.3400,1035,5,1,500);//x,y,z,soundid,radius,timer an = 1 wenn aus = 0,zeit wann timer music/sound beendet
return 1;
}
case 8: // Alka Interior Gate
{
MoveDynamicObject(tor[23],2538.1001,-1285.0200,1050.2800,2);
torstatus[23] = 0;
PlayerHearMusicInRange(2538.1001,-1285.0200,1050.2800,1035,5,1,500);//x,y,z,soundid,radius,timer an = 1 wenn aus = 0,zeit wann timer music/sound beendet
return 1;
}
case 9: //LSPD Tor
{
MoveDynamicObject(tor[2],1588.900, -1638.000, 12.000,5);
torstatus[2] = 0;
PlayerHearMusicInRange(1588.900, -1638.000, 12.000,1035,5,1,500);//x,y,z,soundid,radius,timer an = 1 wenn aus = 0,zeit wann timer music/sound beendet
return 1;
}
}
return print("ERROR: MoveGate public nicht erkannt!");
}
Alles anzeigen