Q: GetPlayerWeapon and Detonator
#10

I found a fix for this.

Since I use pGun1-12 as my server sided weapons, I made it so when someone lays a C4, their pGun12 gets set to 40 (which is detonator). Instead of using

Код:
if(GetPlayerWeapon(playerid) == 40)
{
  //explosion shit here
}
I used


Код:
if(PlayerInfo[playerid][pGun12]) //<--- which is only for detonators, no other guns use this slot
{
  //explosion shit here
}
And it worked!

I advise you make some sort of "HasDetonator' variable and put in HasDetonator[playerid] = 1; when you give them one so it could work, then use:

Код:
if(HasDetonator[playerid]) 
{
  //explosion shit here
}
EDIT: But you could still punch to detonate the bomb if your HasBomb is set to 1. No big deal to me
Reply


Messages In This Thread
Q: GetPlayerWeapon and Detonator - by pierhs - 01.03.2010, 18:31
Re: Q: GetPlayerWeapon and Detonator - by BlackFoX - 01.03.2010, 18:33
Re: Q: GetPlayerWeapon and Detonator - by pierhs - 01.03.2010, 18:34
Re: Q: GetPlayerWeapon and Detonator - by BlackFoX - 01.03.2010, 18:36
Re: Q: GetPlayerWeapon and Detonator - by pierhs - 01.03.2010, 18:39
Re: Q: GetPlayerWeapon and Detonator - by BlackFoX - 01.03.2010, 18:49
Re: Q: GetPlayerWeapon and Detonator - by DarkPower - 01.03.2010, 18:50
Re: Q: GetPlayerWeapon and Detonator - by pierhs - 01.03.2010, 18:51
Re: Q: GetPlayerWeapon and Detonator - by DarkPower - 01.03.2010, 18:56
Re: Q: GetPlayerWeapon and Detonator - by help! - 17.03.2010, 15:46

Forum Jump:


Users browsing this thread: 1 Guest(s)