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");
}
}
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
}
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
}
/// below::.........
public OnPlayerCommandText(playerid, cmdtext[])
dcmd(gk1,6,cmdtext);
return 1;
}
return 0;
}
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");
}
}
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.");
}
@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 Код:
|