SA-MP Forums Archive
[Help]Auto Gates - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: [Help]Auto Gates (/showthread.php?tid=177336)



[Help]Auto Gates - Alex_Valde - 17.09.2010

Hello,
How can i make gates when someone open them....they will open and close after some time...

Heres what I have...

This Is For "/Opengate"
pawn Код:
if(IsPlayerInRangeOfPoint(playerid,10.0,1582.62548828,-1638.09887695,12.37568665))
            {
       SetObjectRot(pGate2, 0.00000000,0.00000000,268.00000000);
       MoveObject(pGate3, 1595.74658203,-1638.20373535,14.15229225, 2.500000);
       SendClientMessage(playerid, COLOR_BLUE," You opened the gates of the Police Department. They will close automatically after 7 secunds.");
       SetTimer("pGateak", 7000, 1);
     return 1;
            }
And this is what should this timer do.... But doesn't seems to work :S
pawn Код:
public pGateak()
{
    SetObjectRot(pGate2, 0.00000000,0.00000000,268.00000000);
    MoveObject(pGate3, 1595.74658203,-1638.20373535,14.15229225, 2.500000);
}
And if is possible send a message to the player that gates have been closed...?


Re: [Help]Auto Gates - Thebest96 - 17.09.2010

try to remove setobject rot


Re: [Help]Auto Gates - Alex_Valde - 17.09.2010

Quote:
Originally Posted by Thebest96
Посмотреть сообщение
try to remove setobject rot
I tried that now...but still doesn't work :S


Re: [Help]Auto Gates - Cameltoe - 17.09.2010

pawn Код:
public pGateak()
{
    SetObjectRot(pGate2, 0.00000000,0.00000000,268.00000000);
    MoveObject(pGate3, 1595.74658203,-1638.20373535,14.15229225, 2.500000);
}
Is for closing the gate right? how come its the same Rotation as open gate? Ain't a wonder its not working lol


Re: [Help]Auto Gates - Alex_Valde - 17.09.2010

Quote:
Originally Posted by Cameltoe
Посмотреть сообщение
pawn Код:
public pGateak()
{
    SetObjectRot(pGate2, 0.00000000,0.00000000,268.00000000);
    MoveObject(pGate3, 1595.74658203,-1638.20373535,14.15229225, 2.500000);
}
Is for closing the gate right? how come its the same Rotation as open gate? Ain't a wonder its not working lol
OMFG!!!
LMAO
Dude thanks I was trying to get that work for last half hour.....
Never knew there would be an mistake :S


Re: [Help]Auto Gates - Cameltoe - 17.09.2010

We all do mistakes every now and then


Re: [Help]Auto Gates - Alex_Valde - 17.09.2010


And one more question..How can I send player message when gates are closed...? I can't do that with SendClientMessage(..... :S


Re: [Help]Auto Gates - Cameltoe - 17.09.2010

edit so it match this:

pawn Код:
// In the command:
SetTimerEx("pGateak", 7000, false, "%i", playerid)

// the function
public pGateak(playerid)
{
    SetObjectRot(pGate2, 0.00000000,0.00000000,268.00000000);
    MoveObject(pGate3, 1595.74658203,-1638.20373535,14.15229225, 2.500000);
    SendClientMessage(playerid, COLOR, "Gate closing");
}
This will only send The message to the player that opened the gate.

To send to all in range do this:
pawn Код:
for(new i; i < MAX_PLAYERS; i++)
{
     if(IsPlayerConnected(i))
     {
          if(IsPlayerInRange(i, 7, 7, GATE_X, GATE_Y, GATE_Z)
          {
                SendClientMessage(playerid, COLOR, "Gate closing");
          }
     }
}
Put that in the timer


Re: [Help]Auto Gates - Alex_Valde - 17.09.2010

Quote:
Originally Posted by Cameltoe
Посмотреть сообщение
edit so it match this:

pawn Код:
public pGateak(playerid)
{
    SetObjectRot(pGate2, 0.00000000,0.00000000,268.00000000);
    MoveObject(pGate3, 1595.74658203,-1638.20373535,14.15229225, 2.500000);
     SendClientMessage(playerid, COLOR, "Gate closing");
}
I tried that already and I get this error
Код:
C:\Users\CrTheVirus\Desktop\Samp Server\[SAMP 0.3] - Razer\gamemodes\razer.pwn(25654) : error 017: undefined symbol "playerid"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.
And my 25654 line is:
Код:
 
SendClientMessage(playerid, COLOR_BLUE, "Gate closing");



Re: [Help]Auto Gates - Cameltoe - 17.09.2010

Read my post once more please