Moving gate problem
#1

Hello i used this filterscript , and it says that the gate is opening but is not ://

pawn Код:
#include <a_samp> // As usual, add this include to the top so your script will work.
#include <streamer> // For CreateDynamicObject and MoveDynamicObject
#include <ZCMD> // For Easy Command

new gate; // The objectid your gate will be using
new timer[MAX_PLAYERS]; // Creates your auto-closing timer
//Add these two ABOVE your OnFilterScriptInit() or OnGameModeInit()

public OnFilterScriptInit() // or OnGameModeInit() if you are using a gamemode
{
    gate = CreateObject(980,1281.5000000,-614.7999900,103.5000000,0.0000000,0.0000000,24.5000000); //object(airportgate) (2)
    // Place this under OnFilterScriptInit(), or OnGameModeInit() if you are using it in a gamemode.
}

CMD:gate(playerid, params[])
{
          if(IsPlayerInRangeOfPoint(playerid, 15, 1281.5000000,-614.7999900,103.5000000)) // Will detect whether they are near the gate or not
           { // It is recommended you set the RangeOfPoint to the coordinates of your 'closed' gate
           MoveDynamicObject(gate, 1281.5000000,-614.7999900,99.5000000, 3);
           SendClientMessage(playerid, 0xEF994300, "The gate is opening and will close in 10 seconds."); // Send the player that typed /open, this message
           timer[playerid] = SetTimerEx("gateclose",10000,false,"i",playerid); // Will activate a timer called 'gateclose' after 10 seconds, once the player has typed 'open'. Does not repeat itself.
           // If you want to change timer: 1 Second = 1000, 5 seconds = 5000, 40 seconds = 40000, 1 minute = 60000 etc.
          }
    }


forward gateclose(); //Defines our 'gateclose' timer when a player types /open, and what we want the gate to do
public gateclose()
{
      MoveDynamicObject(gate, 1281.5000000,-614.7999900,99.5000000, 3);
      // which will be the same as the position in your FilterScriptInit()
}
Reply
#2

That's because you created a "normal" object and not a dynamic one, change it to:
pawn Код:
gate = CreateDynamicObject(980,1281.5000000,-614.7999900,103.5000000,0.0000000,0.0000000,24.5000000);
Reply
#3

the gate is not closing after 10 sec :// sad
Reply
#4

forward gateclose();
timer[playerid] = SetTimer("gateclose",10000,false);
Reply
#5

No , its not that option , i set MoveDynamicObject(gate, 1281.5000000,-614.7999900,99.5000000, 3);
// which will be the same as the position in your FilterScriptInit() to first pisition

99.5000000 = 99.50000 and its working ..
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)