Post: what am i doing wrong here
12-03-2015, 01:25 PM #1
(adsbygoogle = window.adsbygoogle || []).push({}); i trying to make it check so that "if you dont have claymores on you"

i tried this:

if(self GetInventoryWeapon("claymore_mp") == false)

but it doesn't work

im no expert on scripting so could someone correct me haha thanks Smile
(adsbygoogle = window.adsbygoogle || []).push({});
12-03-2015, 02:25 PM #2
BullyWiiPlaza
Climbing up the ladder
Try this:

    hasClaymores()
{
weapons = self getWeaponsList();
hasClaymores = false;

foreach(weapon in weapons)
{
if(weapon == "claymore_mp")
{
hasClaymores = true;
}
}

return hasClaymores;
}

The following user thanked BullyWiiPlaza for this useful post:

OfficialCoolJay
12-03-2015, 03:17 PM #3
Loz
Vault dweller
Originally posted by OfficialCoolJay View Post
i trying to make it check so that "if you dont have claymores on you"

i tried this:

if(self GetInventoryWeapon("claymore_mp") == false)

but it doesn't work

im no expert on scripting so could someone correct me haha thanks Smile


if(!self hasWeapon("claymore_mp"))

The following 2 users say thank you to Loz for this useful post:

DF_AUS, OfficialCoolJay
12-03-2015, 03:49 PM #4
BullyWiiPlaza
Climbing up the ladder
Originally posted by Loz View Post
if(!self hasWeapon("claymore_mp"))

Yeah, that's the best way Smile
12-04-2015, 02:10 AM #5
Originally posted by Loz View Post
if(!self hasWeapon("claymore_mp"))


thanks Smile i couldn't remember what the right one was and forgot that there was a "hasweapon" thank you sir
12-04-2015, 02:39 AM #6
Originally posted by Loz View Post
if(!self hasWeapon("claymore_mp"))


i have this on a loop

    loop()
{
for(;Winky Winky
{
if(!self hasWeapon("claymore_mp"))
{
do this
}
wait 0.05;
}
}


as soon as i get claymores it doesnt do the above thread right... because it says only if i don't have claymores do this.

so after i get claymores then get rid of my claymores the above thread thinks i still have claymores why is this?
12-05-2015, 03:14 AM #7
HiddenHour
I defeated!
Originally posted by OfficialCoolJay View Post
i have this on a loop

    loop()
{
for(;Winky Winky
{
if(!self hasWeapon("claymore_mp"))
{
do this
}
wait 0.05;
}
}


as soon as i get claymores it doesnt do the above thread right... because it says only if i don't have claymores do this.

so after i get claymores then get rid of my claymores the above thread thinks i still have claymores why is this?


I think it's because of how equipment works. You can have no claymores to use, but the game will still consider you to "have" them. You just don't have any ammo for them to use. Try using getWeaponAmmoStock(weap) or getWeaponAmmoClip(weap).

The following user thanked HiddenHour for this useful post:

OfficialCoolJay
12-05-2015, 04:01 AM #8
Originally posted by TheHiddenHour View Post
I think it's because of how equipment works. You can have no claymores to use, but the game will still consider you to "have" them. You just don't have any ammo for them to use. Try using getWeaponAmmoStock(weap) or getWeaponAmmoClip(weap).


wow thankyou! i got to work 100%

yeah i suspected that too, i didnt think of having it detect ammo stock haha

i did like this in the end:

    if(self getWeaponAmmoStock("claymore_mp") <= 0)


thanks man was anoying me haha Smile
12-05-2015, 08:03 AM #9
Adrian
Adrian is back!
Originally posted by OfficialCoolJay View Post
wow thankyou! i got to work 100%

yeah i suspected that too, i didnt think of having it detect ammo stock haha

i did like this in the end:

    if(self getWeaponAmmoStock("claymore_mp") <= 0)


thanks man was anoying me haha Smile


Good to hear. If you have any other questions feel free to make another thread.

-Thread Closed.

Copyright © 2026, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo