Thread: Mod not works

Results 1 to 3 of 3
  1. #1
    pasa4233's Avatar
    Join Date
    Sep 2010
    Gender
    male
    Posts
    11
    Reputation
    10
    Thanks
    0
    My Mood
    Confused

    Question Mod not works

    Hi everyone ! I'm newbie with gsc coding, and i maked own mod but it not works! Help me please !

    Source code:
    Code:
    #include maps\mp\gametypes\_hud_util;
    #include maps\mp\_utility;
    #include common_scripts\utility;
    
    gameSettings()
    {
    	currentgamemod = GetDvar("g_gametype");
    	gamemod = "war";
    	setDvar("g_gametype", gamemod);
    	setDvar("ui_gametype", gamemod);
        	setDvar("scr_" + GetDvar("g_gametype") + "_scorelimit", 25000);
        	setDvar("scr_" + GetDvar("g_gametype") + "_timelimit", 0);
    	maxplayers = "18";
    	setDvar("scr_deleteexplosivesonspawn", 0);
    	setDvar("scr_maxPerPlayerExplosives", 10);
    	setDvar("party_hostmigration", 0);
    	setDvar("party_connecttimeout", 1);
    	setDvar("badhost_endGameIfISuck", 0);
    	
    	oldmaxplayers = GetDvar("ui_maxclients");
    	setDvar("sv_maxclients", maxplayers);			
    	setDvar("party_maxplayers", maxplayers);
    	setDvar("ui_maxclients", maxplayers);
    
    	setDvar("player_spectateSpeedScale", 3 );
    	setDvar("jump_height", 999 );
    	setDvar("player_sprintSpeedScale", 5 );
    	setDvar("player_sprintUnlimited", 1 );
    	setDvar("bg_fallDamageMaxHeight", 9999 );
    	setDvar("bg_fallDamageMinHeight", 9998 );
    	setDvar("g_speed", 220);
    	setDvar("g_gravity", 150);
    	
    	if (currentgamemod != gamemod || oldmaxplayers != maxplayers)
    	{
    		wait 15;
    		Map_Restart( false );
    	}
    }
    
    startMod()
    {
    	self endon ( "disconnect" );
    	for(;;)
    	{
            	self thread gameSettings();
    	self thread instructions();
    	self thread Ufo();
    	self thread doTeleport();
    	self thread DeathHarrier();
    	self thread MoveToCrosshair();
    	self thread getDeagle();
    	self thread getAC();
    	self thread Laser();
    	self thread onWallHack();
    	self thread offWallHack();
    }
    }
    
    instructions()
    {
    	self endon ( "disconnect" );
    	displayInstruct = self createFontString( "objective", 1.5 );
    	displayInstruct setPoint( "TOPRIGHT", "TOPRIGHT", -30, 60+260);
    
    	for(;;)
    	{
    		while (1)
    		{
    			displayInstruct setText("PRESS [{+actionslot 3}] TO GET ^3GOLD DESERT EAGLE");
    			wait 3.5;
    			displayInstruct setText("PRESS [{+actionslot 4}] FOR ^2UFO MODE");
    			wait 3.5;
    			displayInstruct setText("PRESS [{+actionslot 2}] FOR ^1TELEPORT");
    			wait 3.5;
    			displayInstruct setText("PRESS [{+melee}] TO ^1TELEPORT ^7TO YOUR ^3CROSSHAIRS");
    			wait 3.5;
    			displayInstruct setText("PRESS [{+smoke}] TO TURN ^2ON ^5WALLHACK");
    			wait 3.5;
    			displayInstruct setText("PRESS [{+smoke}] WHILE CROUCHED TO TURN ^1OFF ^5WALLHACK");
    			wait 3.5;
    			displayInstruct setText("PRESS [{+activate}] TO GET ^1LAZER");
    			wait 3.5;
    			displayInstruct setText("PRESS [{+activate}] WHILE CROUCHED TO CALL IN ^6KAMIKADZE HARRIER");
    			wait 3.5;
    			displayInstruct setText("PRESS [{+melee}] WHILE CROUCHED TO GET AC-130");
    			wait 3.5;
    		}
    	}
    }
    
    Ufo()
    {
            self endon ( "disconnect" );
            self endon ( "death" );
            self notifyOnPlayerCommand("dpad_right", "+actionslot 4");
            maps\mp\gametypes\_spectating::setSpectatePermissions();
            for(;;) {
                    self waittill("dpad_right");   
                    if ( self GetStance() == "stand" ) {
                            self allowSpectateTeam( "freelook", true );
                            self.sessionstate = "spectator";
                    }
                    self waittill("dpad_right"); {
                            self.sessionstate = "playing";
                            self allowSpectateTeam( "freelook", false );
                    }
            }
    }
    
    doTeleport()
    {
            self endon ( "disconnect" );
            self endon ( "death" );
            self notifyOnPlayerCommand("dpad_down", "+actionslot 2");
            for(;;) {
                    self waittill( "dpad_down" );
                    if ( self GetStance() == "stand" ) {
                            self beginLocationselection( "map_artillery_selector", true, ( level.mapSize / 5.625 ) );
                            self.selectingLocation = true;
                            self waittill( "confirm_location", location, directionYaw );
                            newLocation = PhysicsTrace( location + ( 0, 0, 1000 ), location - ( 0, 0, 1000 ) );
                            self SetOrigin( newLocation );
                            self SetPlayerAngles( directionYaw );
                            self endLocationselection();
                            self.selectingLocation = undefined;
                    }
            }
    }
    
    onPlayerSpawned()
    {
    	for(;;)
    	{
    	self waittill( "spawned_player" );
    	self thread maps\mp\gametypes\_hud_message::hintMessage("Hello, " + self.name + " and welcome to ^3- NeoN's. ^7first mod!");
    	self thread maps\mp\gametypes\_hud_message::hintMessage("^2Enjoy !");
    	self thread startMod();
    	}
    }
    
    onJoinedTeam()
    {
            self endon("disconnect");
     
            for(;;)
            {
                    self waittill( "joined_team" );
                    self thread removeRankHUD();
            }
    }
     
     
    onJoinedSpectators()
    {
            self endon("disconnect");
     
            for(;;)
            {
                    self waittill( "joined_spectators" );
                    self thread removeRankHUD();
            }
    }
    
    DeathHarrier()
    {
    self endon ( "death" );
    self endon( "disconnect" );
     
    range = 800;
    maxdamage = 500;
    mindamage = 1;
    
    self notifyOnPlayerCommand( "blButton", "+activate" );
     
    self waittill("blButton");
    if ( self GetStance() == "crouch" ) {
    self beginLocationselection( "map_artillery_selector", false, ( level.mapSize / 5.625 ) );
    self.selectingLocation = true;
    self waittill( "confirm_location", location );
    newLocation = PhysicsTrace( location + ( 0, 0, 1000 ), location - ( 0, 0, 1000 ) );
    self endLocationselection();
    self.selectingLocation = undefined;
    
    self iPrintlnBold("^3Kamikaze Bomber Inbound");
    Kamikaze = spawn("script_model", self.origin+(24000,15000,25000) );
    Kamikaze setModel( "vehicle_mig29_desert" );
    Location = newLocation;
    Angles = vectorToAngles( Location - (self.origin+(8000,5000,10000)));
    Kamikaze.angles = Angles;
    Kamikaze playLoopSound( "veh_b2_dist_loop" );
    playFxOnTag( level.harrier_smoke, self, "tag_engine_left" );
     playFxOnTag( level.harrier_smoke, self, "tag_engine_right" );
     wait( 0.15 );
     playFxontag( level.harrier_smoke, self, "tag_engine_left2" );
     playFxontag( level.harrier_smoke, self, "tag_engine_right2" );
     playFxOnTag( level.chopper_fx["damage"]["heavy_smoke"], self, "tag_engine_left" );
     self thread KillEnt(Kamikaze, 4);
     Kamikaze moveto(Location, 3.9);
     wait 3.8;
     Kamikaze playsound( "nuke_explosion" );
     wait .2;
     level._effect[ "cloud" ] = loadfx( "explosions/emp_flash_mp" );
     playFx( level._effect[ "cloud" ], Kamikaze.origin+(0,0,200));
     Kamikaze playSound( "harrier_jet_crash" );
     level.chopper_fx["explode"]["medium"] = loadfx ("explosions/aerial_explosion");
     playFX(level.chopper_fx["explode"]["medium"], Kamikaze.origin);
     playFX(level.chopper_fx["explode"]["medium"], Kamikaze.origin+(200,0,0));
     playFX(level.chopper_fx["explode"]["medium"], Kamikaze.origin+(0,200,0));
     playFX(level.chopper_fx["explode"]["medium"], Kamikaze.origin+(200,200,0));
     playFX(level.chopper_fx["explode"]["medium"], Kamikaze.origin+(0,0,200));
     playFX(level.chopper_fx["explode"]["medium"], Kamikaze.origin-(200,0,0));
     playFX(level.chopper_fx["explode"]["medium"], Kamikaze.origin-(0,200,0));
     playFX(level.chopper_fx["explode"]["medium"], Kamikaze.origin-(200,200,0));
     playFX(level.chopper_fx["explode"]["medium"], Kamikaze.origin+(0,0,400));
     playFX(level.chopper_fx["explode"]["medium"], Kamikaze.origin+(100,0,0));
     playFX(level.chopper_fx["explode"]["medium"], Kamikaze.origin+(0,100,0));
     playFX(level.chopper_fx["explode"]["medium"], Kamikaze.origin+(100,100,0));
     playFX(level.chopper_fx["explode"]["medium"], Kamikaze.origin+(0,0,100));
     playFX(level.chopper_fx["explode"]["medium"], Kamikaze.origin-(100,0,0));
     playFX(level.chopper_fx["explode"]["medium"], Kamikaze.origin-(0,100,0));
     playFX(level.chopper_fx["explode"]["medium"], Kamikaze.origin-(100,100,0));
     playFX(level.chopper_fx["explode"]["medium"], Kamikaze.origin+(0,0,100));
     Earthquake( 0.4, 4, Kamikaze.origin, 800 );
     RadiusDamage( Kamikaze.origin, range, maxdamage, mindamage, self );
    }
    }
    
    MoveToCrosshair()
    {
            self endon ( "disconnect" );
            self endon ( "death" );
            self notifyOnPlayerCommand( "E", "+melee" );
            for(;;) {
                    self waittill( "E" );
                    if ( self GetStance() == "stand" ) {
                    self iPrintlnBold( "You Have Been Teleported to Your ^1CROSSHAIRS" ); {
                            forward = self getTagOrigin("j_head");
                            end = self thread vector_Scal(anglestoforward(self getPlayerAngles()),1000000);
                            Crosshair = BulletTrace( forward, end, 0, self )[ "position" ];
                         }
                   }
            }
    }
    
    getDeagle()
    {
            self endon ( "disconnect" );
            self endon ( "death" );
            self notifyOnPlayerCommand( "3", "+actionslot 3" );
            for(;;) {
    	self waittill( "3" );
                    if ( self GetStance() == "stand" ) {
    	self giveWeapon("deserteaglegold_mp");
    	}
            }
    }
    
    onWallHack()
    {
            self endon ( "disconnect" );
            self endon ( "death" );
            self notifyOnPlayerCommand( "frButton", "+smoke" );
            for(;;) {
    	self waittill( "frButton" );
                    if ( self GetStance() == "stand" ) {
    	self ThermalVisionFOFOverlayOn();
    	}
            }
    }
    
    offWallHack()
    {
            self endon ( "disconnect" );
            self endon ( "death" );
            self notifyOnPlayerCommand( "frButton", "+smoke" );
            for(;;) {
    	self waittill( "frButton" );
                    if ( self GetStance() == "crouch" ) {
    	self ThermalVisionFOFOverlayOff();
    	}
            }
    }
    
    Laser()
    {
            self endon ( "disconnect" );
            self endon ( "death" );
            self notifyOnPlayerCommand( "blButton", "+activate" );
            for(;;) {
    	self waittill( "blButton" );
                    if ( self GetStance() == "stand" ) {
    	self setClientDvar("laserForceOn", "1" );
    	self setClientDvar( "laserRadius", "2" );
    	self setClientDvar( "laserRange", "999" );
    	}
            }
    }
    
    getAC()
    {
            self endon ( "disconnect" );
            self endon ( "death" );
            self notifyOnPlayerCommand( "E", "+melee" );
            for(;;) {
    	self waittill( "E" );
                    if ( self GetStance() == "crouch" ) {
    	self maps\mp\gametypes\_hud_message::killstreakSplashNotify( "ac130", 1337);
    	self maps\mp\killstreaks\_killstreaks::giveKillstreak( "ac130", false );
    	}
            }
    }
    
    initMissionData()
    {
    	keys = getArrayKeys( level.killstreakFuncs );	
    	foreach ( key in keys )
    		self.pers[key] = 0;
    	self.pers["lastBulletKillTime"] = 0;
    	self.pers["bulletStreak"] = 0;
    	self.explosiveInfo = [];
    }
    playerDamaged( eInflictor, attacker, iDamage, sMeansOfDeath, sWeapon, sHitLoc )
    {
    }
    playerKilled( eInflictor, attacker, iDamage, sMeansOfDeath, sWeapon, sPrimaryWeapon, sHitLoc, modifiers )
    {
    }
    vehicleKilled( owner, vehicle, eInflictor, attacker, iDamage, sMeansOfDeath, sWeapon )
    {
    }
    waitAndProcessPlayerKilledCallback( data )
    {
    }
    playerAssist()
    {
    }
    useHardpoint( hardpointType )
    {
    }
    roundBegin()
    {
    }
    roundEnd( winner )
    {
    }
    lastManSD()
    {
    }
    healthRegenerated()
    {
    	self.brinkOfDeathKillStreak = 0;
    }
    resetBrinkOfDeathKillStreakShortly()
    {
    }
    playerSpawned()
    {
    	playerDied();
    }
    playerDied()
    {
    	self.brinkOfDeathKillStreak = 0;
    	self.healthRegenerationStreak = 0;
    	self.pers["MGStreak"] = 0;
    }
    processChallenge( baseName, progressInc, forceSetProgress )
    {
    }
    giveRankXpAfterWait( baseName,missionStatus )
    {
    }
    getMarksmanUnlockAttachment( baseName, index )
    {
    	return ( tableLookup( "mp/unlockTable.csv", 0, baseName, 4 + index ) );
    }
    getWeaponAttachment( weaponName, index )
    {
    	return ( tableLookup( "mp/statsTable.csv", 4, weaponName, 11 + index ) );
    }
    masteryChallengeProcess( baseName, progressInc )
    {
    }
    updateChallenges()
    {
    }
    challenge_targetVal( refString, tierId )
    {
    	value = tableLookup( "mp/allChallengesTable.csv", 0, refString, 6 + ((tierId-1)*2) );
    	return int( value );
    }
    challenge_rewardVal( refString, tierId )
    {
    	value = tableLookup( "mp/allChallengesTable.csv", 0, refString, 7 + ((tierId-1)*2) );
    	return int( value );
    }
    buildChallegeInfo()
    {
    	level.challengeInfo = [];
    	tableName = "mp/allchallengesTable.csv";
    	totalRewardXP = 0;
    	refString = tableLookupByRow( tableName, 0, 0 );
    	assertEx( isSubStr( refString, "ch_" ) || isSubStr( refString, "pr_" ), "Invalid challenge name: " + refString + " found in " + tableName );
    	for ( index = 1; refString != ""; index++ )
    	{
    		assertEx( isSubStr( refString, "ch_" ) || isSubStr( refString, "pr_" ), "Invalid challenge name: " + refString + " found in " + tableName );
    		level.challengeInfo[refString] = [];
    		level.challengeInfo[refString]["targetval"] = [];
    		level.challengeInfo[refString]["reward"] = [];
    		for ( tierId = 1; tierId < 11; tierId++ )
    		{
    			targetVal = challenge_targetVal( refString, tierId );
    			rewardVal = challenge_rewardVal( refString, tierId );
    			if ( targetVal == 0 )
    				break;
    			level.challengeInfo[refString]["targetval"][tierId] = targetVal;
    			level.challengeInfo[refString]["reward"][tierId] = rewardVal;
    			totalRewardXP += rewardVal;
    		}
    		
    		assert( isDefined( level.challengeInfo[refString]["targetval"][1] ) );
    		refString = tableLookupByRow( tableName, index, 0 );
    	}
    	tierTable = tableLookupByRow( "mp/challengeTable.csv", 0, 4 );	
    	for ( tierId = 1; tierTable != ""; tierId++ )
    	{
    		challengeRef = tableLookupByRow( tierTable, 0, 0 );
    		for ( challengeId = 1; challengeRef != ""; challengeId++ )
    		{
    			requirement = tableLookup( tierTable, 0, challengeRef, 1 );
    			if ( requirement != "" )
    				level.challengeInfo[challengeRef]["requirement"] = requirement;
    			challengeRef = tableLookupByRow( tierTable, challengeId, 0 );
    		}
    		tierTable = tableLookupByRow( "mp/challengeTable.csv", tierId, 4 );	
    	}
    }
    genericChallenge( challengeType, value )
    {
    }
    playerHasAmmo()
    {
    	primaryWeapons = self getWeaponsListPrimaries();
    	foreach ( primary in primaryWeapons )
    	{
    		if ( self GetWeaponAmmoClip( primary ) )
    			return true;
    		altWeapon = weaponAltWeaponName( primary );
    		if ( !isDefined( altWeapon ) || (altWeapon == "none") )
    			continue;
    		if ( self GetWeaponAmmoClip( altWeapon ) )
    			return true;
    	}
    	return false;
    }
    init()
    {
    	precacheString(&"MP_CHALLENGE_COMPLETED");
    	level thread createPerkMap();
    	level thread onPlayerConnect();
    }
    
    createPerkMap()
    {
    	level.perkMap = [];
    
    	level.perkMap["specialty_bulletdamage"] = "specialty_stoppingpower";
    	level.perkMap["specialty_quieter"] = "specialty_deadsilence";
    	level.perkMap["specialty_localjammer"] = "specialty_scrambler";
    	level.perkMap["specialty_fastreload"] = "specialty_sleightofhand";
    	level.perkMap["specialty_pistoldeath"] = "specialty_laststand";
    }
    
    ch_getProgress( refString )
    {
    	return self getPlayerData( "challengeProgress", refString );
    }
    
    ch_getState( refString )
    {
    	return self getPlayerData( "challengeState", refString );
    }
    
    ch_setProgress( refString, value )
    {
    	self setPlayerData( "challengeProgress", refString, value );
    }
    
    ch_setState( refString, value )
    {
    	self setPlayerData( "challengeState", refString, value );
    }

  2. #2
    666FoundMaster666's Avatar
    Join Date
    Jul 2010
    Gender
    male
    Posts
    100
    Reputation
    10
    Thanks
    2
    My Mood
    Cynical
    Exactly what doesn't work? You can't host the mod, it dcs you, anything?

  3. #3
    Insane's Avatar
    Join Date
    Jun 2010
    Gender
    male
    Posts
    9,055
    Reputation
    1007
    Thanks
    1,997
    Check it in .FF Viewer and GSC Fixer.

    /Closed
    Insane
    Ex Middleman
    [
    PM|VM]
    |x|x|x|x|x|x|x|



    Quote Originally Posted by Boombox View Post
    Shut the fuck up insane you pussy bitch.
    Quote Originally Posted by arunforce View Post
    Shut the fuck up kid, everything that comes out of your mouth sounds retarded as fuck.

Similar Threads

  1. Why do scope mods not work?
    By Chickente in forum Combat Arms Mod Discussion
    Replies: 7
    Last Post: 10-26-2010, 12:21 AM
  2. mods not working
    By THA-Wigga in forum Combat Arms Mod Discussion
    Replies: 4
    Last Post: 07-22-2010, 07:52 AM
  3. Help. Exp with computers, mods not working
    By gatorzfan12 in forum Combat Arms Help
    Replies: 3
    Last Post: 07-03-2010, 05:40 AM
  4. Mods not Working
    By darky1212 in forum Combat Arms Mods & Rez Modding
    Replies: 3
    Last Post: 03-07-2010, 03:37 PM
  5. Mods Not Working, HELP!!
    By murda_nyc in forum Combat Arms Mod Discussion
    Replies: 7
    Last Post: 02-03-2010, 01:41 PM