GTA Közösség - A magyar GTA fórum

San Andreas Multiplayer (SA-MP) => SA-MP: Szerverfejlesztés => Segítségkérés => A témát indította: N@rbirock - 2012. április 02. - 20:18:12

Cím: kapú zárás
Írta: N@rbirock - 2012. április 02. - 20:18:12
   MozgoKapu = CreateObject(3578,2727.19921875,2609.79980469,10.39999962,0.00000000,0.00000000,5.99853516); //object(dockbarr1_la) (1)
    SetTimer( \"Mozgasd\", 1000, true );
public Mozgasd()
{
for( new playerid = 0; playerid < MAX_PLAYERS; playerid++ )
{
if( IsPlayerConnected(playerid) )
{
   if( IsPlayerInRangeOfPoint( playerid, 10.0, 2727.3582, 2609.0698, 10.6719 ) )
   if(IsPlayerInAnyVehicle(playerid))
   {
       MoveObject( MozgoKapu, 2727.19995117,2609.80004883,8.60000038, 2.5 ); // Zárt
   }
   else
   {
       MoveObject( MozgoKapu, -1630.80004883,-2722.60009766,50.70000076, 2.5 ); // Nyitott
   }
}
}
}

 
ezt hogy lehet megoldani hogy miután kinyilt 30másodperc mulva bezárul
Cím: kapú zárás
Írta: Rexii - 2012. április 02. - 20:36:46
Ennyi információval nem tudok rajtad segíteni!
Cím: kapú zárás
Írta: Bazsi - 2012. április 02. - 20:41:32
Létre hozol egy timert, amit akkor indítasz el, amikor kinyitod a kaput és utána a timer publica alá berakod a MoveObjectet a zárt koordinátákkal. :D
Cím: kapú zárás
Írta: Gabor.. - 2012. április 02. - 20:44:33
new Mozgokapu;
public OnGameModeInit()
{
   MozgoKapu = CreateObject(3578,2727.19921875,2609.79980469,10.39999962,0.00000000,0.00000000,5.99853516); //object(dockbarr1_la) (1)
   SetTimer( \"Mozgasd\", 1000, true );
   return 1;
}
public Mozgasd()
{
for( new playerid = 0; playerid < MAX_PLAYERS; playerid++ )
{
if( IsPlayerConnected(playerid) )
{
   if(IsPlayerInRangeOfPoint( playerid, 10.0, 2727.3582, 2609.0698, 10.6719 ) )
                        {
       if(IsPlayerInAnyVehicle(playerid))
      {
           MoveObject( MozgoKapu, -1630.80004883,-2722.60009766,50.70000076, 2.5 );
                                SetTimerEx(\"Zar\",30000,0,\"i\",playerid);
      }
                        }
}
}
        return 1;
}
forward Zar();
public Zar()
{
    MoveObject( MozgoKapu, 2727.19995117,2609.80004883,8.60000038, 2.5 );
    return 1;
}

 Ez elvileg jó lesz.
Cím: kapú zárás
Írta: N@rbirock - 2012. április 02. - 20:57:21
nem zárja be
Cím: kapú zárás
Írta: Gabor.. - 2012. április 02. - 21:02:13
new Mozgokapu, ztimer;
public OnGameModeInit()
{
   MozgoKapu = CreateObject(3578,2727.19921875,2609.79980469,10.39999962,0.00000000,0.00000000,5.99853516); //object(dockbarr1_la) (1)
   SetTimer( \"Mozgasd\", 1000, true );
   return 1;
}
public Mozgasd()
{
for( new playerid = 0; playerid < MAX_PLAYERS; playerid++ )
{
if( IsPlayerConnected(playerid) )
{
   if(IsPlayerInRangeOfPoint( playerid, 10.0, 2727.3582, 2609.0698, 10.6719 ) )
                        {
       if(IsPlayerInAnyVehicle(playerid))
      {
           MoveObject( MozgoKapu, -1630.80004883,-2722.60009766,50.70000076, 2.5 );
                                ztimer = SetTimer(\"Zar\", 30000, false);
      }
                        }
}
}
        return 1;
}
forward Zar();
public Zar()
{
    MoveObject( MozgoKapu, 2727.19995117,2609.80004883,8.60000038, 2.5 );
    return 1;
}

Esetleg így?
Cím: kapú zárás
Írta: N@rbirock - 2012. április 02. - 21:09:06
D:\\Trucking_Server_2.0\\gamemodes\\Truck.pwn(6974) : warning 204: symbol is assigned a value that is never used: \"ztimer\"
Pawn compiler 3.2.3664           Copyright © 1997-2006, ITB CompuPhase
1 Warning.
Cím: kapú zárás
Írta: Gabor.. - 2012. április 02. - 21:13:45
new Mozgokapu;
public OnGameModeInit()
{
   MozgoKapu = CreateObject(3578,2727.19921875,2609.79980469,10.39999962,0.00000000,0.00000000,5.99853516); //object(dockbarr1_la) (1)
   SetTimer( \"Mozgasd\", 1000, true );
   return 1;
}
public Mozgasd()
{
for( new playerid = 0; playerid < MAX_PLAYERS; playerid++ )
{
if( IsPlayerConnected(playerid) )
{
   if(IsPlayerInRangeOfPoint( playerid, 10.0, 2727.3582, 2609.0698, 10.6719 ) )
                        {
       if(IsPlayerInAnyVehicle(playerid))
      {
           MoveObject( MozgoKapu, -1630.80004883,-2722.60009766,50.70000076, 2.5 );
                                SetTimer(\"Zar\", 30000, false);
      }
                        }
}
}
        return 1;
}
forward Zar();
public Zar()
{
    MoveObject( MozgoKapu, 2727.19995117,2609.80004883,8.60000038, 2.5 );
    return 1;
}

Akkor így próbáld meg. :D Ezek szerint akkor ide nemjó a \'SetTimerEx\' Mert azt mondtad, hogy úgy nem zárja be.
Cím: kapú zárás
Írta: N@rbirock - 2012. április 02. - 21:25:19
D:\\Trucking_Server_2.0\\gamemodes\\Truck.pwn(6974) : warning 202: number of arguments does not match definition
D:\\Trucking_Server_2.0\\gamemodes\\Truck.pwn(6974) : warning 202: number of arguments does not match definition
Pawn compiler 3.2.3664           Copyright © 1997-2006, ITB CompuPhase
2 Warnings.
Cím: kapú zárás
Írta: Gabor.. - 2012. április 02. - 21:37:10
new Mozgokapu;
public OnGameModeInit()
{
   MozgoKapu = CreateObject(3578,2727.19921875,2609.79980469,10.39999962,0.00000000,0.00000000,5.99853516); //object(dockbarr1_la) (1)
   SetTimer( \"Mozgasd\", 1000, true );
   return 1;
}
public Mozgasd()
{
for( new playerid = 0; playerid < MAX_PLAYERS; playerid++ )
{
if( IsPlayerConnected(playerid) )
{
   if(IsPlayerInRangeOfPoint( playerid, 10.0, 2727.3582, 2609.0698, 10.6719 ) )
                        {
       if(IsPlayerInAnyVehicle(playerid))
      {
           MoveObject( MozgoKapu, -1630.80004883,-2722.60009766,50.70000076, 2.5 );
                                SetTimerEx(\"Zar\",30000,0,\"i\",playerid);
      }
                        }
}
}
        return 1;
}
forward Zar();
public Zar()
{
    MoveObject( MozgoKapu, 2727.19995117,2609.80004883,8.60000038, 2.5 );
    return 1;
}

Akkor maradt ez a megoldás.  :hmmm: Ha nemjó, akkor máshol van a bibi szerintem nem a timerral.