A delay when using this command.
#5

Код:
CMD:ff(playerid, params)
{
	if(playerVariables[playerid][pAdminLevel] > 0)
	{
	    if(!GetPVarInt(playerid, "SendCmd")) return SetPVarInt(playerid, "SendCmd", true);
		else DeletePVar(playerid, "SendCmd");
	}
	else return SendClientMessage(playerid, -1, AdminOnly);
    return 1;
}
public OnPlayerUpdate(playerid)
{
	if(GetPVarInt(playerid, "SendCmd"))
	{
		new Float:fPX, Float:fPY, Float:fVX, Float:fVY, Float:object_x, Float:object_y, Float:player_x, Float:player_y, Float:player_z;

		const Float:fScale = 20.0;

		GetPlayerCameraPos(playerid, fPX, fPY, player_z); //Ignore player_z here
		GetPlayerCameraFrontVector(playerid, fVX, fVY, player_z); //Ignore player_z here

		object_x = fPX + floatmul(fVX, fScale);
		object_y = fPY + floatmul(fVY, fScale);

		GetPlayerPos(playerid, player_x, player_y, player_z);
		SetPlayerPosEx(playerid, object_x, object_y, player_z);
		DeletePVar(playerid, "SendCmd");
	}
	return 1;
}
Useless..
Reply


Messages In This Thread
A delay when using this command. - by danielpalade - 04.12.2016, 22:32
Re: A delay when using this command. - by Swedky - 04.12.2016, 22:48
Re: A delay when using this command. - by danielpalade - 05.12.2016, 13:57
Re: A delay when using this command. - by Threshold - 05.12.2016, 14:25
Re: A delay when using this command. - by gurmani11 - 05.12.2016, 14:29
Re: A delay when using this command. - by danielpalade - 06.12.2016, 01:27
Re: A delay when using this command. - by Threshold - 06.12.2016, 04:32

Forum Jump:


Users browsing this thread: 1 Guest(s)