Sorex I was thinking about it, and if I implement it as you recommend, it would not achieve what I need, since if I connect in round 3 and it is my first appearance, I would not receive the welcome message.

Kalitos
Posts
-
How to get the round number in SyD !Help -
How to get the round number in SyD !HelpSorex Can you do an example in code?
-
How to get the round number in SyD !Help -
How to get the round number in SyD !HelpCan someone help me how I get the round number in SyD mode, I ask it to know what round I am in when I reappear and from there execute certain code in a certain round.
I have the following code:
onPlayerSpawned() { self endon("disconnect"); level endon("game_ended"); for(;;) { self waittill("spawned_player"); if(!isDefined(self.isFirstSpawn)) { self.isFirstSpawn = true; self iprintln("^5Black Ops 2 - Script ^7| ^5Weapons ^7and ^5attachments ^7restriction ^5| ^7By: ^2Kalitos"); WelcomeMessage("^5Welcome ^7To ^2Maniacos ^7Server"); } //Other code } }
What I want is that it only appears once, I tried it in TDM mode and it works, but in SYD mode it doesn't work, because I think that in each round it takes it as if it were its first appearance.
-
[Support] How do I implement Overflow Fix in my code? ! HelpI was reading that when text strings are handled, the Overflow of strings must be taken into account, and although I was reading this post in particular and it is the one that I understand the most:
https://www.nextgenupdate.com/forums/black-ops-2-gsc-mods-scripts/915525-overflow-fix-cooljay-black-ops-iiutility.htmlI can't find where I should implement
DestroyElement();
function inside my code, since obviously I didn't know about this problem and that's why I don't use theDestroy();
functionhealthPlayer () { self endon ("disconnect"); self.healthText = createFontString ("Objective", 1.7); Â Â Â Â self.healthText setPoint ("CENTER", "TOP", 300, "CENTER"); Â Â Â Â while (true) Â Â Â Â { Â Â Â Â Â Â Â Â self.healthText setText ("^ 2HEALTH: ^ 7" + self.health); Â Â Â Â Â Â Â Â wait 0.25; Â Â Â Â } }
-
[Resource] Weapons and attachments restriction !CodeTheHiddenHour Thank you for your observation, I will try to review it.
-
[Resource] Weapons and attachments restriction !CodeI want to share what I have done these days.
As you know, the bo2 server restrictions are not very effective especially on attachments, that's why I started to make my own script for it, of course thanks to the help of some of the people on the Forum.It is not very complete, but it achieves what I need.
- Restrict weapons that are defined within the list of restricted weapons.
- Restrict the attachments you define within the list of restricted attachments. // Except Dual Wield, it is strange, it does not recognize it.
- Additional, disables the use of kill streaks.
It is especially designed for a SyD game mode
Something to keep in mind, you must remove any weapons you have restricted in the server's restricted file of restrictions. If it does not, and select a weapon that is in that file when the player appears, it will have 1 additional weapon, which will be assigned as a replacement by the server's own restraint system.
=====
CODE :::: UPDATE: 10/04/2020/* * Black Ops 2 - GSC Studio by iMCSx * * Creator : Kalitos * Project : Restriccion de armas * Mode : Multiplayer * Date : 2020/04/05 - 13:35:30 * */ #include maps\mp\_utility; #include common_scripts\utility; #include maps\mp\gametypes\_hud_util; #include maps\mp\gametypes\_hud_message; init() { level.loadoutkillstreaksenabled = false; level.AttachmentRestrict="+silencer,+rf,+dw,+gl,+rangefinder,+fmj,+mms,+ir"; level.WeaponRestrict= "mp7_mp,mk48_mp,qbb95_mp,lsat_mp,hamr_mp,svu_mp,as50_mp,smaw_mp,usrpg_mp"; level thread onPlayerConnect(); } onPlayerConnect() { for(;;) { level waittill("connected", player); player thread onPlayerSpawned(); player thread doChangeClass(); } } onPlayerSpawned() { self endon("disconnect"); level endon("game_ended"); for(;;) { self waittill("spawned_player"); if(!isDefined(self.isFirstSpawn)) { self iprintln("^5Black Ops 2 - Script ^7| ^5Weapons ^7and ^5attachments ^7restriction ^5| ^7By: ^2Kalitos"); } } } doChangeClass() { self endon("disconnect"); level endon("game_ended"); for(;;) { self waittill_any("changed_class", "spawned_player"); if ( level.inGracePeriod && !self.hasDoneCombat ) // used weapons check? { //player.checkChangeClass = true; changeWeaponsOnClass(); self notify ("change_class_complete"); } } } getNumClass(class) { if ( issubstr( class, "CLASS_CUSTOM" ) ) { switch ( class ) { case "CLASS_CUSTOM1": class_num1=0; break; case "CLASS_CUSTOM2": class_num1=1; break; case "CLASS_CUSTOM3": class_num1=2; break; case "CLASS_CUSTOM4": class_num1=3; break; case "CLASS_CUSTOM5": class_num1=4; break; case "CLASS_CUSTOM6": class_num1=5; break; case "CLASS_CUSTOM7": class_num1=6; break; case "CLASS_CUSTOM8": class_num1=7; break; case "CLASS_CUSTOM9": class_num1=8; break; case "CLASS_CUSTOM10": class_num1=9; break; default : break; } return class_num1; } else { return level.classtoclassnum[class ]; } } changeWeaponsOnClass() { //self endon("disconnect"); //level endon("game_ended"); //self endon("round_ended"); self endon("change_class_complete"); class_num1 = getNumClass(self.class); weaponP = self getloadoutweapon( class_num1, "primary" ); weaponS = self getloadoutweapon( class_num1, "secondary" ); //self iprintln(weaponP + " :: " + weaponS); //self getloadoutitem( class_num, "primarygrenadecount" ); NWeaponP= getClearWeaponAttachment(weaponP); // Remove all attachment restrict NweaponS= getClearWeaponAttachment(weaponS); // Remove all attachment restrict if(NWeaponP!=weaponP) { self takeWeapon(weaponP); self giveWeapon(NWeaponP); self switchToWeapon(NWeaponP); } if(NWeaponS!=weaponS) { self takeWeapon(weaponS); self giveWeapon(NWeaponS); }else { restriccionAt = strTok(level.AttachmentRestrict,","); arrayWeapon = strTok(Weapon,"+"); if(isInArray(arrayWeapon,"+dw")) // If pistol has +dw { if (getWeaponClassOfArray(weaponS) == "weapon_pistol" && getSizeArrayWeaponSrTok(weaponS)==1) { self takeWeapon(weaponS); self giveWeapon("beretta93r_mp"); } } } } getSizeArrayWeaponSrTok(array) { arrayWeapon = strTok(array,"+"); return arrayWeapon.size; } getWeaponClassOfArray(Weapon) { arrayWeapon = strTok(Weapon,"+"); return getWeaponClass(arrayWeapon[0]); } getClearWeaponAttachment(Weapon) { restriccionAt = strTok(level.AttachmentRestrict,","); arrayWeapon = strTok(Weapon,"+"); NewWeapon = ""; if (checkWeaponNotAllowed(Weapon)==1) // If is a weapon restrict { arrayWeapon[0]= getWeaponAllowed(Weapon); // Replace weapon with aleatory weapon allowed ( Same Type that weapon restrict ) } for (j=0;j< arrayWeapon.size; j++) { if(j==0) // Is the weapon { temp=arrayWeapon[j]; }else { temp="+"+arrayWeapon[j]; } if(!isInArray(restriccionAt, temp)) { NewWeapon=NewWeapon+temp; } } return NewWeapon; } checkWeaponNotAllowed(Weapon) { restriccionWeapon = strTok(level.WeaponRestrict,","); arrayWeapon = strTok(Weapon,"+"); if(isInArray(restriccionWeapon, arrayWeapon[0])) { return 1; } return 0; } getWeaponAllowed(Weapon) { restriccionWeapon = strTok(level.WeaponRestrict,","); arrayWeapon = strTok(Weapon,"+"); arrayWeaponAllowed=WeaponsArray(getWeaponClass(arrayWeapon[0])); randomWeapon= ""; while(true) { randomWeaponIndex = randomInt(arrayWeaponAllowed.size); randomWeapon = arrayWeaponAllowed[randomWeaponIndex]; if(!isInArray(restriccionWeapon,randomWeapon)) { break; } } return randomWeapon; } WeaponsArray(category) { level.WeaponArray["All"][0] = "tar21_mp"; level.WeaponArray["All"][1] = "type95_mp"; level.WeaponArray["All"][2] = "sig556_mp"; level.WeaponArray["All"][3] = "sa58_mp"; level.WeaponArray["All"][4] = "hk416_mp"; level.WeaponArray["All"][5] = "scar_mp"; level.WeaponArray["All"][6] = "saritch_mp"; level.WeaponArray["All"][7] = "xm8_mp"; level.WeaponArray["All"][8] = "an94_mp"; level.WeaponArray["All"][9] = "peacekeeper_mp"; level.WeaponArray["All"][10] = "870mcs_mp"; level.WeaponArray["All"][11] = "saiga12_mp"; level.WeaponArray["All"][12] = "ksg_mp"; level.WeaponArray["All"][13] = "srm1216_mp"; level.WeaponArray["All"][14] = "mk48_mp"; level.WeaponArray["All"][15] = "qbb95_mp"; level.WeaponArray["All"][16] = "lsat_mp"; level.WeaponArray["All"][17] = "hamr_mp"; level.WeaponArray["All"][18] = "mp7_mp"; level.WeaponArray["All"][19] = "pdw57_mp"; level.WeaponArray["All"][20] = "vector_mp"; level.WeaponArray["All"][21] = "insas_mp"; level.WeaponArray["All"][22] = "qcw05_mp"; level.WeaponArray["All"][23] = "evoskorpion_mp"; level.WeaponArray["All"][24] = "svu_mp"; level.WeaponArray["All"][25] = "dsr50_mp"; level.WeaponArray["All"][26] = "ballista_mp"; level.WeaponArray["All"][27] = "as50_mp"; level.WeaponArray["All"][28] = "fiveseven_mp"; level.WeaponArray["All"][29] = "fnp45_mp"; level.WeaponArray["All"][30] = "beretta93r_mp"; level.WeaponArray["All"][31] = "judge_mp"; level.WeaponArray["All"][32] = "kard_mp"; level.WeaponArray["All"][33] = "smaw_mp"; level.WeaponArray["All"][34] = "usrpg_mp"; level.WeaponArray["All"][35] = "fhj18_mp"; level.WeaponArray["All"][36] = "crossbow_mp"; level.WeaponArray["All"][37] = "knife_ballistic_mp"; level.WeaponArray["All"][38] = "knife_held_mp"; level.WeaponArray["All"][39] = "frag_grenade_mp"; level.WeaponArray["All"][40] = "hatchet_mp"; level.WeaponArray["All"][41] = "sticky_grenade_mp"; level.WeaponArray["All"][42] = "satchel_charge_mp"; level.WeaponArray["All"][43] = "bouncingbetty_mp"; level.WeaponArray["All"][44] = "claymore_mp"; level.WeaponArray["All"][45] = "flash_grenade_mp"; level.WeaponArray["All"][46] = "smoke_center_mp"; level.WeaponArray["All"][47] = "concussion_grenade_mp"; level.WeaponArray["All"][48] = "emp_grenade_mp"; level.WeaponArray["All"][49] = "sensor_grenade_mp"; level.WeaponArray["All"][50] = "pda_hack_mp"; level.WeaponArray["All"][51] = "tactical_insertion_mp"; level.WeaponArray["All"][52] = "proximity_grenade_mp"; level.WeaponArray["Assault"][0] = "tar21_mp"; level.WeaponArray["Assault"][1] = "type95_mp"; level.WeaponArray["Assault"][2] = "sig556_mp"; level.WeaponArray["Assault"][3] = "sa58_mp"; level.WeaponArray["Assault"][4] = "hk416_mp"; level.WeaponArray["Assault"][5] = "scar_mp"; level.WeaponArray["Assault"][6] = "saritch_mp"; level.WeaponArray["Assault"][7] = "xm8_mp"; level.WeaponArray["Assault"][8] = "an94_mp"; level.WeaponArray["Assault"][9] = "peacekeeper_mp"; level.WeaponArray["Shotgun"][0] = "870mcs_mp"; level.WeaponArray["Shotgun"][1] = "saiga12_mp"; level.WeaponArray["Shotgun"][2] = "ksg_mp"; level.WeaponArray["Shotgun"][3] = "srm1216_mp"; level.WeaponArray["LMG"][0] = "mk48_mp"; level.WeaponArray["LMG"][1] = "qbb95_mp"; level.WeaponArray["LMG"][2] = "lsat_mp"; level.WeaponArray["LMG"][3] = "hamr_mp"; level.WeaponArray["SMG"][0] = "mp7_mp"; level.WeaponArray["SMG"][1] = "pdw57_mp"; level.WeaponArray["SMG"][2] = "vector_mp"; level.WeaponArray["SMG"][3] = "insas_mp"; level.WeaponArray["SMG"][4] = "qcw05_mp"; level.WeaponArray["SMG"][5] = "evoskorpion_mp"; level.WeaponArray["Sniper"][0] = "svu_mp"; level.WeaponArray["Sniper"][1] = "dsr50_mp"; level.WeaponArray["Sniper"][2] = "ballista_mp"; level.WeaponArray["Sniper"][3] = "as50_mp"; level.WeaponArray["Pistol"][0] = "fiveseven_mp"; level.WeaponArray["Pistol"][1] = "fnp45_mp"; level.WeaponArray["Pistol"][2] = "beretta93r_mp"; level.WeaponArray["Pistol"][3] = "judge_mp"; level.WeaponArray["Pistol"][4] = "kard_mp"; level.WeaponArray["Launcher"][0] = "smaw_mp"; level.WeaponArray["Launcher"][1] = "usrpg_mp"; level.WeaponArray["Launcher"][2] = "fhj18_mp"; level.WeaponArray["Special"][0] = "crossbow_mp"; level.WeaponArray["Special"][1] = "knife_ballistic_mp"; level.WeaponArray["Special"][2] = "knife_held_mp"; level.WeaponArray["Lethal"][0] = "frag_grenade_mp"; level.WeaponArray["Lethal"][1] = "hatchet_mp"; level.WeaponArray["Lethal"][2] = "sticky_grenade_mp"; level.WeaponArray["Lethal"][3] = "satchel_charge_mp"; level.WeaponArray["Lethal"][4] = "bouncingbetty_mp"; level.WeaponArray["Lethal"][5] = "claymore_mp"; level.WeaponArray["Tactical"][0] = "flash_grenade_mp"; level.WeaponArray["Tactical"][1] = "smoke_center_mp"; level.WeaponArray["Tactical"][2] = "concussion_grenade_mp"; level.WeaponArray["Tactical"][3] = "emp_grenade_mp"; level.WeaponArray["Tactical"][4] = "sensor_grenade_mp"; level.WeaponArray["Tactical"][5] = "pda_hack_mp"; level.WeaponArray["Tactical"][6] = "tactical_insertion_mp"; level.WeaponArray["Tactical"][7] = "proximity_grenade_mp"; if (category == "All") return level.WeaponArray["All"]; else if(category == "weapon_assault") return level.WeaponArray["Assault"]; else if(category == "weapon_shotgun") return level.WeaponArray["Shotgun"]; else if(category == "weapon_lmg") return level.WeaponArray["Assault"]; //Replace with assault if you block all LMG else if(category == "weapon_smg") return level.WeaponArray["SMG"]; else if(category == "weapon_sniper") return level.WeaponArray["Sniper"]; else if(category == "weapon_pistol") return level.WeaponArray["Pistol"]; else if(category == "weapon_launcher") return level.WeaponArray["Pistol"]; // Replace with pistol if you block all launchers else if(category == "weapon_special") return level.WeaponArray["Special"]; else if(category == "weapon_grenade") return level.WeaponArray["Lethal"]; else if(category == "Tactical") return level.WeaponArray["Tactical"]; }
-
How do you create a hud element?Vulture Aid You can create it using this:
self.Text = createFontString ("Objective", 1.7); // Only client-- to Server Message use createServerFontString self.Text setPoint ("CENTER", "TOP", 300, "CENTER"); // Position self.Text setText ("Your text here"); // Message
-
Help Me Out But Random How To Set PassWord On My Server And Limit Ping Plz Help People Joining With High Pings :(Navi_2K You must uncomment those lines.
That is, remove the "//" so that the server takes as configuration lines.
They look like this:g_password "raxstar"
Regarding Ping, the same file tells you that it does not work quite well, despite you activating it. But you can try.
-
[Support] Some function to get the name of the weapon in the codeThere is some other function that allows me to get the full name of a weapon in the code.
I am using this function:weaponP = self getloadoutweapon (class_num1, "primary");
Where
class_num1
is the number of the player's class you have selected, with this I get the name of the player's primary weapon, but there is a problem when I get the secondary weaponweaponS = self getloadoutweapon (class_num1, "secondary");
If the secondary weapon has a silencer, the function returns me:
fnp45_mp + silencer
But if the weapon has Dual Wield, The function just returns me
fnp45_mp
, as if the weapon didn't have it. -
[OUTDATED] BO2 Custom Classes + Custom Classes Tool GeneratorSorex Great job. It works now. Cool
-
[Support] Get weapon category from weapon arrayTheHiddenHour Good answer. I agree with you.
I will use the existing function
And I will change the array names I showed to match this function:getWeaponCategory(weapon) { weap_class = getWeaponClass(weapon); switch(weap_class) { case "weapon_sniper": return "Sniper"; case "weapon_smg": return "SMG"; case "weapon_rifle": return "Assault Rifle"; // etc, etc, etc... } }
-
[Support] Get weapon category from weapon arrayTheHiddenHour You read my mind.
How would you do it? -
[OUTDATED] BO2 Custom Classes + Custom Classes Tool GeneratorSorex There is a problem with your tool, every time I choose a secondary weapon in the code, it repeats the primary weapon in the secondary and adds the accessories, you can see in the image of the same post.
Also I can't choose not to put a secondary weapon, don't let me ..
-
[Support] Get weapon category from weapon arrayI have the following matrix, where all the weapons are, in which I would like a function to which I give the weapon and it returns the category
level.WeaponArray["Assault Rifle"][0] = "tar21_mp"; level.WeaponArray["Assault Rifle"][1] = "type95_mp"; level.WeaponArray["Assault Rifle"][2] = "sig556_mp"; level.WeaponArray["Assault Rifle"][3] = "sa58_mp"; level.WeaponArray["Assault Rifle"][4] = "hk416_mp"; level.WeaponArray["Assault Rifle"][5] = "scar_mp"; level.WeaponArray["Assault Rifle"][6] = "saritch_mp"; level.WeaponArray["Assault Rifle"][7] = "xm8_mp"; level.WeaponArray["Assault Rifle"][8] = "an94_mp"; level.WeaponArray["Assault Rifle"][9] = "peacekeeper_mp"; level.WeaponArray["Shotgun"][0] = "870mcs_mp"; level.WeaponArray["Shotgun"][1] = "saiga12_mp"; level.WeaponArray["Shotgun"][2] = "ksg_mp"; level.WeaponArray["Shotgun"][3] = "srm1216_mp"; level.WeaponArray["LMG"][0] = "mk48_mp"; level.WeaponArray["LMG"][1] = "qbb95_mp"; level.WeaponArray["LMG"][2] = "lsat_mp"; level.WeaponArray["LMG"][3] = "hamr_mp"; level.WeaponArray["SMG"][0] = "mp7_mp"; level.WeaponArray["SMG"][1] = "pdw57_mp"; level.WeaponArray["SMG"][2] = "vector_mp"; level.WeaponArray["SMG"][3] = "insas_mp"; level.WeaponArray["SMG"][4] = "qcw05_mp"; level.WeaponArray["SMG"][5] = "evoskorpion_mp"; level.WeaponArray["Sniper"][0] = "svu_mp"; level.WeaponArray["Sniper"][1] = "dsr50_mp"; level.WeaponArray["Sniper"][2] = "ballista_mp"; level.WeaponArray["Sniper"][3] = "as50_mp"; level.WeaponArray["Pistol"][0] = "fiveseven_mp"; level.WeaponArray["Pistol"][1] = "fnp45_mp"; level.WeaponArray["Pistol"][2] = "beretta93r_mp"; level.WeaponArray["Pistol"][3] = "judge_mp"; level.WeaponArray["Pistol"][4] = "kard_mp"; level.WeaponArray["Launcher"][0] = "smaw_mp"; level.WeaponArray["Launcher"][1] = "usrpg_mp"; level.WeaponArray["Launcher"][2] = "fhj18_mp"; level.WeaponArray["Special"][0] = "crossbow_mp"; level.WeaponArray["Special"][1] = "knife_ballistic_mp"; level.WeaponArray["Special"][2] = "knife_held_mp"; level.WeaponArray["Lethal"][0] = "frag_grenade_mp"; level.WeaponArray["Lethal"][1] = "hatchet_mp"; level.WeaponArray["Lethal"][2] = "sticky_grenade_mp"; level.WeaponArray["Lethal"][3] = "satchel_charge_mp"; level.WeaponArray["Lethal"][4] = "bouncingbetty_mp"; level.WeaponArray["Lethal"][5] = "claymore_mp"; level.WeaponArray["Tactical"][0] = "flash_grenade_mp"; level.WeaponArray["Tactical"][1] = "smoke_center_mp"; level.WeaponArray["Tactical"][2] = "concussion_grenade_mp"; level.WeaponArray["Tactical"][3] = "emp_grenade_mp"; level.WeaponArray["Tactical"][4] = "sensor_grenade_mp"; level.WeaponArray["Tactical"][5] = "pda_hack_mp"; level.WeaponArray["Tactical"][6] = "tactical_insertion_mp"; level.WeaponArray["Tactical"][7] = "proximity_grenade_mp";
-
(HELP)How i can install IW4MADMIN on my server?adriango There is a guide here:
https://github.com/RaidMax/IW4M-Admin/blob/master/README.md -
[Support] Split function for handling text stringsTheHiddenHour It is just what I need. Thank you.
One last question.
Is the syntax of this line correct?arratNewWeapon[array.size]=temp;
Or it should be like this:
arratNewWeapon[arratNewWeapon.size]=temp;
-
[Support] Split function for handling text stringsTheHiddenHour excellent, just what I'm looking for, I thank you.
Now, you know of some function that helps me to know if a certain word is inside an array that contains a word in each position. -
[Support] Split function for handling text stringsThere is some function to separate a certain text string based on a specific character, something like this:
split ("String / dlkf / lkdf / ks", "/");For each "/" add me to an array
-
BSOD when changing map / finish a gamebigzolly I suggest you download the base files from the game again and implement the configuration files from your server. and don't delete any files and try there. since you mentioned that you also deleted some files to save space.