Fly function works only for ID 0, weird ...
#1

Hey guys, my Admin fly function works only for ID 0, that's very weird and honestly I have no clue why
PHP код:
CMD:fly(playerid)
{
    if(!
IsAllowed(playerid2)) return NoAuth(playerid);
    new 
Float:xFloat:yFloat:z;
    if(
Fly[playerid] == false)
    {
        
GetPlayerPos(playeridxyz);
        
SetPlayerPos(playeridxyz+5);
           
SetPlayerArmour(playerid1000000000.0);
        
SetPlayerHealth(playerid1000000000.0);
        
SetTimerEx("AdminFly"1000"d"playerid);
        
Fly[playerid] = true;
        return 
1;
    }
    else
    {
        
GetPlayerPos(playeridxyz);
        
SetPlayerPos(playeridxyz+0.5);
        
ClearAnimations(playerid);
        
SetPlayerArmour(playerid100.0);
        
SetPlayerHealth(playerid100.0);
        
Fly[playerid] = false;
        return 
1;
    }

PHP код:
// Admin Fly
forward AdminFly(playerid);
public 
AdminFly(playerid)
{
    if(!
IsPlayerConnected(playerid))
        return 
Fly[playerid] = false;
    if(
Fly[playerid])
    {
        if(!
IsPlayerInAnyVehicle(playerid))
        {
            new
                
keys,
                
ud,
                
lr,
                
Float:x[2],
                
Float:y[2],
                
Float:z;
            
GetPlayerKeys(playeridkeysudlr);
            
GetPlayerVelocity(playeridx[0], y[0], z);
            if(
ud == KEY_UP)
            {
                
GetPlayerCameraPos(playeridx[0], y[0], z);
                
GetPlayerCameraFrontVector(playeridx[1], y[1], z);
                
ApplyAnimation(playerid,"SWIM","SWIM_crawl",6.1,1,1,1,1,0,1);
                
SetPlayerToFacePos(playeridx[0] + x[1], y[0] + y[1]);
                
SetPlayerVelocity(playeridx[1], y[1], z);
            }
            else
            
SetPlayerVelocity(playerid0.00.00.01);
        }
        
SetTimerEx("AdminFly"1000"d"playerid);
    }
    return 
0;

Anyone a clue ?
Reply


Messages In This Thread
Fly function works only for ID 0, weird ... - by NeXoR - 29.10.2016, 13:42
Re: Fly function works only for ID 0, weird ... - by iLearner - 29.10.2016, 14:17
Re: Fly function works only for ID 0, weird ... - by NeXoR - 29.10.2016, 14:57
Re: Fly function works only for ID 0, weird ... - by Yaa - 29.10.2016, 15:00
Re: Fly function works only for ID 0, weird ... - by NeXoR - 29.10.2016, 16:01
Re: Fly function works only for ID 0, weird ... - by oMa37 - 29.10.2016, 16:42
Re: Fly function works only for ID 0, weird ... - by NeXoR - 29.10.2016, 18:01
Re: Fly function works only for ID 0, weird ... - by jlalt - 29.10.2016, 18:04
Re: Fly function works only for ID 0, weird ... - by NeXoR - 30.10.2016, 12:40
Re: Fly function works only for ID 0, weird ... - by NeXoR - 31.10.2016, 01:38

Forum Jump:


Users browsing this thread: 3 Guest(s)