GTAvision.com - Forum - Grand Theft Auto News, Downloads, Community and more...

Position: Grand Theft Auto: San Andreas » Multiplayer » [SA-MP v2] Objekt Bewegung » Druckansicht
Stalker, 10.08.2007, 21:40
Es stehenn bei mir 2 Tore (als Objekt), die je nach rechts und links "moven" sollen,
irgendwie bewegen die sich je nach vorne und hinten, woran liegts?

Code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
public OnGameModeInit()
{
   SetTimer("OpenGates",50,1);
   gate1 = CreateObject(floatround(Gates[0][0]),Gates[0][1],Gates[0][2],Gates[0][3],0.0,0.0,Gates[0]
[4]);
   gate2 = CreateObject(floatround(Gates[1][0]),Gates[1][1],Gates[1][2],Gates[1][3],0.0,0.0,Gates[1]
[4]);
   return 1;
}

public OpenGates()
{
new Float:X,Float:Y,Float:Z;
for (new a = 0; a < MAX_PLAYERS; a++)
{
if (IsPlayerConnected(a))
{
   GetPlayerPos(a, X,Y,Z);
   new Float:tempX = (Gates[gate1-1][1]-Gates[gate2-1][1])/2;
   new Float:tempY = (Gates[gate1-1][2]-Gates[gate2-1][2])/2;
   new Float:tempZ = (Gates[gate1-1][3]-Gates[gate2-1][3])/2;
   if (X >= Gates[gate1-1][1]-tempX-gRadius && X <= Gates[gate1-1][1]-tempX+gRadius
   && Y >= Gates[gate1-1][2]-tempY-gRadius && Y <= Gates[gate1-1][2]-tempY+gRadius
   && Z >= Gates[gate1-1][3]-tempZ-gRadius && Z <= Gates[gate1-1][3]-tempZ+gRadius)
{
if (AtGates != 1)
   {
      MoveObject(gate1, Gates[gate1-1][1],Gates[gate1-1][2]+gDis,Gates[gate1-1][3], gSpeed);
      MoveObject(gate2, Gates[gate2-1][1],Gates[gate2-1][2]-gDis,Gates[gate2-1][3], gSpeed);
      AtGates = 1;
   }
return 1;
}
}
}
if (AtGates == 1)
   {
      MoveObject(gate1, Gates[gate1-1][1],Gates[gate1-1][2],Gates[gate1-1][3], gSpeed);
      MoveObject(gate2, Gates[gate2-1][1],Gates[gate2-1][2],Gates[gate1-1][3], gSpeed);
   }
AtGates = 0;
return 1;
}


(Ist nur ein Teil des Scriptes) (nicht von mir)
Rafioso, 10.08.2007, 21:51
Naja, ich tippe einfach drauf, dass du x mit y verwechselt hast, oder andersrum y mit x;)

=) =) :D :D =) =)
Stalker, 10.08.2007, 21:55
Könntest du mir vieleicht noch sagen welches X und Y im Script? ;-)
Rafioso, 10.08.2007, 22:09
Ich sag nur:

Code:
1
MoveObject(objectid, Float:X, Float:Y, Float:Z, Float:Speed);


=) =) :D :D =) =)
Stalker, 10.08.2007, 23:46
Ich blick da irgendwie nicht durch. Die Angaben sind doch bei X, Y, Z alle gleich
(also im code oben) oder nicht?

Ich versteh nicht was ich daran ändern muss.. :/
GTAvision.com :: Forumregeln :: FAQ :: Impressum :: Kontakt :: RDRvision.com :: LANOIREvision.com :: MaxPayneVision.com
NetVisionWork.NET
.: © 2006-2014 by GTAvision.com :.

Rockstar GamesTake-Two Interactive Deutschland

Free Grand Theft Auto Downloads