Hier mal 2 Methoden:
(Empfehle dir Methode 2)
//Methode 1
new bool:LSPDTuer1,
bool:LSPDTuer2;
if (strcmp("/pdtuer", cmdtext, true, 10) == 0)
{
if(!IstSpielerInFraktion(playerid, 1))return SendClientMessage(playerid,ROT, "Du bist kein Beamter.");
if (IsPlayerInRangeOfPoint(playerid,3.0, 250.48875, 64.26849, 1002.59192)){ // LSPD DOOR 1
if(!LSPDTuer1){
MoveDynamicObject (LSPDinnen1, 250.48875, 64.26849, 1002.59192,3);
LSPDTuer1 = true;
}
else if(LSPDTuer1){
MoveDynamicObject (LSPDinnen1,250.48875, 62.26849, 1002.59192,3);
LSPDTuer1 = false;
}
}
else if (IsPlayerInRangeOfPoint(playerid,3.0, 245.46582, 72.40785, 1002.59192)){ // LSPD DOOR 2
if(!LSPDTuer2){
MoveDynamicObject (LSPDinnen2,245.46582, 72.40785, 1002.59192,3);
LSPDTuer2 = true;
}
else if(LSPDTuer2){
MoveDynamicObject (LSPDinnen2,245.46582, 70.40785, 1002.59192,3);
LSPDTuer2 = false;
}
}
return 1;
}
//Methode 2
new bool:LSPDTuer1,
bool:LSPDTuer2;
if (strcmp("/pdtuer", cmdtext, true, 10) == 0)
{
if(!IstSpielerInFraktion(playerid, 1))return SendClientMessage(playerid,ROT, "Du bist kein Beamter.");
if (IsPlayerInRangeOfPoint(playerid,3.0, 250.48875, 64.26849, 1002.59192)){ // LSPD DOOR 1
if(!LSPDTuer1)MoveDynamicObject (LSPDinnen1, 250.48875, 64.26849, 1002.59192,3);
else if(LSPDTuer1)MoveDynamicObject (LSPDinnen1,250.48875, 62.26849, 1002.59192,3);
return LSPDTuer1 = !LSPDTuer1;
}
else if (IsPlayerInRangeOfPoint(playerid,3.0, 245.46582, 72.40785, 1002.59192)){ // LSPD DOOR 2
if(!LSPDTuer2)MoveDynamicObject (LSPDinnen2,245.46582, 72.40785, 1002.59192,3);
else if(LSPDTuer2)MoveDynamicObject (LSPDinnen2,245.46582, 70.40785, 1002.59192,3);
return LSPDTuer2 = !LSPDTuer2;
}
return 1;
}
//Edit: Achja, das Problem war, dass du ein "DynamicObject" erstellt hast, aber versucht hast, es mit "MoveObject" zu bewegen.. -> "MoveDynamicObject"