Y U NO WORK
#1
Code:
scrambleClass() { WeaponPrimary = []; WeaponPrimary[WeaponPrimary.size] = "m4"; PickWeapon = WeaponPrimary[randomInt(WeaponPrimary.size)]; WeaponToGive = ""; if(PickWeapon == "m4_mp") { M4Attach = []; M4Attach[M4Attach.size] = ""; M4Attach[M4Attach.size] = "_acog"; M4Attach[M4Attach.size] = "_reflex"; M4Attach[M4Attach.size] = "_thermal"; M4Attach[M4Attach.size] = "_eotech"; WeaponToGive = "m4" + M4Attach[randomInt(M4Attach.size)] + "_mp"; } self takeAllWeapons(); self clearPerks(); wait 0.05; self giveWeapon(WeaponToGive, 0, false); wait 0.05; self switchToWeapon(WeaponToGive, 0, false); }
Reply

#2
which error?

try to print result, maybe you will see error...
C++/Obj-Cdeveloper. Neko engine wip
Steam: Click
Reply

#3
Hurrhurr

(06-19-2012, 00:25)broshaan Wrote: WeaponPrimary[WeaponPrimary.size] = "m4";
PickWeapon = WeaponPrimary[randomInt(WeaponPrimary.size)];
if(PickWeapon == "m4_mp")

Also you can just do:
Code:
PickWeapon = random(WeaponPrimary); random(M4Attach)

Afaik.
Reply

#4
(06-19-2012, 00:48)Nukem Wrote: Hurrhurr

(06-19-2012, 00:25)broshaan Wrote: WeaponPrimary[WeaponPrimary.size] = "m4";
PickWeapon = WeaponPrimary[randomInt(WeaponPrimary.size)];
if(PickWeapon == "m4_mp")

Also you can just do:
Code:
PickWeapon = random(WeaponPrimary); random(M4Attach)

Afaik.

I fixed the problem I had, pick weapon should have said m4 not m4_mp.
But thanks for your random(), it looks way less messy
Reply

#5
(06-19-2012, 01:33)broshaan Wrote:
(06-19-2012, 00:48)Nukem Wrote: Hurrhurr

(06-19-2012, 00:25)broshaan Wrote: WeaponPrimary[WeaponPrimary.size] = "m4";
PickWeapon = WeaponPrimary[randomInt(WeaponPrimary.size)];
if(PickWeapon == "m4_mp")

Also you can just do:
Code:
PickWeapon = random(WeaponPrimary); random(M4Attach)

Afaik.

I fixed the problem I had, pick weapon should have said m4 not m4_mp.
But thanks for your random(), it looks way less messy

Code:
WeaponToGive = "m4" + random(M4Attack) + random(M4Barrel) + "_mp"; if("thermal" in WeaponToGive) { if("shotgun" in WeaponToGive){WeaponToGive = "m4_shotgun_thermal_mp";} if("gl" in WeaponToGive){WeaponToGive = "m4_gl_thermal_mp";} if("silencer" in WeaponToGive){WeaponToGive = "m4_silencer_thermal_mp";} if("heartbeat" in WeaponToGive){WeaponToGive = "m4_heartbeat_thermal_mp";} if("fmj" in WeaponToGive){WeaponToGive = "m4_fmj_thermal_mp";} if("xmags" in WeaponToGive){WeaponToGive = "m4_xmags_thermal_mp";}
}

HALP ME!

I dunno how to look for substrings
Reply

#6
use [code] tags and please be more specific next time when you create a thread title
Reply

#7
(06-19-2012, 02:43)broshaan Wrote:
(06-19-2012, 01:33)broshaan Wrote:
(06-19-2012, 00:48)Nukem Wrote: Hurrhurr

(06-19-2012, 00:25)broshaan Wrote: WeaponPrimary[WeaponPrimary.size] = "m4";
PickWeapon = WeaponPrimary[randomInt(WeaponPrimary.size)];
if(PickWeapon == "m4_mp")

Also you can just do:
Code:
PickWeapon = random(WeaponPrimary); random(M4Attach)

Afaik.

I fixed the problem I had, pick weapon should have said m4 not m4_mp.
But thanks for your random(), it looks way less messy

Code:
WeaponToGive = "m4" + random(M4Attack) + random(M4Barrel) + "_mp"; if("thermal" in WeaponToGive) { if("shotgun" in WeaponToGive){WeaponToGive = "m4_shotgun_thermal_mp";} if("gl" in WeaponToGive){WeaponToGive = "m4_gl_thermal_mp";} if("silencer" in WeaponToGive){WeaponToGive = "m4_silencer_thermal_mp";} if("heartbeat" in WeaponToGive){WeaponToGive = "m4_heartbeat_thermal_mp";} if("fmj" in WeaponToGive){WeaponToGive = "m4_fmj_thermal_mp";} if("xmags" in WeaponToGive){WeaponToGive = "m4_xmags_thermal_mp";}
}

HALP ME!

I dunno how to look for substrings

I already posted in the shoutbox but if you didn't see it, it's:
Code:
if(isSubStr(WeaponToGive, "thermal")) { /* Blah */ }
[Image: 30xhrep.png]

A casual conversation between barata and I about Nukem.
Reply



Possibly Related Threads…
Thread Author Replies Views Last Post
  Help Permissions DOESNT work Hallla 2 4,015 08-18-2013, 11:28
Last Post: hillbilly
  why permissions dont work. ? ExoGamer* 4 4,820 07-21-2013, 13:46
Last Post: X-Track
  Bunker Plugin Won't work OBJAY 4 6,043 06-03-2013, 15:48
Last Post: X-Track
  Help prefix doesnt work with shop koro35 2 4,132 05-18-2013, 10:51
Last Post: koro35
  Help Perks do not work (( x1412 6 6,240 04-06-2013, 18:09
Last Post: x1412
  liberation dont work? puistis 7 10,029 02-18-2013, 09:17
Last Post: JariZ
  Weapon dont work?? Erik The Born 3 4,130 02-05-2013, 19:53
Last Post: Yamato
  private match maps won't work with mods! leereef 1 3,539 01-13-2013, 12:01
Last Post: surtek
  Some images do not work with SetShader xplosiff 8 7,350 01-05-2013, 07:19
Last Post: mw2killer
  Help !giveammo Plugin doesnt work [solved] Hallla 3 4,947 12-29-2012, 20:53
Last Post: Hallla

Forum Jump:


Users browsing this thread:
1 Guest(s)

Forum Powered By MyBB, Theme by © 2002-2026 Melroy van den Berg.