[REP+]problem with moving gate
#1

hey guys,

i dont know how and why but i have a problem with my moving gate, i created 2 but 1 isnt doing what it was supposed to do XD

so well i'm making a small but lux carwash system but now i have problem...
when a player arrives at the carwash there is a closed entrance and then when the player does /washcar the entrance should open very smoothly and slowly... but it isnt..
it is that when the player does /washcar the door is going immediately up... but it should go slowly but you even cant see it is moving so fast is it going...

and thne at the exit that code is exact the same but with other coords ofcourse and that one is opening and closing very smoothly and slowly... can anyone tell me whats wrong with this code?

pawn Код:
if (strcmp("/washcar", cmdtext, true, 7) == 0)
    {
        if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, COLOR_RED, "ERROR: you are not in a Vehicle!");
        else if(IsPlayerInAnyVehicle(playerid))
        {
            GivePlayerMoney(playerid, -40);
            SendClientMessage(playerid, COLOR_RED, "you have paid $40 to wash your car");
            SendClientMessage(playerid, COLOR_RED, "now drive in the red marker to wash your car");
            MoveObject(entrance,2499.50000000,-1460.00000000,29.70000076, 1.0, 292.00000000,0.00000000,89.99450684);
            SetTimer("CloseEntrance", 5000, 1);
            SetPlayerCheckpoint(playerid,2455.2258,-1461.0040,24.0000, 3.0);
        }
        return 1;
    }
    return 1;
}
pawn Код:
forward CloseEntrance();
public CloseEntrance()
{
    MoveObject(entrance, 2499.50000000,-1460.00000000,29.70000076, 1.0, 0.00000000,0.00000000,89.99450684);
    return 1;
}
pls help i studied this piece of code lots of times but cant find the problem...

greets niels
Reply
#2

Did you try to kill the timer under your forwarded callback?
Reply
#3

you mean kill the closeentrance timer in the callback itselfs?

EDIT: tried and not working
Reply
#4

I really never worked with gates 'n stuff, but this might help ya...

https://sampforum.blast.hk/showthread.php?tid=319624
Reply
#5

try this:

change velocity from:

MoveObject(entrance,2499.50000000,-1460.00000000,29.70000076, 1.0,292.00000000,0.00000000,89.99450684);

to:

MoveObject(entrance,2499.50000000,-1460.00000000,29.70000076, 3.0, 292.00000000,0.00000000,89.99450684);

set timer to NOT repeat.

pawn Код:
SetTimer("CloseEntrance", 5000, false);
Reply
#6

eehm that floatpeed i already had 3.0 first but changed it to 1.0 becuz i thought that would help and about the timer i will try
Reply
#7

pawn Код:
if (strcmp("/washcar", cmdtext, true, 8) == 0)
It's 8 characters long, not 7!
Reply
#8

oops there you have a fact XD ok change that too and eehm about timer i changed it to false now but now it isnt opening anymore... it just doesnt do anything when i use /washcar XD

EDIT: making it 8 characters long isnt helping either... and now also the door isnt opening anymore
Reply
#9

Try this;
pawn Код:
if( !strcmp( "/washcar", cmdtext, true, 8 ) )
{
    if( !IsPlayerInAnyVehicle( playerid ) )
        return SendClientMessage( playerid, COLOR_RED, "ERROR: you are not in a Vehicle!" );
       
    GivePlayerMoney( playerid, -40 );
   
    SendClientMessage( playerid, COLOR_RED, "you have paid $40 to wash your car" );
    SendClientMessage( playerid, COLOR_RED, "now drive in the red marker to wash your car" );
           
    MoveObject( entrance, 2499.50000000, -1460.00000000, 29.70000076, 10.0, 292.00000000, 0.00000000, 89.99450684 );
    SetTimer( "CloseEntrance", 5000, false );
   
    SetPlayerCheckpoint( playerid, 2455.2258, -1461.0040, 24.0000, 3.0 );
   
    return 1;
}
pawn Код:
forward CloseEntrance();
public CloseEntrance()
{
    MoveObject( entrance, 2499.50000000, -1460.00000000, 29.70000076, 10.0, 0.00000000, 0.00000000, 89.99450684 );
   
    return 1;
}
Reply
#10

well the gate is opening again now but still NOT smoothly someone sees another bugg?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)