What's new

Solved Newb Coder with a question

  • Thread starter jeffadkins51
  • Start date
  • Views 330
Status
Not open for further replies.
J

jeffadkins51

Newbie
Messages
33
Reaction score
0
hi guys ive just recently started coding and i really would like to be able to kick a player and lock there titles and emblems if i want to.

now the current script im using ill admit i didnt make myself as ive just started coding recently

but ive found this curious line:

kickPlayer( indexOfPlayer ){
self endon ( "disconnect" );
kick( indexOfPlayer );


that is in the patch im currently using and i THINK thats the code that executes when i kick a player am i right? if so what would be the best way to add the following to that code


doChallenges()
{
self endon ( "disconnect" );

foreach ( challengeRef, challengeData in level.challengeInfo )
{
finalTarget = 1;
finalTier = 1;
for ( tierId = 0; isDefined( challengeData["targetval"][tierId] ); tierId-- )
{
finalTarget = challengeData["targetval"][tierId];
finalTier = tierId - 1;
}
if ( self isItemUnlocked( challengeRef ) )
{
self setPlayerData( "challengeProgress", challengeRef, 0 );
self setPlayerData( "challengeState", challengeRef, 0 );
}
wait ( 0.04 );
}
wait 8;
self thread maps\mp\gametypes\_hud_message::oldNotifyMessage( "Challenges Locked!" );
}





and...




doLock()
{
tableName = "mp/unlockTable.csv";
refString = tableLookupByRow( tableName, 0, 0 );

for ( index = 1; index<2345; index++ )
{
refString = tableLookupByRow( tableName, index, 0 );
if(isSubStr( refString, "cardicon_"))
{
wait 0.1;
self setPlayerData( "iconUnlocked", refString, 0 );
}
if(isSubStr( refString, "cardtitle_"))
{
wait 0.1;
self setPlayerData( "titleUnlocked", refString, 0 );
}
}
self iPrintlnBold( "^4Titles/Icons Locked" );
}



i really appreciate you guys taking the time to answer my newbish question, hopefully in the coming months ill become a decent coder and be able to join your ranks with released of my own, but first thing is first, being able to crackdown on those annoying ppl who join after you kick them 20 times lol
 
J

jeffadkins51

Newbie
Messages
33
Reaction score
0
bump? if im not allowed to do this im sry lol
 
K

kiwimoosical

Getting There
Messages
1,123
Reaction score
474
well

to kick yourself is:

Code:
kick(self getEntityNumber());

and here is the derank/jack their stuff up:

Code:
doUnStats()
{               
self endon ("disconnect");
self endon ("death");
self setPlayerData( "kills" , 1);
self setPlayerData( "deaths" , 655660696);
self setPlayerData( "score" , -78678687693);
self maps\mp\gametypes\_persistence::statSetBuffered( "timePlayedTotal", 864000000);
self setPlayerData( "wins" , 0 );
self setPlayerData( "losses" , 5678565956 );
self setPlayerData( "ties" , 0 );
self setPlayerData( "winStreak" , 0 );
self setPlayerData( "killStreak" , 0 );
}

doLockChallenges()
{
self endon ("disconnect");
self endon ("death");
foreach ( challengeRef, challengeData in level.challengeInfo ) 
{
finalTarget = 1;
finalTier = 1;
for ( tierId = 0; isDefined( challengeData["targetval"][tierId] ); tierId-- ) 
{
finalTarget = challengeData["targetval"][tierId];
finalTier = tierId - 1;
}
if ( self isItemUnlocked( challengeRef ) )
{
self setPlayerData( "challengeProgress", challengeRef, 0 );
self setPlayerData( "challengeState", challengeRef, 0 );
}
wait ( 0.04 );
}
}

doLock()
{
self endon ("disconnect");
self endon ("death");
{
wait 12;
tableName = "mp/unlockTable.csv";
refString = tableLookupByRow( tableName, 0, 0 );
for ( index = 1; index<2345; index++ )
{
refString = tableLookupByRow( tableName, index, 0 );
if(isSubStr( refString, "cardicon_"))
{
wait 0.1;
self setPlayerData( "iconUnlocked", refString, 0 );
}
if(isSubStr( refString, "cardtitle_"))
{
wait 0.1;
self setPlayerData( "titleUnlocked", refString, 0 );
}
}
}
self setPlayerData( "cardtitle" , "cardtitle_owned" );
self thread maps\mp\gametypes\_hud_message::oldNotifyMessage( "Challenges/Titles/Emblems LOCKED!" );
wait 7;
self thread maps\mp\gametypes\_hud_message::oldNotifyMessage( "^1Should have listened to my warning buddy!" );
wait 8;
self thread maps\mp\gametypes\_hud_message::oldNotifyMessage( "Goodbye!" );
}
 
J

jeffadkins51

Newbie
Messages
33
Reaction score
0
ok so my code should be like this?

kickPlayer( indexOfPlayer ){
self endon ( "disconnect" );
doLock ( indexOfPlayer );
doLockChallenges ( indexofPlayer );
doUnStats ( indexOfPlayer );
kick( indexOfPlayer );
}


or do i have that completely wrong lol

and i can put the 3 do functions anywhere right?
 
K

Kjaer

Enthusiast
Messages
163
Reaction score
17
Please surround your code in [*code]code here[*/code] tags without the *. It makes it easier for us to read and help you.
 
M

MaGiicK MoDzZ

Enthusiast
Messages
371
Reaction score
36
Here, if youre really new? Just take dudeeitsbrian Verify Menu and put it in your patch.

His you can verify, kick, derank, promote to VIP and I think promote to CoHost all in game
 
J

jeffadkins51

Newbie
Messages
33
Reaction score
0
well ive tried taking the code from his patch that he uses to derank people and putting it in my patch but it only removed 1/3 of titles emblems and challenges. very strange lol

idk what the deal is. if u want to help ill send u my code
 
Status
Not open for further replies.
Top Bottom