Help Just 2 Simple auto gates
#1

first gate
STand Still At Point CreateDynamicObject(980, 2497.20508, 2779.04443, 12.34830, 0.00000, 0.00000, 90.00000);

Is Open = CreateDynamicObject(980, 2497.20508, 2779.04443, 17.56272, 0.00000, 0.00000, 90.00000);

Second Gate
Stand still At point CreateDynamicObject(980, 2497.36572, 2767.41577, 12.58362, 0.00000, 0.00000, 90.00000);

IS OPen to player to go CreateDynamicObject(980, 2497.36572, 2767.41577, 17.60873, 0.00000, 0.00000, 90.00000);
Can Anyone Help ?
Reply
#2

Sory For Douple Post But i;m Using Call Of Duty Gamemode
Reply
#3

Follow this tutorial:

https://sampforum.blast.hk/showthread.php?tid=279757
Reply
#4

Sory For This Post too

#include <a_samp>
#include <fixes2>
#include <sscanf2>
#include <streamer>
#include <zcmd>
#include <Dini>
#include <Dutils>
#include <FloodControl>
#include <fuckCleo>
#include <lethaldudb2>
#include <SII>
#include <foreach>

that my include
Reply
#5

i cant do that can anyone make alreadt an example For my becuz i always false :\'
Reply
#6

Ok, so first we have to create a variable at the top of the script ( global variable) so the the script can know that you're trying to make a object;
so:
pawn Код:
new Firstgate; //first gate
new Secondgate; //second gate
next , under OnGameModeInit ( when the console is starting ( gamemode))
pawn Код:
Firstgate = CreateDynamicObject(980, 2497.20508, 2779.04443, 12.34830, 0.00000, 0.00000, 90.00000); //assign our gate to the variable, so the compiler will say something like: ok, i'm gonna read this as a object ( gate)
Secondgate = CreateDynamicObject(980, 2497.36572, 2767.41577, 12.58362, 0.00000, 0.00000, 90.00000); //the same as above
then whenever you want to move it
pawn Код:
MoveDynamicObject(Firstgate, 2497.20508, 2779.04443, 17.56272, 5.0, 0.00000, 0.00000, 90.00000); //firstgate, moving it to the open position
MoveDynamicObject(Secondgate, 2497.36572, 2767.41577, 12.58362, 5.0, 0.00000, 0.00000, 90.00000); //the same but for secondgate
Reply
#7

Here's for the first one.
pawn Код:
#include <a_samp>
new FirstGate;
public OnGameModeInit()
{
    FirstGate = CreateObject(980, 2497.20508, 2779.04443, 12.34830, 0.00000, 0.00000, 90.00000);
    SetTimer("OpenGateAuto", 1000, 1);
}
forward OpenGateAuto();
public OpenGateAuto()
{
    new open;
    for(new i=GetMaxPlayers(); i > -1; i--)
    {
        if(IsPlayerConnected(i) && IsPlayerInRangeOfPoint(i, 7.0, 2497.20508, 2779.04443, 12.34830))
        {
            open = 1;
            MoveObject(FirstGate, 2497.20508, 2779.04443, 17.56272, 3.0);
            break;
        }
    }
    if(!open)
        MoveObject(FirstGate, 2497.20508, 2779.04443, 12.34830, 3.0);
}
Just do the same for the second, and you'll be alright.
Auto gate with speed 3, and you need to be in range of 7 meters.
Reply
#8

why only first Gate ?
Reply
#9

seriously Jimmy Your Help not work
Reply
#10

Well make sure you're following and do exactly and it should work.

Go to the top of your script where all your news and add the line below :

pawn Код:
new
gate1,
    gate22;
Go under OnGameModeInit and copy the line below :

pawn Код:
gate1 = CreateDynamicObject(objectid,x,y,z,0.0000000,0.0000000,0.0000000); // x,y,z = where u want ur gate
gate2 = CreateDynamicObject(objectid,x,y,z,0.0000000,0.0000000,0.0000000); // x,y,z = where u want ur gate
The command to open the gates : /opengates
pawn Код:
COMMAND:opengates(playerid, params[])
{
    if(IsPlayerInRangeOfPoint(playerid, 2.0,x,y,z)) // the cords of the gate what u putted under ongamemodeinit
    {
        MoveDynamicObject(gate1,x,y,z,0.50); // x,y,z = where u want it to move!
        SendClientMessage(playerid, 0xFFFFFFFF, "gate has been opened");
        return 1;
    }
 else if(IsPlayerInRangeOfPoint(playerid, 2.0,x,y,z)) x,y,z=cords of 2nd gate
    {
        MoveDynamicObject(gate2,x,y,z,0.50); // x,y,z = where u want it to move
        SendClientMessage(playerid, 0xFFFFFFFF, "gate has been opened");
        return 1;
    }
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)