SA-MP Forums Archive
OnPlayerKeyStateChange Problem - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: OnPlayerKeyStateChange Problem (/showthread.php?tid=459680)



OnPlayerKeyStateChange Problem - Opah - 24.08.2013

I was building a mines system And The Problem is something is wrong with OnPlayerKeyStateChange No messages are shown nothing is working as if it isn't called
pawn Код:
CMD:mine(playerid,params[])
{
    if(GetPVarInt(playerid,"class") != 4) return SendClientMessage(playerid,COLOR_RED,"You Have To Be A Heavy Trooper To Plant Mines");
    if(Mines[playerid] == 0 && MinesOnHold[playerid] == 0) return SendClientMessage(playerid,COLOR_RED,"You Have No Mines Left");
    if(Mines[playerid] == 0 && MinesOnHold[playerid] != 0)
    {
        Mines[playerid] = MinesOnHold[playerid];
        MinesOnHold[playerid] = 0;
        vMinesOnHold[playerid] = vMines[playerid];
        vMines[playerid] = 0;
        new str[24];
        format(str,24,"You Have %i Mines Ready To Be Planted.",Mines[playerid]);
        SendClientMessage(playerid,COLOR_GREEN,str);
    }else if(Mines[playerid] != 0 && MinesOnHold[playerid] == 0)
    {
        MinesOnHold[playerid] = Mines[playerid];
        Mines[playerid] = 0;
        new str[24];
        format(str,24,"You Have %i Mines On Hold.",MinesOnHold[playerid]);
        SendClientMessage(playerid,COLOR_GREEN,str);
    }
    return 1;
}
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
    if(PRESSED(KEY_FIRE))
    {
        if(Mines[playerid] > 0)
        {
            if(GetPlayerWeapon(playerid) == 0)
            {
                SendClientMessage(playerid,COLOR_WHITE,"You Planted a MINE Wait 10 Seconds Till It Begins Working");
                GetPlayerPos(playerid,minex[playerid][Mines[playerid]],miney[playerid][Mines[playerid]],minez[playerid][Mines[playerid]]);
                Timer[mineo[playerid][Mines[playerid]]] = SetTimerEx("SetBomb",10000,0,"ii",playerid,Mines[playerid]);
                Mines[playerid] = Mines[playerid] - 1;
            }
        }
    }
    return 1;
}



Re: OnPlayerKeyStateChange Problem - Opah - 24.08.2013

solved again sorry