gate close problem
#1

Ok i scripted the gate to open and i made the time for it to close But it wont close !


Код:
	if(!strcmp(cmdtext, "/impound", true))
	{
        if(PlayerInfo[playerid][pJob] != 7) {
			SendClientMessage(playerid, COLOR_BLUE,"The impound gate is opened and will close in 7 seconds.");
            SendClientMessage(playerid, COLOR_GREY, "You are not a Car Mechanic!");
            return 1;
        }
        if (IsPlayerInRangeOfPoint(playerid, 15,1638.2725,-1146.0609,23.9063)) {
            MoveDynamicObject(impoundgate1,1638.9386,-1141.2346,36.2896, 0.8);
	      	SetTimer("GateClose6", 12000, 0);
            format(string, sizeof(string), "* %s takes out his/her impound remote and opens the gate.", sendername);
            ProxDetector(30.0, playerid, string, COLOR_CHAT1,COLOR_CHAT2,COLOR_CHAT3,COLOR_CHAT4,COLOR_CHAT5);
        }
        return 1;
    }
Reply
#2

post public GateClose6()
Reply
#3

Quote:
Originally Posted by Darius_Fontaine
Посмотреть сообщение
post public GateClose6()
Код:
    forward gateclose6();
	public gateclose6()
	{
      MoveDynamicObject(impoundgate1,1638.0999755859, -1141.1999511719, 25.700000762939, 0.97);
      return 1;
}
And the original closed gate code :
Код:
	impoundgate1 = CreateDynamicObject(980, 1638.0999755859, -1141.1999511719, 25.700000762939, 0, 0, 358);
Reply
#4

I suggest using MoveObject, and you would do this by:

PHP код:
impoundgate1 CreateObject(9801638.0999755859, -1141.199951171925.70000076293900358); 
For the MoveObject you would do this:

PHP код:
MoveObject(impoundgate11638.0999755859, -1141.199951171925.700000762939,300358); 
Reply
#5

Hmm thanks but i tried to add another cmd for closing it and removed the timed close and it worked but thanks
Reply
#6

This how i would do it, tested and works:

Код:
new gate6 = 0;
new Gate6Timer;
new impoundgate1;
forward GateClose6();
Код:
public OnGameModeInit()
{
	impoundgate1 = CreateObject(980, 1638.0999755859, -1141.1999511719, 25.700000762939, 0, 0, 358);
}
Код:
public GateClose6()
{
	MoveObject(impoundgate1,1638.0999755859, -1141.1999511719, 25.700000762939, 0.97);
	KillTimer(Gate6Timer);
	gate6 = 0;
	return 1;
}
Код:
	if(!strcmp(cmdtext, "/impound", true))
	{
        if(PlayerInfo[playerid][pJob] != 7)
		{
			SendClientMessage(playerid, COLOR_BLUE,"The impound gate is opened and will close in 7 seconds.");
            SendClientMessage(playerid, COLOR_GREY, "You are not a Car Mechanic!");
            return 1;
        }
        if (IsPlayerInRangeOfPoint(playerid, 15,1638.2725,-1146.0609,23.9063) && gate6 == 0)
		{
            MoveObject(impoundgate1,1638.9386,-1141.2346,36.2896, 0.8);
	      	Gate6Timer = SetTimer("GateClose6", 12000, 0);
	      	gate6 = 1;
            format(string, sizeof(string), "* %s takes out his/her impound remote and opens the gate.", sendername);
            ProxDetector(30.0, playerid, string, COLOR_CHAT1,COLOR_CHAT2,COLOR_CHAT3,COLOR_CHAT4,COLOR_CHAT5);
        }
        else
        {
			SendClientMessage(playerid, COLOR_BLUE,"The impound gate is opened.");
		}
        return 1;
    }
of course fix the spacing.. grrr
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)