13.01.2011, 12:31
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:
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.
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;
Thanks in advanced.