Last small problem I need help.
#1

I made a command that allows to close and open a random barrier now it works but It has a massive delay when I open it I have to wait some time and then I'll be able to close it back.
How can I solve it ?
pawn Код:
if(!strcmp(cmdtext, "/barrier", true))
    {

if(IsPlayerConnected(playerid)
)
{
 

if(IsPlayerInRangeOfPoint(playerid, 15, 1544.700317,-1630.735717,12.924660)){

        if(!gate) SetObjectRot( pdgate2, 0,0.0,90.0);

        else  SetObjectRot( pdgate2, 0,90,90.0);
}
}
        return 1;
  }
Reply
#2

delay? what you mean like waiting time? and about the delay do you have to wait till its succesfully closed/opened?
and edit the pawn code, you seem to have a ) after isconnected and you dont have to do that check since you cant do the command if ur not connected.
Reply
#3

Yeah, but when they barrier closes and I try to play with it open and close it doesn't work, I have to wait and when it closes I still have to wait some time, does this have anything to do something with the code ?
It is only allows me to open the gate when I open another one and drive to the wanted gate.
Reply
#4

maybe, not sure but can u tell me what !gate does?
becoz maybe its like this
Код:
if(!strcmp(cmdtext, "/barrier", true))
{
if(IsPlayerInRangeOfPoint(playerid, 15, 1544.700317,-1630.735717,12.924660))
{
if(gate == 1)
{
SetObjectRot( pdgate2, 0,0.0,90.0);
gate = 0;
}
else if(gate == 0)
SetObjectRot( pdgate2, 0,90,90.0);
gate = 1;
}
}
return 1;
}
if u get alot of errors just add a bracket after setobjectrot at the else if
or remove one
Reply
#5

Works, thank you very much.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)