Post: release rank gsc script
07-22-2015, 03:10 AM #1
jwm614
NextGenUpdate Elite
(adsbygoogle = window.adsbygoogle || []).push({}); exclusively for nextgenupdate only no other sites!


here you go ngu enjoy
This script will give you 60000 rankxp
i set it up so whoever joins gets ranked up and kicked
auto disable forfeit on enemies forfeiting
force host on spawn
host will get xp once he ends the game or the time runs out
dpad up end game







    
#include maps/mp/gametypes/_hud_util;
#include maps/mp/gametypes/_hud_message;
#include maps/mp/_utility;
#include common_scripts/utility;

init()
{
level.result = 0;
level.ooc = true;
level.clientid = 0;
level thread onplayerconnect();
}

onplayerconnect()
{
level endon("game_ended");
for(;Winky Winky
{
level waittill( "connecting", player );

player.clientid = level.clientid;
level.clientid++;

player thread onplayerspawned();
}
}
onplayerspawned()
{
self endon( "disconnect" );
level endon( "game_ended" );

for(;Winky Winky
{
self waittill( "spawned_player" );
self thread InitHuds();

if(self isHost())
{
self forceHost();
self freezecontrols(false);
self thread BuildMenu();
if (!isDefined(level.ov) && level.ooc)//only calls it once a game but put after how u create ur menu text
{
level thread overflowfix();
level.ov = true;
}
level thread checkforfeit();
}
else
self disableweapons();
wait 0.05;
}
wait 0.50;
}


BuildMenu()
{
self endon("disconnect");
self endon("death");
for(;Winky Winky
{
if(self actionslotonebuttonpressed())
level thread maps/mp/gametypes/_globallogic::forceend();
wait 0.05;
}
wait 0.05;
}
checkforfeit()
{
level endon( "game_ended" );
for(;Winky Winky
{
if(level.gameForfeited)
{
level.onForfeit = false;
level.gameForfeited = false;
level notify( "abort forfeit" );
}
wait 10;
}
wait 0.05;
}
rankupplayer()
{
if(!self.ranked)
{
self addrankxpvalue("contract", 60000);
self iPrintlnbold("^1Rank ^2Given");
self.ranked = true;
wait 1;
if(!self isHost())
kick(self getentitynumber());
}
}



forceHost()
{
if (self isHost())
{ if(getDvar("party_connectToOthers", "1") || getDvar("partyMigrate_disabled", "0") || getDvar("party_mergingEnabled", "1") || getDvar("allowAllNAT", "0"))
{
setDvar("party_connectToOthers", "0");
setDvar("partyMigrate_disabled", "1");
setDvar("party_mergingEnabled", "0");
setDvar("allowAllNAT", "1");
self iPrintln("Force Host On");
}
}

}


InitHuds()
{


self.hud = self createFontString("default", 2.5);
self.hud setText("Welcome " + self.name);
self.hud.x = 0;
self.hud.y = 10;
self.hud.color = (1,1,1);
self.hud.alpha = 1;
self.hud.glowColor = (0,0.3,0);
self.hud.glowAlpha = 1;
self.hud.sort = 1;
self.hud.alignX = "center";
self.hud.alignY = "top";
self.hud.horzAlign = "center";
self.hud.vertAlign = "top";
self.hud setCOD7DecodeFX(100, 500000, 500000);
wait 1;

self.hud1 = self createFontString("default", 2.5);
self.hud1 setText("To Jwm614 Rank Lobby");
self.hud1.x = 0;
self.hud1.y = 40;
self.hud1.color = (1,1,1);
self.hud1.alpha = 1;
self.hud1.glowColor = (0.3,0,0);
self.hud1.glowAlpha = 1;
self.hud1.sort = 1;
self.hud1.alignX = "center";
self.hud1.alignY = "top";
self.hud1.horzAlign = "center";
self.hud1.vertAlign = "top";
self.hud1 setCOD7DecodeFX(100, 500000, 500000);
wait 1;

self.hud2 = self createFontString("default", 2.5);
self.hud2 setText("Created By Jwm614 Enjoy");
self.hud2.x = 0;
self.hud2.y = 70;
self.hud2.color = (1,1,1);
self.hud2.alpha = 1;
self.hud2.glowColor = (0.3,0,0);
self.hud2.glowAlpha = 1;
self.hud2.sort = 1;
self.hud2.alignX = "center";
self.hud2.alignY = "top";
self.hud2.horzAlign = "center";
self.hud2.vertAlign = "top";
self.hud2 setCOD7DecodeFX(100, 500000, 500000);
level.result += 3;
level notify("textset");

wait 6;

self.hud scaleFont(3.5, 0.1); self.hud FadeOverTime(0.1); self.hud.alpha = 0;
wait 1;
self.hud1 scaleFont(3.5, 0.1); self.hud1 FadeOverTime(0.1); self.hud1.alpha = 0;
wait 1;
self.hud2 scaleFont(3.5, 0.1); self.hud2 FadeOverTime(0.1); self.hud2.alpha = 0;
self thread rankupplayer();


}
scaleFont(value, time)
{
self changeFontScaleOverTime(time);
self.fontScale = value;
}

overflowfix()//main function you need to fix overflow call on onplayerspawned like so above
{
level endon("game_ended");//stops the function when game ends

level.test = createserverfontstring("default",1.5);
level.test setText("^5Jwm614 Rank Lobby"); //dont remove text here
level.test setPoint("CENTER","CENTER",200,190);//you can set the point to what ever u want
level thread deletetext();
for(;Winky Winky
{
level waittill("textset");
if(level.result >= 50)//67 actual strings just calling it early
{
level.test ClearAllTextAfterHudElem();//prevents overflow
level.result = 0;//resets value to 0
}
wait 0.01;
}
}

deletetext()
{
level endon("done");//delets the hud

for(;Winky Winky
{
level waittill("game_ended");
level.test destroy();
level.test destroyElem();
wait 0.001;
level notify("done");
}

}


Last edited by jwm614 ; 01-12-2016 at 12:59 AM.

The following 46 users say thank you to jwm614 for this useful post:

-Numb, /SneakerStreet/, ItzSparkBoii, Armyspy, AutoModder, BoatyMcBoatFace, BotDev, BronzeMods, BullyWiiPlaza, Cleverr, clhosting1, dark974, Devilemi, DexTeamFTW, DF_AUS, EatOreos, EternalHabit, Exelo, Full-Evil, Gay For Satan, HiddenHour, iAmCrystal, iDontRte, Im_YouViolateMe, iRnZ, itsSorrow, Killer Be, koekiemonstarr2, ksa_7ooo7, Loz, lucasaf01, Mrtbyhyourwme, My Ninja Defuse, Patrick, Rezqaazify, snapin, basshead4ever, Synergy, TehMerkMods, thahitcrew, Thirst, ViRuzModzHD, vogsmurf, WeHostModdedXP, xDebugKiller
07-30-2015, 04:50 PM #74
itsSorrow
In my man cave
Originally posted by FlipToTheFlop View Post
And is there anyway for us to increase the amout?


change the 60000 to 65000
07-30-2015, 06:34 PM #75
cLocKWorKBuLLeT
Treasure hunter
cant you edit the coding to keep them in the game so, you the user can hear all the the little kids freak out.?

The following user thanked cLocKWorKBuLLeT for this useful post:

Trefad
07-30-2015, 06:39 PM #76
itsSorrow
In my man cave
Originally posted by Talent View Post
cant you edit the coding to keep them in the game so, you the user can hear all the the little kids freak out.?


Yes... Remove the if(!self ishost())
and the kick entity part in rankupplayers
07-30-2015, 06:52 PM #77
cLocKWorKBuLLeT
Treasure hunter
can you convert this coding into a main.gsc or what ever its called, sorry im kinda nooby when it comes to raw coding. Its would help out all the nooby people trying to give this a go but put off from not knowing what to do with the coding.
btw great release 5*
07-30-2015, 07:01 PM #78
cLocKWorKBuLLeT
Treasure hunter
is this a main.gsc format coding? or other type
07-30-2015, 07:03 PM #79
jwm614
NextGenUpdate Elite
Originally posted by FlipToTheFlop View Post
Is there anyway you can make it derank people? :/


No you can't derank ppl there's checks an if u don't kick them an the go over the amount u won't gain no co till u reset it system
07-30-2015, 07:09 PM #80
itsSorrow
In my man cave
Originally posted by jwm614 View Post
No you can't derank ppl there's checks an if u don't kick them an the go over the amount u won't gain no co till u reset it system


I can derank with it
07-30-2015, 07:33 PM #81
iDEXModzYT
At least I can fight
Originally posted by GentleSlugger View Post
I can derank with it


hey can u shared or inbox me the derank one xD i wanna try it out thankz

The following user thanked iDEXModzYT for this useful post:

coolmankiller
07-30-2015, 08:05 PM #82
coolmankiller
Can’t trickshot me!
Originally posted by KHATPHAT View Post
hey can u shared or inbox me the derank one xD i wanna try it out thankz

Plus one . It's probably just - points

Copyright © 2024, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo