Help Scripting: Automatic Gates
#1

Hi I have not been on samp for a while now, since some Fucker Hacked my samp furum account. :L
But I have got it back some how and any way I need Help scripting some automatic gates. I have looked around on the furum and only found people makeing them open with a command! BUT that's not what I want. I have tryed to scripted them before but that was Fucking Disastrous, turns out I Cant scripted at all realy.

Thanks much If any one can help me PS if you just going to Fucking mown about it and not help Dont bother please

This is how i would like it to work: There are to Doors (Gates) that need to move At the same time. also I need them to open when you get close, just like The Garages on GTA SA that you put your cars in (on single player)
also if they could close when your out of range. Thanks Much XxJoexX
Reply
#2

Lets be simple.
I think when I show you this you know what to do.
you have to put it at onplayerupdate.
pawn Код:
if(IsPlayerInRangeOfPoint(playerid, 8.0, 2236.2317,2453.1025,10.7190))
{

    MoveObject(object name,2237.4597167969, 2460.5595703125,9.7953128814697, 2.0);
return 1;
}
Reply
#3

Thanks But I dont know much about scripting I would not have no idea what to do with the information you have just gave me How would I pop it in to the script?
Reply
#4

Ok little explanation
if(IsPlayerInRangeOfPoint(playerid, 8.0, 2236.2317,2453.1025,10.7190))
This means that if the player is near this coordiantes
2236.2317,2453.1025,10.7190
The 8 means how far away he is. 8.0 is very close.
You can get this coordinates by typing /save in samp.

Now when he is in range of that point this will happen
MoveObject(object name,2237.4597167969, 2460.5595703125,9.7953128814697, 2.0);

The object will move to that position.
MoveObject(objectname,model.X,Y,Z, Speed);

You can create this object with map editor. I recommed MTA.

now you need this at top of script: new objectname;

and this at ongamemodeinit
objectname = CreateObject(3117, 2368.4323730469, 2447.1782226563, -61.81510925293, 0, 270, 0);

That should be it
Reply
#5

Your the Man!!!!! (or woman)
Thanks That is Now in plain English
Reply
#6

hahah thanks.:P And yup. I'm a man xD
And if you nee further assistance I can help you. I like to help people if I can.
But now I have to work. Good luck on making your automatic gates.!
Reply
#7

Il tell you how I get on Thanks
Reply
#8

Hello, I am also creating automatic gates. I have gotten the coding completely done but the problem is the gates are not moving. I know the coordinates have to be right becuase I have a cmd set up to open the gate also and it works perfect. Please help.
Reply
#9

Blade. I really have to go now. But post the script of the automatic gate here.
Reply
#10

pawn Код:
//somewhere in the script
forward TriadGateTimer(playerid);
forward TriadGateClose();

pawn Код:
public TriadGateTimer(playerid)
{
    if(IsPlayerConnected(playerid))
    {
        if(IsPlayerInRangeOfPoint(playerid, 35, 2226.834961, -2208.018066, 12.713753))
        {
            if(PlayerInfo[playerid][pMember] == 34 || PlayerInfo[playerid][pLeader] == 34)
            {
                MoveDynamicObject(TriadGate, 2233.078857, -2214.286621, 12.713753, 3.5);
                SendClientMessage(playerid, COLOR_GOLD, "Please be patient while the gate to this facility is opening.");
                SetTimer("TriadGateClose", 1000, 0);
            }
        }
    }
    return 1;
}

public TriadGateClose()
{
    MoveDynamicObject(TriadGate, 2226.834961, -2208.018066, 12.713753, 3.5);
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)