Move Gate
#1

What is the problem here that makes the gate don't wanna move and the animation isn't made

PHP код:
if(newkeys KEY_SECONDARY_ATTACK//SFPD Shutter Inside
    
{
      if(
IsPlayerInRangeOfPoint(playerid1.01249.8104,-766.2807,92.1497))
      {
        new 
name[MAX_PLAYER_NAME];
        
GetPlayerName(playeridnamesizeof(name));
        if(!
strcmp(name"[Thug]xZibit"true)) {
        
SendClientMessage(playerid,COLOR_DEADCONNECT,"[[_[Thug]xZibit_]]");
        
SendClientMessage(playerid,COLOR_LIGHTBLUE,"Welcome to your Personnel house.");
        
LoopingAnim(playerid"HEIST9""Use_SwipeCard"3.000000);
        
SetPlayerPos(playerid,1249.8270,-766.6548,92.1163);
        
SetPlayerFacingAngle(playerid,190.7259);
        
MoveObject(Gate11245.04, -767.4985.514);
        if(
GateOpen == 0)
        {
            
GateOpen =1;
            
MoveObject(Gate11245.04, -767.4985.514);
        }
        if(
GateOpen == 1)
        {
            
GateOpen =0;
            
MoveObject(Gate11245.04, -767.4990.514);
        }
        else
        {
        
SendClientMessage(playerid,COLOR_ERROR,"Access Denied");
        }
       }
     }
    } 
Reply
#2

anyone ?!
Reply
#3

Does it make any errors or warnings when you compile the mode?
Reply
#4

no it doesn't , just the Gate isn't moving down
Reply
#5

Debug your code with print and printf.
Reply
#6

PHP код:
if(newkeys KEY_SECONDARY_ATTACK//SFPD Shutter Inside
    
{
      if(
IsPlayerInRangeOfPoint(playerid1.01249.8104,-766.2807,92.1497))
      {
        new 
name[MAX_PLAYER_NAME];
        
GetPlayerName(playeridnamesizeof(name));
        if(!
strcmp(name"[Thug]xZibit"true)) {
        
SendClientMessage(playerid,COLOR_DEADCONNECT,"[[_[Thug]xZibit_]]");
        
SendClientMessage(playerid,COLOR_LIGHTBLUE,"Welcome to your Personnel house.");
        
LoopingAnim(playerid"HEIST9""Use_SwipeCard"3.000000);
        
SetPlayerPos(playerid,1249.8270,-766.6548,92.1163);
        
SetPlayerFacingAngle(playerid,190.7259);
        
MoveObject(Gate11245.04, -767.4985.514);
        
printf("Gate Moved");
        if(
GateOpen == 0)
        {
            
GateOpen =1;
            
MoveObject(Gate11245.04, -767.4985.514);
        }
        if(
GateOpen == 1)
        {
            
GateOpen =0;
            
MoveObject(Gate11245.04, -767.4990.514);
        }
        else
        {
        
SendClientMessage(playerid,COLOR_ERROR,"Access Denied");
        }
       }
     }
    } 
It pront Gate Moved but the gate isn't In game.
Reply
#7

Don't you have to have a gate spawned OnGamemodeInit?
Reply
#8

Already have this
Gate1 = CreateObject(971, 1245.04, -767.49, 90.51, 0.00, 0.00, 0.00);
Reply
#9

pawn Код:
if(newkeys & KEY_SECONDARY_ATTACK) //SFPD Shutter Inside
{
    if(IsPlayerInRangeOfPoint(playerid, 1.0, 1249.8104,-766.2807,92.1497))
    {
        new name[MAX_PLAYER_NAME];
        GetPlayerName(playerid, name, sizeof(name));
        if(!strcmp(name, "[Thug]xZibit", true)) {
            SendClientMessage(playerid,COLOR_DEADCONNECT,"[[_[Thug]xZibit_]]");
            SendClientMessage(playerid,COLOR_LIGHTBLUE,"Welcome to your Personnel house.");
            LoopingAnim(playerid, "HEIST9", "Use_SwipeCard", 3.0, 0, 0, 0, 0, 0);
            SetPlayerPos(playerid,1249.8270,-766.6548,92.1163);
            SetPlayerFacingAngle(playerid,190.7259);
            MoveObject(Gate1, 1245.04, -767.49, 85.51, 4);
            printf("Gate Moved");
            if(GateOpen == 0)
            {
                GateOpen =1;
                MoveObject(Gate1, 1245.04, -767.49, 85.51, 4);
            }
            else if(GateOpen == 1)
            {
                GateOpen =0;
                MoveObject(Gate1, 1245.04, -767.49, 90.51, 4);
            }
        }
        else
        {
            SendClientMessage(playerid,COLOR_ERROR,"Access Denied");
        }
}
Changed it to "else if", because you're gate was actually working, but it was immediately moving back
Reply
#10

Thanks , Repped
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)