SA-MP Forums Archive
Command gate help - 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: Command gate help (/showthread.php?tid=248544)



Command gate help - mitchboy - 14.04.2011

Hi, i had a gate and i could open it with a command, it worked perfectly but a friend said that i needed to add more gates, so i added more gates and the gates didn't appear, so i deleted the new gates and now the old gate still don't appear.
Код:
#include <a_samp>
new AutomaticGate;
new AutomaticGate2;

public OnGameModeInit()
{
	AutomaticGate = CreateObject(969, -365.49084472656, -1390.4411621094, 20.099876403809, 0, 0, 298);
	AutomaticGate2 = CreateObject(969, -365.49084472656, -1390.4411621094, 22.099876403809, 0, 0, 298);
	return 0;
}

forward OnPlayerCommandText(playerid, cmdtext[]);
public OnPlayerCommandText(playerid, cmdtext[])
{
if(!strcmp(cmdtext, "/mitchellkevin"))
    {
        MoveObject(AutomaticGate, -365.49084472656, -1390.4411621094, 8.099876403809, 2.0);
        MoveObject(AutomaticGate2, -365.49084472656, -1390.4411621094, 10.099876403809, 2.0);
        SetTimer("CloseMyGate", 10000, 0); // This will cale the 'CloseMyGate' after 10 seconds.
        SendClientMessage(playerid, 0xFFFFFFAA, "Welkom coole gozer :)");
    }
}
forward CloseMyGate();
public CloseMyGate()
{
    MoveObject(AutomaticGate, -365.49084472656, -1390.4411621094, 20.099876403809, 2.0);//Move gate back ...
	MoveObject(AutomaticGate2, -365.49084472656, -1390.4411621094, 22.099876403809, 2.0);
	return 1;
}



Re: Command gate help - Jeffry - 14.04.2011

Try to use return 1 instead of 0.

pawn Код:
public OnGameModeInit()
{
    AutomaticGate = CreateObject(969, -365.49084472656, -1390.4411621094, 20.099876403809, 0, 0, 298);
    AutomaticGate2 = CreateObject(969, -365.49084472656, -1390.4411621094, 22.099876403809, 0, 0, 298);
    return 1;
}