[REP+]problem with moving gate -
niels44 - 22.02.2012
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
Re: [REP+]problem with moving gate -
Twisted_Insane - 22.02.2012
Did you try to kill the timer under your forwarded callback?
Re: [REP+]problem with moving gate -
niels44 - 22.02.2012
you mean kill the closeentrance timer in the callback itselfs?
EDIT: tried and not working
Re: [REP+]problem with moving gate -
Twisted_Insane - 22.02.2012
I really never worked with gates 'n stuff, but this might help ya...
https://sampforum.blast.hk/showthread.php?tid=319624
Re: [REP+]problem with moving gate -
ttloko2 - 22.02.2012
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);
Re: [REP+]problem with moving gate -
niels44 - 22.02.2012
eehm that float
peed 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
Re: [REP+]problem with moving gate -
Twisted_Insane - 22.02.2012
pawn Код:
if (strcmp("/washcar", cmdtext, true, 8) == 0)
It's 8 characters long, not 7!
Re: [REP+]problem with moving gate -
niels44 - 22.02.2012
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
Re: [REP+]problem with moving gate -
Toreno - 22.02.2012
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;
}
Re: [REP+]problem with moving gate -
niels44 - 22.02.2012
well the gate is opening again now but still NOT smoothly
someone sees another bugg?