OnPlayerKeyStateChange is not respond
#1

The title says it everything, why? But it works with whoever logged in first, it doesn't work with another.

PHP код:
CMD:mine(playerid,params[])
{
    
MinerPlayer[playerid][Mining] = 1;
    
MinerPlayer[playerid][mProgress] = 0.0;
    
SetPlayerAttachedObject(playeridATTACH_INDEX1963160.0480.0290.103, -80.080.00.0);
    
SetPlayerProgressBarValue(playerid,MinerPlayer[playerid][mBar],MinerPlayer[playerid][mProgress]);
    
ShowPlayerProgressBar(playerid,MinerPlayer[playerid][mBar]);
     
RandommKey(playerid);
    return 
1;

this my stock
PHP код:
stock RandommKey(playerid)
{
    
MinerPlayer[playerid][mKey] = KEY_YES;
    return 
1;

and My Public OnPlayerKeyStateChange
PHP код:
if(MinerPlayer[playerid][Mining] == 1)
    {
        if(
newkeys KEY_YES)
        {
             if(
MinerPlayer[playerid][mKey] == KEY_YES)
             {
                 if(!
IsPlayerInRangeOfPoint(playerid,5,mInfo[playerid][m_x],mInfo[playerid][m_y],mInfo[playerid][m_z])) return SendClientMessage(playerid,warna_merah,"Kamu tidak boleh keluar dari daerah Mine");
                 
MinerPlayer[playerid][mProgress] += 5.0;
                 
ApplyAnimation(playerid"SWORD""sword_4"4.0000001);
                 
SetPlayerProgressBarValue(playerid,MinerPlayer[playerid][mBar],MinerPlayer[playerid][mProgress]);
                
RandommKey(playerid);
                 if(
MinerPlayer[playerid][mProgress] >= 100.0)
                 {
                     
StopMine(playerid);
                 }
             }
        }
    } 
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)