Failing?
#1

pawn Код:
dcmd_GK1(playerid, params[])
{
    #pragma unused params
    if(IsPlayerInRangeOfPoint(playerid, 15.0, 1241.40002441, 767.09997559, 91.09999847)){
        SetTimerEx("CloseGate", 5000, false, "i", playerid);
        MoveObject(Gate1, 1241.40002441, 767.09997559, 87.09999847, 3.0, 0.0, 0.0, 0.0);
        return SendClientMessage(playerid, COLOR_PINK, "Welcome to Kh4led's mansion");
    }
}
No compiling error, but when I do /gk1 NOTHING happens ingame..
Reply
#2

you made a command like this /GK1 not /gk1
Reply
#3

Not working dude
Reply
#4

Well, why are you returning the SendClientMessage?
pawn Код:
dcmd_GK1(playerid, params[])
{
    #pragma unused params
    if(IsPlayerInRangeOfPoint(playerid, 15.0, 1241.40002441, 767.09997559, 91.09999847)){
        SetTimerEx("CloseGate", 5000, false, "i", playerid);
        MoveObject(Gate1, 1241.40002441, 767.09997559, 87.09999847, 3.0, 0.0, 0.0, 0.0);
        SendClientMessage(playerid, COLOR_PINK, "Welcome to Kh4led's mansion");
    }
return 1; //it returns 1
}
Reply
#5

Still.
Not even showing the SendClientMessage..
Reply
#6

PHP код:
dcmd_gk1(playeridparams[])
{
    
#pragma unused params
    
if(IsPlayerInRangeOfPoint(playerid15.01241.40002441767.0999755991.09999847)){
        
SetTimerEx("CloseGate"5000false"i"playerid);
        
MoveObject(Gate11241.40002441767.0999755987.099998473.00.00.00.0);
        
SendClientMessage(playeridCOLOR_PINK"Welcome to Kh4led's mansion");
    }
return 
1//it returns 1
}
/// below::.........
public OnPlayerCommandText(playeridcmdtext[])
dcmd(gk1,6,cmdtext);
        return 
1;
    }
    return 
0;

It should work now.

Add the line that I'm telling in OnPlayerCommandText
Reply
#7

You need to be in range of point.
pawn Код:
dcmd_GK1(playerid, params[])
{
    #pragma unused params
    printf("Debug: Distance from point equals %.2f",GetPlayerDistanceFromPoint(playerid, 1241.40002441, 767.09997559, 91.09999847));
    if(IsPlayerInRangeOfPoint(playerid, 15.0, 1241.40002441, 767.09997559, 91.09999847))
    {
        SetTimerEx("CloseGate", 5000, false, "i", playerid);
        MoveObject(Gate1, 1241.40002441, 767.09997559, 87.09999847, 3.0, 0.0, 0.0, 0.0);
        return SendClientMessage(playerid, COLOR_PINK, "Welcome to Kh4led's mansion");
    }
}
Check the distance
Reply
#8

But if you see, he has the return errors.

So maybe there are a message.

You aren't in range of point (X,Y,Z)
Maybe...
Reply
#9

@ThePhenix I already defined it..
@Roko_Foko you're right, I removed it..

The gate moves towards the X axis and keeps on moving
Whole gate script
pawn Код:
dcmd_gk1(playerid, params[])
{
    #pragma unused params
        SetTimerEx("CloseGate", 2000, false, "i", playerid);
        MoveObject(Gate1, 1241.40002441, 767.09997559, 87.09999847, 3.0, 0.0, 0.0, 0.0);
        SendClientMessage(playerid, COLOR_PINK, "Welcome to Kh4led's mansion");
    return 1;
}

new Gate1;


    Gate1 = CreateObject(969, 1241.40002441, -767.09997559, 91.09999847, 0.0, 0.0, 0.0, 100.0);

forward CloseGate(playerid);
public CloseGate(playerid)
{
    MoveObject(Gate1, 1241.40002441, 767.09997559, 91.09999847, 3.0, 0.0, 0.0, 0.0);
    SendClientMessage(playerid, 0xFF00FFFF, "Kh4led's mansion gate one closed.");
}
Any help?
Reply
#10

Quote:
Originally Posted by _Khaled_
Посмотреть сообщение
@ThePhenix I already defined it..
@Roko_Foko you're right, I removed it..

The gate moves towards the X axis and keeps on moving
Whole gate script
pawn Код:
dcmd_gk1(playerid, params[])
{
    #pragma unused params
        SetTimerEx("CloseGate", 2000, false, "i", playerid);
        MoveObject(Gate1, 1241.40002441, 767.09997559, 87.09999847, 3.0, 0.0, 0.0, 0.0);
        SendClientMessage(playerid, COLOR_PINK, "Welcome to Kh4led's mansion");
    return 1;
}

new Gate1;


    Gate1 = CreateObject(969, 1241.40002441, -767.09997559, 91.09999847, 0.0, 0.0, 0.0, 100.0);

forward CloseGate(playerid);
public CloseGate(playerid)
{
    MoveObject(Gate1, 1241.40002441, 767.09997559, 91.09999847, 3.0, 0.0, 0.0, 0.0);
    SendClientMessage(playerid, 0xFF00FFFF, "Kh4led's mansion gate one closed.");
}
Any help?
Again, you are moving an object from Y axis -767.099 to Y axis 767.099...
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)