SDpistol tazer help.
#1

Well, I'm confused by this. I want to make when you type /tazer you get an sdpistol and if you shoot someone you taze him. I don't know what to put on OnPlayerKeyStateChange.

This is the code:
pawn Код:
new newkeys;
    new oldkeys;
    if ((newkeys & KEY_FIRE) && !(oldkeys & KEY_FIRE))
     {
         for(new targetplayerid; targetplayerid < MAX_PLAYERS; targetplayerid++)
         {
             if(IsPlayerAimingAtPlayer(playerid,targetplayerid))
             {
                GameTextForPlayer(targetplayerid,"You have been tazed by a cop!",3000,3);
                ApplyAnimation(targetplayerid, "CRACK", "crckdeth2", 4.0, 1, 0, 0, 0, 0, 1);
                return 1;
                }
             }
         }
    return 1;
What to do about this newkeys and oldkeys? Please help me out or give me a link for an example script so I can figure it out. I really need this for my GM I'm developing.

Thanks in advanced.
Reply


Messages In This Thread
SDpistol tazer help. - by Outcast - 13.01.2011, 12:31
Re: SDpistol tazer help. - by Toreno - 13.01.2011, 13:23

Forum Jump:


Users browsing this thread: 2 Guest(s)