SA-MP Forums Archive
Move-Object Problem, - FUCKING Disappears (+ReP) - 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: Move-Object Problem, - FUCKING Disappears (+ReP) (/showthread.php?tid=336890)



Move-Object Problem, - FUCKING Disappears (+ReP) - Aira - 24.04.2012

So here's my Code
PHP код:
    if(strcmp(cmd"/celldoor"true) == 0)
    {
        if(
IsPlayerConnected(playerid))
            {
                if(
PlayerInfo[playerid][pMember] == || PlayerInfo[playerid][pLeader] == 1)
                    {
                    if (!
PlayerToPoint(100playerid,322.44308.38999.15)) // FCPD HQ
                    
{
                        
SendClientMessage(playeridCOLOR_GRAD2"  You are not Inside the FCPD Station ");
                        return 
1;
                    }
                    
tmp strtok(cmdtextidx);
                    if(!
strlen(tmp))
                    {
                        
SendClientMessage(playeridCOLOR_WHITE"USAGE: /celldoor [Door Number]");
                        
SendClientMessage(playeridCOLOR_LIGHTBLUE"|_______ CELL CONTROL PANEL _______|");
                        
SendClientMessage(playeridCOLOR_GRAD1"| 1: INNER CELL DOOR     2: OUTER CELL DOOR");
                        return 
1;
                    }
                    new 
item3 strval(tmp);
                    if (
item3 == 1)
                    {
                           {
                            if(
cellopen1==0)
                              {
                              
SendClientMessage(playeridCOLOR_GREY,"You have OPENED the inner Cell door");
                              
MoveObject(celldoor114856,312.50000000,320.79998779,1000.00000000+51.0);
                              
cellopen1 1;
                              }
                              else
                              {
                              
SendClientMessage(playeridCOLOR_GREY,"You have CLOSED the inner Cell door");
                              
MoveObject(celldoor114856,312.50000000,320.79998779,1000.000000002.0); 
                              
cellopen1 0;
                              }
                            return 
1;
                        }
                    }
                    if (
item3 == 2)
                    {
                           {
                            if(
cellopen2==0)
                              {
                              
SendClientMessage(playeridCOLOR_GREY,"You have OPENED the Outer Cell Door");
                              
MoveObject(celldoor214856,311.10000610,320.70001221,1000.00000000+52.0);
                              
cellopen2 1;
                              }
                              else
                              {
                              
SendClientMessage(playeridCOLOR_GREY,"You have CLOSED the Outer Cell Door");
                              
MoveObject(celldoor214856,311.10000610,320.70001221,1000.000000002.0);
                              
cellopen2 0;
                              }
                            return 
1;
                        }
                    }
                } 
// Faction
            
// Connected
        
// First 
IF i do type the Command, Example /celldoor 1 once, it says i OPENED it but it never moved the Object but instead kinda deleted it, then when i type celldoor1 again, it ssays i CLOSED it but nothing happens..
This is in an Interior
Help Plox


Re: Move-Object Problem, - FUCKING Disappears (+ReP) - iRage - 24.04.2012

Show me your CreateObject lines for the doors.


Re: Move-Object Problem, - FUCKING Disappears (+ReP) - Aira - 24.04.2012

Here
Quote:

celldoor1 = CreateObject(14856,312.50000000,320.79998779,1000. 00000000,0.00000000,0.00000000,90.00000000); //object(cellsa) (1)-- INNER CELLS
celldoor2 = CreateObject(14856,311.10000610,320.70001221,1000. 00000000,0.00000000,0.00000000,270.00000000); //object(cellsa) (1)-- OUTER CELLS




Re: Move-Object Problem, - FUCKING Disappears (+ReP) - Aira - 24.04.2012

Seriously? DUMP
Somebody help ASAP, Thank you


Re: Move-Object Problem, - FUCKING Disappears (+ReP) - RollTi - 24.04.2012

Quote:
Originally Posted by Aira
Посмотреть сообщение
Seriously? DUMP
Somebody help ASAP, Thank you
Actually i don't see the difference here

pawn Код:
if(cellopen1==0)
{
    SendClientMessage(playerid, COLOR_GREY,"You have OPENED the inner Cell door");
    MoveObject(celldoor1, 14856,312.50000000,320.79998779,1000.00000000+5, 1.0);
    cellopen1 = 1;
}
else
{
    SendClientMessage(playerid, COLOR_GREY,"You have CLOSED the inner Cell door");
    MoveObject(celldoor1, 14856,312.50000000,320.79998779,1000.00000000, 2.0);
    cellopen1 = 0;
}
i mean

pawn Код:
MoveObject(celldoor1, 14856,312.50000000,320.79998779,1000.00000000, 2.0); //You have this code inside when player open the door and when player close the door
so the problem is in that line you are not moving the object instead you keeping the object position in the same position

EDIT:

hmmm i saw the difference you have +5 in open door and theres no +5 in closed

Maybe the problem is in this line

pawn Код:
MoveObject(celldoor1, 14856,312.50000000,320.79998779,1000.00000000+5, 1.0);
because you said that when you open the door the object was deleted


Re: Move-Object Problem, - FUCKING Disappears (+ReP) - Aira - 24.04.2012

Quote:
Originally Posted by RollTi
Посмотреть сообщение
Actually i don't see the difference here

pawn Код:
if(cellopen1==0)
{
    SendClientMessage(playerid, COLOR_GREY,"You have OPENED the inner Cell door");
    MoveObject(celldoor1, 14856,312.50000000,320.79998779,1000.00000000+5, 1.0);
    cellopen1 = 1;
}
else
{
    SendClientMessage(playerid, COLOR_GREY,"You have CLOSED the inner Cell door");
    MoveObject(celldoor1, 14856,312.50000000,320.79998779,1000.00000000, 2.0);
    cellopen1 = 0;
}
i mean

pawn Код:
MoveObject(celldoor1, 14856,312.50000000,320.79998779,1000.00000000, 2.0); //You have this code inside when player open the door and when player close the door
so the problem is in that line you are not moving the object instead you keeping the object position in the same position

EDIT:

hmmm i saw the difference you have +5 in open door and theres no +5 in closed

Maybe the problem is in this line

pawn Код:
MoveObject(celldoor1, 14856,312.50000000,320.79998779,1000.00000000+5, 1.0);
because you said that when you open the door the object was deleted
No Shit, it ain't D:
... =/ Let me see what i can do