Can't move the gate
#1

here's the code

Код:
#define FILTERSCRIPT
#include <a_samp>

new imafia;
public OnFilterScriptInit()
{
    // Don't use these lines if it's a filterscript
    SetGameModeText("Blank Script");
    imafia = CreateObject(980,1245.68627930,-768.25524902,93.69370270,0.00000000,0.00000000,0.00000000); //object(airportgate) (1)
    return 1;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
        if (strcmp("/im1", cmdtext, true, 10) == 0)
       {
       MoveObject(imafia,1245.27880859,-768.20977783,93.69495392, 2.00);
       SetTimer("imafia1", 4000, 0);//gate will be  closed for 7 seconds
       SendClientMessage(playerid,0xFF7F50AA,"xaxaax!..");
       return 1;}
        return 0;
        

}
Reply
#2

strange, try changing that to an automatic gate
Reply
#3

change
if (strcmp("/im1", cmdtext, true, 10) == 0)

to
if (strcmp("/im1", cmdtext, true, 4) == 0)
Reply
#4

work but cant close :d
Reply
#5

-__- change
pawn Код:
SetTimer("imafia1", 4000, 0);
to
pawn Код:
SetTimerEx("imafia1gate", 4000, 0,"u",playerid);
Then in the bottom add
pawn Код:
forward imafia1gate(playerid);
public imafia1gate(playerid)
{
      MoveObject(imafia,(X of where you wanna move to),(Y of where you wanna move to),(Z of where you wanna move to),(Speed));
           return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)