13.01.2013, 18:28
On /adminfly it enables the admin to fly around without using ****** etc.
So, what the problem is, that only the space and crouch work, none other. What is causing this and how to fix it?
(Yes, i know I could've put the oldpos definition on top)
So, what the problem is, that only the space and crouch work, none other. What is causing this and how to fix it?
PHP код:
if(Flying[playerid] == 1)
{
if(HOLDING(KEY_LOOK_LEFT))
{
new Float:oldpos[3];
GetPlayerPos(playerid, oldpos[0], oldpos[1], oldpos[2]);
SetPlayerPos(playerid, oldpos[0]+2, oldpos[1], oldpos[2]);
}
else if(HOLDING(KEY_LOOK_RIGHT))
{
new Float:oldpos[3];
GetPlayerPos(playerid, oldpos[0], oldpos[1], oldpos[2]);
SetPlayerPos(playerid, oldpos[0]-2, oldpos[1], oldpos[2]);
}
else if(HOLDING(KEY_LEFT))
{
new Float:oldpos[3];
GetPlayerPos(playerid, oldpos[0], oldpos[1], oldpos[2]);
SetPlayerPos(playerid, oldpos[0], oldpos[1]+2, oldpos[2]);
}
else if(HOLDING(KEY_RIGHT))
{
new Float:oldpos[3];
GetPlayerPos(playerid, oldpos[0], oldpos[1], oldpos[2]);
SetPlayerPos(playerid, oldpos[0], oldpos[1]-2, oldpos[2]);
}
else if(HOLDING(KEY_SPRINT))
{
new Float:oldpos[3];
GetPlayerPos(playerid, oldpos[0], oldpos[1], oldpos[2]);
SetPlayerPos(playerid, oldpos[0], oldpos[1], oldpos[2]+2);
}
else if(HOLDING(KEY_CROUCH))
{
new Float:oldpos[3];
GetPlayerPos(playerid, oldpos[0], oldpos[1], oldpos[2]);
SetPlayerPos(playerid, oldpos[0], oldpos[1], oldpos[2]-2);
}