OnPlayerKeyStateChange.Help
#1

I made a cmd /plantbomb so when someone use its it creates an object and it gives him a detonator but the problem is here....I want to the function OnPlayerKeyStateChange when the player press the fire button,an explosion will be created but only if he has a detonator.

Look at this Lines:

First it was like this and it was working but the player was able to do it by punching or something:
Код:
if ((newkeys==KEY_FIRE))
	{
    	DestroyObject(bomb);
    	CreateExplosion(bomb_x[playerid], bomb_y[playerid], bomb_z[playerid], 12, 4.0);
	}
Then I made it like this:

Код:
if ((newkeys==KEY_FIRE && GetPlayerWeapon(playerid) == 40))
	{
    	DestroyObject(bomb);
    	CreateExplosion(bomb_x[playerid], bomb_y[playerid], bomb_z[playerid], 12, 4.0);
	}
But its not working.Help Please!!!
Reply


Messages In This Thread
OnPlayerKeyStateChange.Help - by pierhs - 21.11.2009, 08:34
Re: OnPlayerKeyStateChange.Help - by pierhs - 21.11.2009, 08:59
Re: OnPlayerKeyStateChange.Help - by Sergei - 21.11.2009, 09:05
Re: OnPlayerKeyStateChange.Help - by pierhs - 21.11.2009, 09:06
Re: OnPlayerKeyStateChange.Help - by pierhs - 21.11.2009, 09:35
Re: OnPlayerKeyStateChange.Help - by Tigerbeast11 - 21.11.2009, 09:45
Re: OnPlayerKeyStateChange.Help - by Tigerbeast11 - 21.11.2009, 10:12
Re: OnPlayerKeyStateChange.Help - by MenaceX^ - 21.11.2009, 10:22
Re: OnPlayerKeyStateChange.Help - by pierhs - 21.11.2009, 10:32
Re: OnPlayerKeyStateChange.Help - by pierhs - 22.11.2009, 13:19

Forum Jump:


Users browsing this thread: 2 Guest(s)