04.12.2016, 22:32
I have this command:
This command, should teleport you 10 meters in the direction that you're looking at.
The problem here is, I can't really "spam it". Like after using it, I have to wait 1 second before I can use it again.
I didn't add any timer or something like that that could create the delay, so I don't know what it's causing it.
Код:
CMD:ff(playerid, params) { if(playerVariables[playerid][pAdminLevel] > 0) { 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); } else return SendClientMessage(playerid, -1, AdminOnly); return 1; }
The problem here is, I can't really "spam it". Like after using it, I have to wait 1 second before I can use it again.
I didn't add any timer or something like that that could create the delay, so I don't know what it's causing it.