Automatic Gate isn't working
#1

Hey, today I added a gate and I followed every little thing, now, it compiled to an .amx file and I launched the game and the gate didn't move...

If you would like to see a certain section of the script I added, just lemme know!
Reply
#2

If the gate isn't there then post the whole script. If the gate isn't moving then post the part where it checks if the player is near a gate, most probably where IsPlayerInRangeOfPoint is.
Reply
#3

Um, did you make it as a filterscript, or did you add it into your Gamemode script ?
Reply
#4

Quote:
Originally Posted by G4M3Ov3r
Посмотреть сообщение
Um, did you make it as a filterscript, or did you add it into your Gamemode script ?
Gamemode script.
Reply
#5

Now explain how/when you want the gate to move.. Because the gate may have moved as soon as you loaded up the game..
Reply
#6

post the code lol
Reply
#7

Quote:
Originally Posted by RelaxCafe
Посмотреть сообщение
Now explain how/when you want the gate to move.. Because the gate may have moved as soon as you loaded up the game..
When I get so close to the gate.
Reply
#8

Code of the gate please.
Reply
#9

https://sampwiki.blast.hk/wiki/Automatic_Gates Read this <<<<< Helpfull..

if ur bored then..
pawn Код:
OnGameModeInit()
{
    SetTimer("CheckGate1",10,true)
}
forward CheckGate1();
public CheckGate1()
{
    new mygate_status;
    for(new i;i<MAX_PLAYERS;i++)
    {
        if(!IsPlayerConnected(i)) continue;
        if(IsPlayerInRangeOfPoint(i,10.0, {YOUR GATES CO-ORDINATES}))mygate_status=1;
    }
    if(mygate_status)MoveObject(open2,{ CO_ORDINATEs Change the x OR y depending on where u want the gate to move} ,3.0);
    else MoveObject(open2,{GATES CO-ORDINATES},3.0);
   
}
Reply
#10

Quote:
Originally Posted by spd_sahil
Посмотреть сообщение
https://sampwiki.blast.hk/wiki/Automatic_Gates Read this <<<<< Helpfull..

if ur bored then..
pawn Код:
OnGameModeInit()
{
    SetTimer("CheckGate1",10,true)
}
forward CheckGate1();
public CheckGate1()
{
    new mygate_status;
    for(new i;i<MAX_PLAYERS;i++)
    {
        if(!IsPlayerConnected(i)) continue;
        if(IsPlayerInRangeOfPoint(i,10.0, {YOUR GATES CO-ORDINATES}))mygate_status=1;
    }
    if(mygate_status)MoveObject(open2,{ CO_ORDINATEs Change the x OR y depending on where u want the gate to move} ,3.0);
    else MoveObject(open2,{GATES CO-ORDINATES},3.0);
   
}
You called a timer, which will call a callback called "CheckGate", but you named the callback "CheckGate1"
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)