07-28-2013, 00:53
i have attempted to make a mod and its suposed to be a random weapon generator so every time you die you get a random weapon.... but when i launch it i get an improper syntax but im not sure where it is. heres the code if anyone knows let me know because i understand coding to a point and i want to know if i misses something or mesed up typing or its in the wrong spot:
also do i need more files to make it work? (the current file i am having trouble with is _rank.gsc) if i need anything more or anything less or fixed please tell me i am willing to learn.
Code:
onPlayerSpawned()
{
self endon("disconnect");
self endon("death");
self Takeallweapons();
for(;;)
{
self waittill("spawned_player");
giveRandomWeapon()
{
weaponList = [];
weaponList[weaponList.size] = "ak47_mp";
weaponList[weaponList.size] = "ak74u_mp";
weaponList[weaponList.size] = "mp5k_mp";
weaponList[weaponList.size] = "commando_mp";
weaponList[weaponList.size] = "l96a1_mp";
weaponList[weaponList.size] = "dragunov_mp";
weaponList[weaponList.size] = "wa2000_mp";
weaponList[weaponList.size] = "m1911dw_mp";
weaponList[weaponList.size] = "skorpion_mp";
weaponList[weaponList.size] = "mac11_mp";
weaponList[weaponList.size] = "uzi_mp";
weaponList[weaponList.size] = "pm63_mp";
weaponList[weaponList.size] = "mpl_mp";
weaponList[weaponList.size] = "spectre_mp";
weaponList[weaponList.size] = "kiparis_mp";
weaponList[weaponList.size] = "m16_mp";
weaponList[weaponList.size] = "enfield_mp";
weaponList[weaponList.size] = "m14_mp";
weaponList[weaponList.size] = "famas_mp";
weaponList[weaponList.size] = "galil_mp";
weaponList[weaponList.size] = "aug_mp";
weaponList[weaponList.size] = "fnfal_mp";
weaponList[weaponList.size] = "g11_mp";
weaponList[weaponList.size] = "hs10_mp";
weaponList[weaponList.size] = "rottweil72_mp";
weaponList[weaponList.size] = "ithaca_mp";
weaponList[weaponList.size] = "spas_mp";
weaponList[weaponList.size] = "hk21_mp";
weaponList[weaponList.size] = "rpk_mp";
weaponList[weaponList.size] = "m60_mp"
weaponList[weaponList.size] = "stoner63_mp";
weaponList[weaponList.size] = "psg1_mp";
weaponList[weaponList.size] = "aspdw_mp";
weaponList[weaponList.size] = "cz75dw_mp";
weaponList[weaponList.size] = "makarovdw_mp";
weaponList[weaponList.size] = "pythondw_mp";
weaponList[weaponList.size] = "knife_ballistic_mp";
weaponList[weaponList.size] = "crossbow_explosive_mp";
weaponList[weaponList.size] = "minigun_mp";
weapon = weaponList[randomInt( weaponList.size )];
self giveWeapon( weapon );
self setSpawnWeapon( weapon );
self setPerk("specialty_fastreload");
}
}
}
also do i need more files to make it work? (the current file i am having trouble with is _rank.gsc) if i need anything more or anything less or fixed please tell me i am willing to learn.