SA-MP Forums Archive
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)
+--- Thread: Gates (/showthread.php?tid=286882)



Gates - [GOD]Dragonster82 - 01.10.2011

Код:
LSPDgate = CreateDynamicObject(980,1546.82165527,-1625.91467285,15.15620422,0.00000000,0.00000000,270.00000000); // LSPD Closed gate ( Used for CMDS )
^
|
|
At gamemodeinit
and
new LSPDgate;
------------------
Код:
COMMAND:openlspd(playerid,params[])
{
	if(LspdIsClosed == 1)
	{
	    new string[128];
	    format(string,sizeof(string),"The LSPD gate has just been opened.");
		SendClientMessage(playerid,COLOR_WHITE,string);
		MoveObject(LSPDgate,1546.82165527,-1625.91467285,15.15620422,2.0);
		LspdIsClosed = 0;
		}
	else
	SendClientMessage(playerid,COLOR_WHITE,"The gate is already open.");
	return 1;
	}
COMMAND:closelspd(playerid,params[])
{
	if(LspdIsClosed == 0)
	{
	    new string[128];
	    format(string,sizeof(string),"The LSPD gate has just been closed.");
	    SendClientMessage(playerid,COLOR_WHITE,string);
	    MoveObject(LSPDgate,1550.04785156,-1625.51953125,15.15620422,2.0);
        LspdIsClosed = 1;
        }
        else
        SendClientMessage(playerid,COLOR_WHITE,"The gate is already closed.");
	return 1;
     }
Not working , gates are NOT moving.


Re: Gates - Dolby - 01.10.2011

invert the coordinates of two commands and test.


Re: Gates - Pharrel - 01.10.2011

you're using CreateDynamicObject so must be MoveDynamicObject

pawn Код:
COMMAND:openlspd(playerid,params[])
{
    if(LspdIsClosed == 1)
    {
        new string[128];
        format(string,sizeof(string),"The LSPD gate has just been opened.");
        SendClientMessage(playerid,COLOR_WHITE,string);
        MoveDynamicObject(LSPDgate,1546.82165527,-1625.91467285,15.15620422,2.0);
        LspdIsClosed = 0;
        }
    else
    SendClientMessage(playerid,COLOR_WHITE,"The gate is already open.");
    return 1;
    }
COMMAND:closelspd(playerid,params[])
{
    if(LspdIsClosed == 0)
    {
        new string[128];
        format(string,sizeof(string),"The LSPD gate has just been closed.");
        SendClientMessage(playerid,COLOR_WHITE,string);
        MoveDynamicObject(LSPDgate,1550.04785156,-1625.51953125,15.15620422,2.0);
        LspdIsClosed = 1;
        }
        else
        SendClientMessage(playerid,COLOR_WHITE,"The gate is already closed.");
    return 1;
     }



Re: Gates - [GOD]Dragonster82 - 01.10.2011

Problem solved, thank you Pharrel, once again you saved my life

*PS* I am very careless.


Re: Gates - Pharrel - 01.10.2011

Quote:
Originally Posted by [GOD]Dragonster82
Посмотреть сообщение
*PS* I am very careless.
I see... kkkkk anything you want just ask


Re: Gates - hydronic - 01.10.2011

Quote:
Originally Posted by Pharrel
Посмотреть сообщение
I see... kkkkk anything you want just ask
Код:
COMMAND:openlspd(playerid,params[])
{
    if(LspdIsClosed == 1)
    {
        new string[128];
        format(string,sizeof(string),"The LSPD gate has just been opened.");
        SendClientMessage(playerid,COLOR_WHITE,string);
        MoveDynamicObject(LSPDgate,1546.82165527,-1625.91467285,5.15620422,2.0);
        LspdIsClosed = 0;
        }
    else
    SendClientMessage(playerid,COLOR_WHITE,"The gate is already open.");
    return 1;
    }
COMMAND:closelspd(playerid,params[])
{
    if(LspdIsClosed == 0)
    {
        new string[128];
        format(string,sizeof(string),"The LSPD gate has just been closed.");
        SendClientMessage(playerid,COLOR_WHITE,string);
        MoveDynamicObject(LSPDgate,1550.04785156,-1625.51953125,15.15620422,2.0);
        LspdIsClosed = 1;
        }
        else
        SendClientMessage(playerid,COLOR_WHITE,"The gate is already closed.");
    return 1;
     }
try this