OnPlayerKeyStateChange..
#1

Hello everyone, I am trying to get two keys to work, but I am having trouble with scripting the second key, as the first key works, but the second just doesn't respond in-game.

This function is new to me, and SAMP Wiki, didn't help..
Could you explain to me what I am doing wrong?

pawn Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
    if(GetPlayerTeam(playerid) == 2)
    {
        if(Flaming[playerid] == 1)
        {
            if(newkeys & KEY_AIM)
            {
                new Float:PosX, Float: PosY, Float: PosZ;
                GetPlayerPos(playerid, PosX, PosY, PosZ);
                CreateExplosion(PosX, PosY, PosZ, 10, 10);
            }
            else { return 0; }
        }
    }
   
   
    else if(newkeys & KEY_YES)
    {
   
    if(GetPlayerTeam(playerid) == 2)
    {
        if(Flaming[playerid] == 0)
        {
            Flaming[playerid] = 1;
            SetPlayerAttachedObject( playerid, 0, 18693, 5, 1.983503, 1.558882, -0.129482, 86.705787, 308.978118, 268.198822, 1.500000, 1.500000, 1.500000 );
            SetPlayerAttachedObject( playerid, 1, 18693, 6, 1.983503, 1.558882, -0.129482, 86.705787, 308.978118, 268.198822, 1.500000, 1.500000, 1.500000 );
            SetPlayerAttachedObject( playerid, 2, 18703, 6, 1.983503, 1.558882, -0.129482, 86.705787, 308.978118, 268.198822, 1.500000, 1.500000, 1.500000 );
            SetPlayerAttachedObject( playerid, 3, 18703, 5, 1.983503, 1.558882, -0.129482, 86.705787, 308.978118, 268.198822, 1.500000, 1.500000, 1.500000 );
            SetPlayerWeather(playerid, 21);

            SendClientMessage(playerid, COLOR_LIGHTBLUE, "[TEAM] {FFFFFF}- You're currently using {37FF00}superpowers{FFFFFF}, /superpowers to see the {FF8921}privileges{FFFFFF}.");
        }
        else if(Flaming[playerid] == 1)
        {
            Flaming[playerid] = 0;

            for ( new i = 0; i < 4; i++ )
            if ( IsPlayerAttachedObjectSlotUsed( playerid, i ) )
            RemovePlayerAttachedObject( playerid, i );
            SetPlayerWeather(playerid, 8);

        }
    }
    else { SendClientMessage(playerid, COLOR_RED, "[TEAM] {FFFFFF}- You're not a {FF0000}zombie{FFFFFF}!"); return 1; }
}
Thanks in advance.

P.S. - If anyone could respond here please, that would be awsome.
Reply


Messages In This Thread
OnPlayerKeyStateChange.. - by CesarLT - 04.10.2013, 12:04
Re: OnPlayerKeyStateChange.. - by Jankingston - 04.10.2013, 14:41
Re: OnPlayerKeyStateChange.. - by Dragonsaurus - 04.10.2013, 14:44
Re: OnPlayerKeyStateChange.. - by CesarLT - 04.10.2013, 14:54
Re: OnPlayerKeyStateChange.. - by Dragonsaurus - 04.10.2013, 14:58
Re: OnPlayerKeyStateChange.. - by CesarLT - 04.10.2013, 15:59
Re: OnPlayerKeyStateChange.. - by Dragonsaurus - 04.10.2013, 16:05
Re: OnPlayerKeyStateChange.. - by CesarLT - 04.10.2013, 19:40

Forum Jump:


Users browsing this thread: 1 Guest(s)