Problem With Script: all players are afk
#1

Heey

I have a script but won't work. It is a script to auto open a gate when in area of gate. ONLY if you are donator rank.
The gate works but it bugs: I can see all players but some players are "AFK" in-game when they aint AFK.

I know, return 0; doesn't need here, but if I don't put it there I get a lot of errors and I tried everything. Also return 1; Is double because the script won't work because of the errors.

My script (BAD):

PHP код:
    public OnPlayerUpdate(playerid){
    if(
PlayerInfo[playerid][dRank]<1)
    return 
0;
    {
    if(
IsPlayerInRangeOfPoint(playerid,8,-308.498201508.6586974.33560))
{
    
MoveObject(autogate,-308.498201508.6586968.10109,3);
    
SetTimer("close",4000,0);
    return 
1;
}
    return 
1;
}

Who can fix it?
Reply
#2

pawn Код:
public OnPlayerUpdate(playerid)
{
    if(PlayerInfo[playerid][dRank] < 1 && IsPlayerInRangeOfPoint(playerid, 8, -308.49820, 1508.65869, 74.33560))
    {
        MoveObject(autogate, -308.49820, 1508.65869, 68.10109, 3);
        SetTimer("close", 4000, 0);
    }

    return 1;
}
Ever heard of indentation? If you want your code to be readable - ****** it, and use it.
Reply
#3

It compiles now
Reply
#4

Quote:
Originally Posted by Misiur
Посмотреть сообщение
pawn Код:
public OnPlayerUpdate(playerid)
{
    if(PlayerInfo[playerid][dRank] < 1 && IsPlayerInRangeOfPoint(playerid, 8, -308.49820, 1508.65869, 74.33560))
    {
        MoveObject(autogate, -308.49820, 1508.65869, 68.10109, 3);
        SetTimer("close", 4000, 0);
    }

    return 1;
}
Ever heard of indentation? If you want your code to be readable - ****** it, and use it.
The code you give don't work! My gate wont open if you stand infront of int
Reply
#5

You're checking if dRank is less than 1, isn't this the source of your problem?
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)