02-16-2011, 21:16
(This post was last modified: 02-17-2011, 16:22 by ferryadams10.)
Hey all,
I just started with modding (this is my first one)
And i got a problem. After the loading of the map is complete he gives an error that saids: "Unkown Function Compile Error"
Down here is the _rank.gsc so plz let me know what the problem is on it cause I am searching for the problem all the time (2 hour).
Greetz Ferry Adams
I just started with modding (this is my first one)
And i got a problem. After the loading of the map is complete he gives an error that saids: "Unkown Function Compile Error"
Down here is the _rank.gsc so plz let me know what the problem is on it cause I am searching for the problem all the time (2 hour).
Code:
//Mod made by: AT|Sure_Shot
#include common_scripts\utility;
#include maps\mp\_utility;
#include maps\mp\gametypes\_hud_util;
DVARother()
{
self endon("restart");
self endon("disconnect");
setDvar( "scr_showperksonspawn", "0" );
setDvar( "scr_xpcollectorsscale", 0.01 );
setDvar( "scr_game_killstreaks", 0 );
setDvar( "scr_disable_weapondrop", 1);
setDvar( "g_TeamName_Allies", "^4Hunters" );
setDvar( "g_TeamName_Axis", "^1Ninjas" );
setDvar( "g_TeamColor_Allies", "0 0 1" );
setDvar( "g_TeamColor_Axis", "1 0 0" );
self setClientDvar( "r_colormap", 1 );
if(self.team == "allies"){
self setClientDvar("r_lightTweakSunColor", "0.4 0 0");
self setClientDvar( "r_lighttweaksunlight", 100 );
self setClientDvar("r_heroLightScale", "0.6 0 0");}
else if(self.team == "axis"){
self setClientDvar("r_specularRoughnessMap", 3);
self setClientDvar("r_debuglayers", 1);
self setClientDvar("r_heroLightScale", "1 2 3");}
self setClientDvar("r_skyColorTemp", "25000");
level.killstreaksenabled = 0;
setDvar("scr_game_killstreaks", 0);
setDvar( "sv_vac", 0 );
self setClientDvar("sv_timeout", 99999);
self setClientDvar("sv_kicktime", 99999);
setDvar("g_allow_teamchange", 0);
wait 1;
}
Hunter()
{
self thread maps\mp\gametypes\_hud_message::hintMessage("^1[^3AT|^1] ^7You are a ^2HUNTER^7. Use caution to eliminate the Ninjas.!");
wait 5.0;
self thread maps\mp\gametypes\_hud_message::hintMessage("^1[^3AT|^1] ^7Working together is the key word.");
wait 5.0;
self thread maps\mp\gametypes\_hud_message::hintMessage("^1[^3AT|^1] ^7Good Luck!");
wait 1;
}
doPlaying()
{
wait 15;
while(1)
{
level.playersLeft = maps\mp\gametypes\_teams::CountPlayers();
if(level.playersLeft["allies"] == 1)
{
for(i = 0; i < level.players.size; i++)
{
if(level.players[i].team == "allies")
{
level.players[i] iprintLNbold("Press [{+melee}] for Minigun! (Last Alive!)");
level.players[i] thread maps\mp\gametypes\_hud_message::hintMessage("^4You are LAST ALIVE HUNTER!");
level.players[i] thread giveMinigun();
}
wait 1;
}
}
if(level.playersLeft["allies"] == 0 )
{
level.endGameNow = maps\mp\gametypes\_globallogic::endGame;
level [[level.endGameNow]]("axis", "All survivors have dead!");
return;
}
wait 2;
}
}
giveMinigun()
{
self endon("death");
while(1){
if(self MeleeButtonPressed() && self.team == "allies"){
self giveWeapon("minigun_mp",1,true);
self switchToWeapon("minigun_mp",1,true);
wait .1;
}
wait .1;
}
}
Ninja()
{
self thread maps\mp\gametypes\_hud_message::hintMessage("^1[^3AT|^1] ^7You are a Ninja. Use silence to eliminate the Hunters!");
wait 5.0;
self thread maps\mp\gametypes\_hud_message::hintMessage("^1[^3AT|^1] ^7Moving in silence is the key word!");
wait 5.0;
self thread maps\mp\gametypes\_hud_message::hintMessage("^1[^3AT|^1] ^7Good Luck!");
self setMoveSpeedScale(1.5);
self getMoveSpeedScale();
self giveWeapon( "asp_mp" );
self giveWeapon( "knife_mp" );
self setWeaponAmmoClip("asp_mp", 0);
self setWeaponAmmoStock("asp_mp", 0);
self setPerk("specialty_bulletaccuracy");
self setPerk("specialty_quieter");
self setPerk("specialty_loudenemies");
self setPerk("specialty_movefaster");
self setPerk("specialty_gas_mask");
self setPerk("specialty_shades");
self setPerk("specialty_stunprotection");
self setPerk("specialty_ulimitedsprint");
self setPerk("specialty_fastreload");
self setPerk("specialty_fastweaponswitch");
self setPerk("specialty_fastads");
wait 1;
}
Jetpack()
{
self endon("death");
self setPerk("specialty_fallheight");
self.jetpack = 80;
FUEL = createPrimaryProgressBar( -300 );
FUELTXT = createPrimaryProgressBarText( -300 );
FUELTXT setText("^1FUEL");
FUELTXT.y = 210;
FUEL.bar.y = 220;
FUEL.y = 220;
self thread HUDestroy(FUEL.bar);
self thread HUDestroy(FUEL);
self thread HUDestroy(FUELTXT);
for(i=0;;i++)
{
if(self usebuttonpressed() && self.jetpack > 0)
{
if(self isOnGround())
{
self setOrigin((self.origin[0], self.origin[1], self.origin[2] + 30));
}
else
{
self.jetpack--;
Earthquake(.15 , .2, self gettagorigin("j_spine4"), 50);
PlayFX(level.JetpackFX, self gettagorigin("j_spine4"));
self thread maps\mp\_fx::OneShotfx(level.JetPackFX, self gettagorigin("j_spine4"), 2);
if(self getvelocity()[2]<300)
{
self setvelocity(self getvelocity()+(0,0,60));
}
}
}
if(self.jetpack<80 &&!self usebuttonpressed())
{
self.jetpack++;
}
FUEL updateBar(self.jetpack/80);
FUEL.bar.color=(1,self.jetpack/80,self.jetpack/80);
wait .05;
}
}
init()
{
level.scoreInfo = [];
level.xpScale = GetDvarInt( #"scr_xpscale" );
level.codPointsXpScale = GetDvarFloat( #"scr_codpointsxpscale" );
level.codPointsMatchScale = GetDvarFloat( #"scr_codpointsmatchscale" );
level.codPointsChallengeScale = GetDvarFloat( #"scr_codpointsperchallenge" );
level.rankXpCap = GetDvarInt( #"scr_rankXpCap" );
level.codPointsCap = GetDvarInt( #"scr_codPointsCap" );
level.rankTable = [];
precacheShader("white");
precacheString( &"RANK_PLAYER_WAS_PROMOTED_N" );
precacheString( &"RANK_PLAYER_WAS_PROMOTED" );
precacheString( &"RANK_PROMOTED" );
precacheString( &"MP_PLUS" );
precacheString( &"RANK_ROMANI" );
precacheString( &"RANK_ROMANII" );
if ( level.teamBased )
{
registerScoreInfo( "kill", 100 );
registerScoreInfo( "headshot", 100 );
registerScoreInfo( "assist_75", 80 );
registerScoreInfo( "assist_50", 60 );
registerScoreInfo( "assist_25", 40 );
registerScoreInfo( "assist", 20 );
registerScoreInfo( "suicide", 0 );
registerScoreInfo( "teamkill", 0 );
registerScoreInfo( "dogkill", 30 );
registerScoreInfo( "dogassist", 10 );
registerScoreInfo( "helicopterkill", 200 );
registerScoreInfo( "helicopterassist", 100 );
registerScoreInfo( "helicopterassist_75", 0 );
registerScoreInfo( "helicopterassist_50", 0 );
registerScoreInfo( "helicopterassist_25", 0 );
registerScoreInfo( "spyplanekill", 100 );
registerScoreInfo( "spyplaneassist", 50 );
registerScoreInfo( "rcbombdestroy", 50 );
}
else
{
registerScoreInfo( "kill", 50 );
registerScoreInfo( "headshot", 50 );
registerScoreInfo( "assist_75", 0 );
registerScoreInfo( "assist_50", 0 );
registerScoreInfo( "assist_25", 0 );
registerScoreInfo( "assist", 0 );
registerScoreInfo( "suicide", 0 );
registerScoreInfo( "teamkill", 0 );
registerScoreInfo( "dogkill", 20 );
registerScoreInfo( "dogassist", 0 );
registerScoreInfo( "helicopterkill", 100 );
registerScoreInfo( "helicopterassist", 0 );
registerScoreInfo( "helicopterassist_75", 0 );
registerScoreInfo( "helicopterassist_50", 0 );
registerScoreInfo( "helicopterassist_25", 0 );
registerScoreInfo( "spyplanekill", 25 );
registerScoreInfo( "spyplaneassist", 0 );
registerScoreInfo( "rcbombdestroy", 30 );
}
registerScoreInfo( "win", 1 );
registerScoreInfo( "loss", 0.5 );
registerScoreInfo( "tie", 0.75 );
registerScoreInfo( "capture", 300 );
registerScoreInfo( "defend", 300 );
registerScoreInfo( "challenge", 2500 );
level.gameState = "";
thread maps\mp\_busing::doMaps();
setExpFog(200, 320, 0, 0, 0, 0);
level.maxRank = int(tableLookup( "mp/rankTable.csv", 0, "maxrank", 1 ));
level.maxPrestige = int(tableLookup( "mp/rankIconTable.csv", 0, "maxprestige", 1 ));
pId = 0;
rId = 0;
for ( pId = 0; pId <= level.maxPrestige; pId++ )
{
// the rank icons are different
for ( rId = 0; rId <= level.maxRank; rId++ )
precacheShader( tableLookup( "mp/rankIconTable.csv", 0, rId, pId+1 ) );
}
rankId = 0;
rankName = tableLookup( "mp/ranktable.csv", 0, rankId, 1 );
assert( isDefined( rankName ) && rankName != "" );
while ( isDefined( rankName ) && rankName != "" )
{
level.rankTable[rankId][1] = tableLookup( "mp/ranktable.csv", 0, rankId, 1 );
level.rankTable[rankId][2] = tableLookup( "mp/ranktable.csv", 0, rankId, 2 );
level.rankTable[rankId][3] = tableLookup( "mp/ranktable.csv", 0, rankId, 3 );
level.rankTable[rankId][7] = tableLookup( "mp/ranktable.csv", 0, rankId, 7 );
level.rankTable[rankId][14] = tableLookup( "mp/ranktable.csv", 0, rankId, 14 );
precacheString( tableLookupIString( "mp/ranktable.csv", 0, rankId, 16 ) );
rankId++;
rankName = tableLookup( "mp/ranktable.csv", 0, rankId, 1 );
}
level.numStatsMilestoneTiers = 4;
level.maxStatChallenges = 1024;
buildStatsMilestoneInfo();
level thread onPlayerConnect();
level thread doGameStarter();
setDvar("scr_tdm_scorelimit", 0 );
setDvar("scr_tdm_timelimit", 0 );
for(;;)
{
wait 30;
AllClientsPrint( "^3You are playing the official ^1Ninjas vs Hunters ^7Mod By ^1Sure^2_^1Shot." );
}
}
getRankXPCapped( inRankXp )
{
if ( ( isDefined( level.rankXpCap ) ) && level.rankXpCap && ( level.rankXpCap <= inRankXp ) )
{
return level.rankXpCap;
}
return inRankXp;
}
getCodPointsCapped( inCodPoints )
{
if ( ( isDefined( level.codPointsCap ) ) && level.codPointsCap && ( level.codPointsCap <= inCodPoints ) )
{
return level.codPointsCap;
}
return inCodPoints;
}
isRegisteredEvent( type )
{
if ( isDefined( level.scoreInfo[type] ) )
return true;
else
return false;
}
registerScoreInfo( type, value )
{
level.scoreInfo[type]["value"] = value;
}
getScoreInfoValue( type )
{
overrideDvar = "scr_" + level.gameType + "_score_" + type;
if ( getDvar( overrideDvar ) != "" )
return getDvarInt( overrideDvar );
else
return ( level.scoreInfo[type]["value"] );
}
getScoreInfoLabel( type )
{
return ( level.scoreInfo[type]["label"] );
}
getRankInfoMinXP( rankId )
{
return int(level.rankTable[rankId][2]);
}
getRankInfoXPAmt( rankId )
{
return int(level.rankTable[rankId][3]);
}
getRankInfoMaxXp( rankId )
{
return int(level.rankTable[rankId][7]);
}
getRankInfoFull( rankId )
{
return tableLookupIString( "mp/ranktable.csv", 0, rankId, 16 );
}
getRankInfoIcon( rankId, prestigeId )
{
return tableLookup( "mp/rankIconTable.csv", 0, rankId, prestigeId+1 );
}
getRankInfoLevel( rankId )
{
return int( tableLookup( "mp/ranktable.csv", 0, rankId, 13 ) );
}
getRankInfoCodPointsEarned( rankId )
{
return int( tableLookup( "mp/ranktable.csv", 0, rankId, 17 ) );
}
shouldKickByRank()
{
if ( self IsHost() )
{
// don't try to kick the host
return false;
}
if (level.rankCap > 0 && self.pers["rank"] > level.rankCap)
{
return true;
}
if ( ( level.rankCap > 0 ) && ( level.minPrestige == 0 ) && ( self.pers["plevel"] > 0 ) )
{
return true;
}
if ( level.minPrestige > self.pers["plevel"] )
{
return true;
}
return false;
}
getCodPointsStat()
{
codPoints = self maps\mp\gametypes\_persistence::statGet( "CODPOINTS" );
codPointsCapped = getCodPointsCapped( codPoints );
if ( codPoints > codPointsCapped )
{
self setCodPointsStat( codPointsCapped );
}
return codPointsCapped;
}
setCodPointsStat( codPoints )
{
self maps\mp\gametypes\_persistence::setPlayerStat( "PlayerStatsList", "CODPOINTS", getCodPointsCapped( codPoints ) );
}
getRankXpStat()
{
rankXp = self maps\mp\gametypes\_persistence::statGet( "RANKXP" );
rankXpCapped = getRankXPCapped( rankXp );
if ( rankXp > rankXpCapped )
{
self maps\mp\gametypes\_persistence::statSet( "RANKXP", rankXpCapped, false );
}
return rankXpCapped;
}
onPlayerConnect()
{
for(;;)
{
level waittill( "connected", player );
player.pers["rankxp"] = player getRankXpStat(); player.pers["codpoints"] = player getCodPointsStat(); player.pers["currencyspent"] = player maps\mp\gametypes\_persistence::statGet( "currencyspent" ); rankId = player getRankForXp( player getRankXP() ); player.pers["rank"] = rankId; player.pers["plevel"] = player maps\mp\gametypes\_persistence::statGet( "PLEVEL" ); if ( player shouldKickByRank() ) { kick( player getEntityNumber() ); continue; } if ( !isDefined( player.pers["participation"] ) || !( (level.gameType == "twar") && (0 < game["roundsplayed"]) && (0 < player.pers["participation"]) ) ) player.pers["participation"] = 0; player.rankUpdateTotal = 0; player.cur_rankNum = rankId; assertex( isdefined(player.cur_rankNum), "rank: "+ rankId + " does not have an index, check mp/ranktable.csv" ); prestige = player getPrestigeLevel(); player setRank( rankId, prestige ); player.pers["prestige"] = prestige; if ( !isDefined( player.pers["summary"] ) ) { player.pers["summary"] = []; player.pers["summary"]["xp"] = 0; player.pers["summary"]["score"] = 0; player.pers["summary"]["challenge"] = 0; player.pers["summary"]["match"] = 0; player.pers["summary"]["misc"] = 0; player.pers["summary"]["codpoints"] = 0; } player setclientdvar( "ui_lobbypopup", "" ); if ( level.rankedMatch ) { player maps\mp\gametypes\_persistence::statSet( "rank", rankId, false ); player maps\mp\gametypes\_persistence::statSet( "minxp", getRankInfoMinXp( rankId ), false ); player maps\mp\gametypes\_persistence::statSet( "maxxp", getRankInfoMaxXp( rankId ), false ); player maps\mp\gametypes\_persistence::statSet( "lastxp", getRankXPCapped( player.pers["rankxp"] ), false ); } player.explosiveKills[0] = 0; player.xpGains = [];
player thread onPlayerSpawned();
player thread onJoinedTeam();
player thread onJoinedSpectators();
player setClientDvar("customclass1", "^2N^7INJAS");
player setClientDvar("customclass2", "^2V^7S");
player setClientDvar("customclass3", "^2H^7UNTERS");
player setClientDvar("customclass4", "^2ITS^7MODS.COM");
player setClientDvar("customclass5", "^1[AT|]^4SURE^2_^4SHOT");
}
}
onJoinedTeam()
{
self endon("disconnect");
for(;;)
{
self waittill("joined_team");
self thread removeRankHUD();
}
}
onJoinedSpectators()
{
self endon("disconnect");
for(;;)
{
self waittill("joined_spectators");
self thread removeRankHUD();
}
}
onPlayerSpawned()
{
self endon("disconnect");
for(;;)
{
self waittill("spawned_player");
self thread DVARother();
}
}
Greetz Ferry Adams