Jump to content
  • 0

Fakename when entering a map request


johnbond

Question


  • Group:  Members
  • Topic Count:  113
  • Topics Per Day:  0.03
  • Content Count:  457
  • Reputation:   11
  • Joined:  02/17/13
  • Last Seen:  

Hello guys,

 

Is there a way script-wise that all players entering one of my pvp maps (pvp_y_8-1) will have a randomly generated fake name? Or everyone entering will have the same name like "ABC". My intention is so players will not know who is who while inside the pvp map. Upon death and being kicked out of the pvp map or reconnection will make things back to normal.

 

Anyone kind enough to script me this will be a great help.

 

Thank you guys.

 

 

Link to comment
Share on other sites

Recommended Posts


  • Group:  Forum Moderator
  • Topic Count:  33
  • Topics Per Day:  0.01
  • Content Count:  1268
  • Reputation:   382
  • Joined:  02/03/12
  • Last Seen:  

Maybe something like this? Still untested.

-	script	fake_name	-1,{
OnInit:
	.eventmap$ = "eventmap";
	function generateRandSeq {
		.@len = getarg( 0, 3 );
		.@lib$ = getarg( 1, "abcdefghijklmnopqrstuvwxyz" );
		for ( .@i = 1; .@i <= .@len; .@i++ ) {
			.@rand = rand( getstrlen( .@lib$ ) );
			.@seq$ += charat( .@lib$, .@rand );
			if( getarg( 2, 0 ) )
				.@lib$ = delchar( .@lib$, .@rand );
		}
		return .@seq$;
	}
	end;

OnPCLoadMapEvent:
	if( strcharinfo(3) == .eventmap$ ) {
		function generateRandSeq;
		@fakename = 1;
		detachrid;
		charcommand "#fakename "+ .@strcharinfo$ +" "+ generateRandSeq();
	}
	end;
	
OnPCDieEvent:
	if( strcharinfo(3) == .eventmap$ )
		warp "SavePoint",0,0;
	end;
	
	
OnPCStatCalcEvent:
	if ( @fakename && strcharinfo(3) != .eventmap$ ) {
		.@strcharinfo$ = strcharinfo(0);
		@fakename = 0;
		detachrid;
		charcommand "#fakename "+ .@strcharinfo$;
	}
}

eventmap	mapflag	loadevent
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  113
  • Topics Per Day:  0.03
  • Content Count:  457
  • Reputation:   11
  • Joined:  02/17/13
  • Last Seen:  

 

Maybe something like this? Still untested.

 

 

Oh nice thank you for this! I will test this later.

 

Umm what if I just want that all players will only have a name "Player" and not a random name?

 

Thank you Sir Skorm!

Link to comment
Share on other sites


  • Group:  Forum Moderator
  • Topic Count:  33
  • Topics Per Day:  0.01
  • Content Count:  1268
  • Reputation:   382
  • Joined:  02/03/12
  • Last Seen:  

" "+ generateRandSeq()

 With

" Player"
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  113
  • Topics Per Day:  0.03
  • Content Count:  457
  • Reputation:   11
  • Joined:  02/17/13
  • Last Seen:  


" "+ generateRandSeq()
With
" Player"


Sorry sir but I still use 3ceam. Kindly modify to be compatible with 3ceam.

Thank you very much for the help Sir Skorm. :)

-----Edit-----

I had the map console errors fixed by someone:

But the problem is it does not work. The player going inside the map still has his original name.

Thank you Sir Skorm. :)
Link to comment
Share on other sites


  • Group:  Forum Moderator
  • Topic Count:  33
  • Topics Per Day:  0.01
  • Content Count:  1268
  • Reputation:   382
  • Joined:  02/03/12
  • Last Seen:  

Thank you Sir Skorm. :)

 

function	script	generateRandSeq	{
	.@len = getarg( 0, 3 );
	.@lib$ = getarg( 1, "abcdefghijklmnopqrstuvwxyz" );
	for ( .@i = 1; .@i <= .@len; .@i++ ) {
		.@rand = rand( getstrlen( .@lib$ ) );
		.@seq$ += charat( .@lib$, .@rand );
		if( getarg( 2, 0 ) )
			.@lib$ = delchar( .@lib$, .@rand );
	}
	return .@seq$;
}

-	script	fake_name	-1,{
OnInit:
	set .eventmap$, "prontera";
	end;

OnPCLoadMapEvent:
	if( strcharinfo(3) == .eventmap$ ) {
		set .@strcharinfo$, strcharinfo(0);
		set @fakename, 1;
		detachrid;
		charcommand "#fakename "+ .@strcharinfo$ +" "+ callfunc("generateRandSeq");
	}
	end;
	
OnPCDieEvent:
	if( strcharinfo(3) == .eventmap$ )
		warp "SavePoint",0,0;
	end;
	
	
OnPCStatCalcEvent:
	if ( @fakename && strcharinfo(3) != .eventmap$ ) {
		set .@strcharinfo$, strcharinfo(0);
		set @fakename, 1;
		detachrid;
		charcommand "#fakename "+ .@strcharinfo$;
	}
}

prontera	mapflag	loadevent

 

Edit--

  It just occurred to me that 3ceam probably doesn't a lot of the commands used in the function. :/

-	script	fake_name	-1,{
OnInit:
	set .eventmap$, "prontera";
	end;

OnPCLoadMapEvent:
	if( strcharinfo(3) == .eventmap$ ) {
		set .@strcharinfo$, strcharinfo(0);
		set @fakename, 1;
		detachrid;
		charcommand "#fakename "+ .@strcharinfo$ +" Player";
	}
	end;
	
OnPCDieEvent:
	if( strcharinfo(3) == .eventmap$ )
		warp "SavePoint",0,0;
	end;
	
	
OnPCStatCalcEvent:
	if ( @fakename && strcharinfo(3) != .eventmap$ ) {
		set .@strcharinfo$, strcharinfo(0);
		set @fakename, 1;
		detachrid;
		charcommand "#fakename "+ .@strcharinfo$;
	}
}

prontera	mapflag	loadevent
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  113
  • Topics Per Day:  0.03
  • Content Count:  457
  • Reputation:   11
  • Joined:  02/17/13
  • Last Seen:  

Edit--

  It just occurred to me that 3ceam probably doesn't a lot of the commands used in the function. :/

 

Sorry for the late reply sir.

 

The last edit is already partially working. No errors in console for my 3ceam nice hehe.

 

1. the problem is if the character name is 1 word then his name becomes "Player".  This is correct.

2. But if character names is 2 words with a space in the middle, then only one name is replaced. My character name was "Items Tester" and after fakename it became "Tester Player". The 2nd name/word was retained.

3. If the player name is 3 words or more, only the first word/name is replaced. For the test, I made character name "First Second Third" then after fakename it became "Second Third Player".

 

As based from my tests, the fakename NPC only replaced the first word of the player name. This would be a problem because spaces are enabled in my server and some players are full of spaces like "M A S T E R K I L L E R" etc.

 

Kindly maybe we can fix this.

 

Thank you sir Skorm. :)

Link to comment
Share on other sites


  • Group:  Forum Moderator
  • Topic Count:  33
  • Topics Per Day:  0.01
  • Content Count:  1268
  • Reputation:   382
  • Joined:  02/03/12
  • Last Seen:  

Sorry for the late reply sir.

 

The last edit is already partially working. No errors in console for my 3ceam nice hehe.

 

Thank you sir Skorm. :)

 

 

Oops small oversight on my part.

-	script	fake_name	-1,{
OnInit:
	set .eventmap$, "prontera";
	end;

OnPCLoadMapEvent:
	if( strcharinfo(3) == .eventmap$ ) {
		set .@strcharinfo$, strcharinfo(0);
		set @fakename, 1;
		detachrid;
		charcommand "#fakename \""+ .@strcharinfo$ +"\" Player";
	}
	end;
	
OnPCDieEvent:
	if( strcharinfo(3) == .eventmap$ )
		warp "SavePoint",0,0;
	end;
	
	
OnPCStatCalcEvent:
	if ( @fakename && strcharinfo(3) != .eventmap$ ) {
		set .@strcharinfo$, strcharinfo(0);
		set @fakename, 1;
		detachrid;
		charcommand "#fakename \""+ .@strcharinfo$ +"\"";
	}
}

prontera	mapflag	loadevent
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  113
  • Topics Per Day:  0.03
  • Content Count:  457
  • Reputation:   11
  • Joined:  02/17/13
  • Last Seen:  

 

Oops small oversight on my part.

 

 

Oh thank you sir I will test this.

 

Btw, what if I want this to take effect on several maps? How do I do it?

Thank you.

Link to comment
Share on other sites


  • Group:  Forum Moderator
  • Topic Count:  33
  • Topics Per Day:  0.01
  • Content Count:  1268
  • Reputation:   382
  • Joined:  02/03/12
  • Last Seen:  


- script fake_name -1,{

OnInit:

set .eventmap$, "prontera|morocc|someothermap";

end;

OnPCLoadMapEvent:

if( compare( "|"+.eventmap$+"|", "|"+strcharinfo(3)+"|" ) ) {

set .@strcharinfo$, strcharinfo(0);

set @fakename, 1;

detachrid;

charcommand "#fakename \""+ .@strcharinfo$ +"\" Player";

}

end;

OnPCDieEvent:

if( compare( "|"+.eventmap$+"|", "|"+strcharinfo(3)+"|" ) )

warp "SavePoint",0,0;

end;

OnPCStatCalcEvent:

if ( @fakename && !compare( "|"+.eventmap$+"|", "|"+strcharinfo(3)+"|" ) ) {

set .@strcharinfo$, strcharinfo(0);

set @fakename, 1;

detachrid;

charcommand "#fakename \""+ .@strcharinfo$ +"\"";

}

}

prontera mapflag loadevent

morocc mapflag loadevent

someothermap mapflag loadevent

  • Upvote 1
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  113
  • Topics Per Day:  0.03
  • Content Count:  457
  • Reputation:   11
  • Joined:  02/17/13
  • Last Seen:  

-	script	fake_name	-1,{
OnInit:
	set .eventmap$, "prontera|morocc|someothermap";
	end;

OnPCLoadMapEvent:
	if( compare( "|"+.eventmap$+"|", "|"+strcharinfo(3)+"|" ) ) {
		set .@strcharinfo$, strcharinfo(0);
		set @fakename, 1;
		detachrid;
		charcommand "#fakename \""+ .@strcharinfo$ +"\" Player";
	}
	end;
	
OnPCDieEvent:
	if( compare( "|"+.eventmap$+"|", "|"+strcharinfo(3)+"|" ) )
		warp "SavePoint",0,0;
	end;
	
	
OnPCStatCalcEvent:
	if ( @fakename && !compare( "|"+.eventmap$+"|", "|"+strcharinfo(3)+"|" ) ) {
		set .@strcharinfo$, strcharinfo(0);
		set @fakename, 1;
		detachrid;
		charcommand "#fakename \""+ .@strcharinfo$ +"\"";
	}
}

prontera	mapflag	loadevent
morocc	mapflag	loadevent
someothermap	mapflag	loadevent

 

 

Wow this is already working perfectly!

 

Thank you sir Skorm you are awesome! :D

 

 

EDIT:

Oh Sir Skorm, I found a new problem with this script.

 

Whenever a player dies (even for one time in pvp), he automatically gets teleoprted back to savepoint and he is dead in his savepoint. His fakename is still intact "Player".

 

It had to do something with this script because when I unloaded this script everythings gets back to normal behavior in pvp.

 

I hope you get what I am trying to explain.

 

Thank you sir.

Link to comment
Share on other sites


  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10013
  • Reputation:   2348
  • Joined:  10/28/11
  • Last Seen:  

you can try solve it by adding this part.


OnPCDieEvent:
	if ( @fakename && compare( "|"+.eventmap$+"|", "|"+strcharinfo(3)+"|" ) ) {
		set .@strcharinfo$, strcharinfo(0);
		set @fakename, 0;
		detachrid;
		charcommand "#fakename \""+ .@strcharinfo$ +"\"";
	}
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  113
  • Topics Per Day:  0.03
  • Content Count:  457
  • Reputation:   11
  • Joined:  02/17/13
  • Last Seen:  

 

you can try solve it by adding this part.


OnPCDieEvent:
	if ( @fakename && compare( "|"+.eventmap$+"|", "|"+strcharinfo(3)+"|" ) ) {
		set .@strcharinfo$, strcharinfo(0);
		set @fakename, 0;
		detachrid;
		charcommand "#fakename \""+ .@strcharinfo$ +"\"";
	}

 

Oh thank you. It is quite nearly fixed. The killed "Player" is not anymore warped out of PVP but I get these errors in console everytime a player is killed in PvP.

 

[06:44:56][Error]: script_rid2sd: fatal error ! player not attached!

[06:44:56][Debug]: Function: strcharinfo (1 parameter):

[06:44:56][Debug]: Data: number value=3

[06:44:56][Debug]: Source (NPC): fake_name (invisible/not on a map)

And I made the player name One Two Threes but when he gets killed his name becomes Two Threes" (with a " at the end).

 

 

Here is my whole script:

 

-	script	fake_name	-1,{
OnInit:
	set .eventmap$, "turbo_roomc|morocc_mem|pvp_y_8-2";
	end;

OnPCLoadMapEvent:
	if( compare( "|"+.eventmap$+"|", "|"+strcharinfo(3)+"|" ) ) {
		set .@strcharinfo$, strcharinfo(0);
		set @fakename, 1;
		detachrid;
		charcommand "#fakename \""+ .@strcharinfo$ +"\" Player";
	}
	end;
	
OnPCDieEvent:

	if ( @fakename && compare( "|"+.eventmap$+"|", "|"+strcharinfo(3)+"|" ) ) {
		set .@strcharinfo$, strcharinfo(0);
		set @fakename, 0;
		detachrid;
		charcommand "#fakename \""+ .@strcharinfo$ +"\"";
	}

	if( compare( "|"+.eventmap$+"|", "|"+strcharinfo(3)+"|" ) )
		warp "SavePoint",0,0;
	end;



	
OnPCStatCalcEvent:
	if ( @fakename && !compare( "|"+.eventmap$+"|", "|"+strcharinfo(3)+"|" ) ) {
		set .@strcharinfo$, strcharinfo(0);
		set @fakename, 1;
		detachrid;
		charcommand "#fakename \""+ .@strcharinfo$ +"\"";
	}
}

I removed the loadevent mapflag because all my maps are already loaded in my \conf\mapflag\loadevent.txt

Thank you sir Emistry and sir Skorm.

Link to comment
Share on other sites


  • Group:  Forum Moderator
  • Topic Count:  33
  • Topics Per Day:  0.01
  • Content Count:  1268
  • Reputation:   382
  • Joined:  02/03/12
  • Last Seen:  


- script fake_name -1,{

OnInit:

set .eventmap$, "turbo_roomc|morocc_mem|pvp_y_8-2";

end;

OnPCLoadMapEvent:

if( compare( "|"+.eventmap$+"|", "|"+strcharinfo(3)+"|" ) ) {

set .@strcharinfo$, strcharinfo(0);

set @fakename, 1;

set @death, 0;

detachrid;

charcommand "#fakename \""+ .@strcharinfo$ +"\" Player";

}

end;

OnPCDieEvent:

if ( @fakename && compare( "|"+.eventmap$+"|", "|"+strcharinfo(3)+"|" ) ) {

set @death, @death + 1;

if( @death == 2 ) {

set .@strcharinfo$, strcharinfo(0);

set @fakename, 0;

warp "SavePoint",0,0;

detachrid;

charcommand "#alive \""+ .@strcharinfo$ +"\"";

charcommand "#fakename \""+ .@strcharinfo$ +"\"";

}

}

end;

OnPCStatCalcEvent:

if ( @fakename && !compare( "|"+.eventmap$+"|", "|"+strcharinfo(3)+"|" ) ) {

set .@strcharinfo$, strcharinfo(0);

set @fakename, 0;

set @death, 0;

detachrid;

charcommand "#fakename \""+ .@strcharinfo$ +"\"";

}

}

  • Upvote 1
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  113
  • Topics Per Day:  0.03
  • Content Count:  457
  • Reputation:   11
  • Joined:  02/17/13
  • Last Seen:  

-	script	fake_name	-1,{}

 

Wow I think this is already working now. I will give this a thorough test on my main server the next maintenance.

 

Btw, there is a slight problem still, in pvp after the second time the character has been killed, he gets AUTOMATICALLY respawned to savepoint and he is dead in savepoint. There is no animation seen that he was killed, he just gets automatically warped out to savepoint and dead in savepoint. But this is only for the second time he gets killed inside pvp.

 

Thank you.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  113
  • Topics Per Day:  0.03
  • Content Count:  457
  • Reputation:   11
  • Joined:  02/17/13
  • Last Seen:  

Sir?

 

There is a slight problem still, in pvp after the second time the character has been killed, he gets AUTOMATICALLY respawned to savepoint and he is dead in savepoint. There is no animation seen that he was killed, he just gets automatically warped out to savepoint and dead in savepoint. But this is only for the second time he gets killed inside pvp.

Link to comment
Share on other sites


  • Group:  Forum Moderator
  • Topic Count:  33
  • Topics Per Day:  0.01
  • Content Count:  1268
  • Reputation:   382
  • Joined:  02/03/12
  • Last Seen:  

Sir?

 

There is a slight problem still, in pvp after the second time the character has been killed, he gets AUTOMATICALLY respawned to savepoint and he is dead in savepoint. There is no animation seen that he was killed, he just gets automatically warped out to savepoint and dead in savepoint. But this is only for the second time he gets killed inside pvp.

Untrimmed:

-	script	fake_name	-1,{
OnInit:
	set .eventmap$, "turbo_roomc|morocc_mem|pvp_y_8-2";
	end;

OnPCLoadMapEvent:
	if( compare( "|"+.eventmap$+"|", "|"+strcharinfo(3)+"|" ) ) {
		set .@strcharinfo$, strcharinfo(0);
		set @fakename, 1;
		detachrid;
		charcommand "#fakename \""+ .@strcharinfo$ +"\" Player";
	}
	end;

OnPCStatCalcEvent:
	if ( @fakename && !compare( "|"+.eventmap$+"|", "|"+strcharinfo(3)+"|" ) ) {
		set .@strcharinfo$, strcharinfo(0);
		set @fakename, 0;
		detachrid;
		charcommand "#fakename \""+ .@strcharinfo$ +"\"";
	}
}

Trimmed:

-	script	fake_name	-1,{
OnInit:
	set .eventmap$, "|turbo_roomc|morocc_mem|pvp_y_8-2|";
	end;

OnPCStatCalcEvent:
	set .@map$, "|"+strcharinfo(3)+"|";
	if (  @fakename && !compare( .eventmap$, .@map$ )
	||   !@fakename &&  compare( .eventmap$, .@map$ ) ) {
		set @fakename, @fakename ? 0 : 1;
		charcommand "#fakename \""+ strcharinfo(0) +"\""+( @fakename ? "Player" : "" );
	}
}

That was part of the script.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  113
  • Topics Per Day:  0.03
  • Content Count:  457
  • Reputation:   11
  • Joined:  02/17/13
  • Last Seen:  

 

Sir?

 

There is a slight problem still, in pvp after the second time the character has been killed, he gets AUTOMATICALLY respawned to savepoint and he is dead in savepoint. There is no animation seen that he was killed, he just gets automatically warped out to savepoint and dead in savepoint. But this is only for the second time he gets killed inside pvp.

Untrimmed:

-	script	fake_name	-1,{
OnInit:
	set .eventmap$, "turbo_roomc|morocc_mem|pvp_y_8-2";
	end;

OnPCLoadMapEvent:
	if( compare( "|"+.eventmap$+"|", "|"+strcharinfo(3)+"|" ) ) {
		set .@strcharinfo$, strcharinfo(0);
		set @fakename, 1;
		detachrid;
		charcommand "#fakename \""+ .@strcharinfo$ +"\" Player";
	}
	end;

OnPCStatCalcEvent:
	if ( @fakename && !compare( "|"+.eventmap$+"|", "|"+strcharinfo(3)+"|" ) ) {
		set .@strcharinfo$, strcharinfo(0);
		set @fakename, 0;
		detachrid;
		charcommand "#fakename \""+ .@strcharinfo$ +"\"";
	}
}

Trimmed:

-	script	fake_name	-1,{
OnInit:
	set .eventmap$, "|turbo_roomc|morocc_mem|pvp_y_8-2|";
	end;

OnPCStatCalcEvent:
	set .@map$, "|"+strcharinfo(3)+"|";
	if (  @fakename && !compare( .eventmap$, .@map$ )
	||   !@fakename &&  compare( .eventmap$, .@map$ ) ) {
		set @fakename, @fakename ? 0 : 1;
		charcommand "#fakename \""+ strcharinfo(0) +"\""+( @fakename ? "Player" : "" );
	}
}

That was part of the script.

 

 

 

Still same problem Sir. Inside pvp, when the player gets killed for the 2nd time he gets warped back to savepoint immediately and without the "dead animation" and he is dead in savepoint.

 

And when respawned to save point the "1st word" of his name is not showing. It should be that in savepoint his name should be back to normal.

 

 

Here is what I did with regards to your edits above just to check if I did it right :)

-	script	fake_name	-1,{
OnInit:
	set .eventmap$, "|turbo_roomc|morocc_mem|pvp_y_8-2|";
	end;

OnPCLoadMapEvent:
	if( compare( "|"+.eventmap$+"|", "|"+strcharinfo(3)+"|" ) ) {
		set .@strcharinfo$, strcharinfo(0);
		set @fakename, 1;
		set @death, 0;
		detachrid;
		charcommand "#fakename \""+ .@strcharinfo$ +"\" Player";
	}
	end;
	
OnPCDieEvent:
	if ( @fakename && compare( "|"+.eventmap$+"|", "|"+strcharinfo(3)+"|" ) ) {
		set @death, @death + 1;
		if( @death == 2 ) {
			set .@strcharinfo$, strcharinfo(0);
			set @fakename, 0;
			warp "SavePoint",0,0;
			detachrid;
			charcommand "#alive \""+ .@strcharinfo$ +"\"";
			charcommand "#fakename \""+ .@strcharinfo$ +"\"";
		}
	}
	end;

OnPCStatCalcEvent:
	set .@map$, "|"+strcharinfo(3)+"|";
	if (  @fakename && !compare( .eventmap$, .@map$ )
	||   !@fakename &&  compare( .eventmap$, .@map$ ) ) {
		set @fakename, @fakename ? 0 : 1;
		charcommand "#fakename \""+ strcharinfo(0) +"\""+( @fakename ? "Player" : "" );
	}
}

Thank you for all the help sir.

Link to comment
Share on other sites


  • Group:  Forum Moderator
  • Topic Count:  33
  • Topics Per Day:  0.01
  • Content Count:  1268
  • Reputation:   382
  • Joined:  02/03/12
  • Last Seen:  

 

Thank you for all the help sir.

 

 

That isn't an edit the above post is the full script.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  113
  • Topics Per Day:  0.03
  • Content Count:  457
  • Reputation:   11
  • Joined:  02/17/13
  • Last Seen:  

 

 

Thank you for all the help sir.

 

 

That isn't an edit the above post is the full script.

 

 

Yes sir this is the whole script I used which also already had the edits you mentioned above:

 

-	script	fake_name	-1,{
OnInit:
	set .eventmap$, "|turbo_roomc|morocc_mem|pvp_y_8-2|";
	end;

OnPCLoadMapEvent:
	if( compare( "|"+.eventmap$+"|", "|"+strcharinfo(3)+"|" ) ) {
		set .@strcharinfo$, strcharinfo(0);
		set @fakename, 1;
		set @death, 0;
		detachrid;
		charcommand "#fakename \""+ .@strcharinfo$ +"\" Player";
	}
	end;
	
OnPCDieEvent:
	if ( @fakename && compare( "|"+.eventmap$+"|", "|"+strcharinfo(3)+"|" ) ) {
		set @death, @death + 1;
		if( @death == 2 ) {
			set .@strcharinfo$, strcharinfo(0);
			set @fakename, 0;
			warp "SavePoint",0,0;
			detachrid;
			charcommand "#alive \""+ .@strcharinfo$ +"\"";
			charcommand "#fakename \""+ .@strcharinfo$ +"\"";
		}
	}
	end;

OnPCStatCalcEvent:
	set .@map$, "|"+strcharinfo(3)+"|";
	if (  @fakename && !compare( .eventmap$, .@map$ )
	||   !@fakename &&  compare( .eventmap$, .@map$ ) ) {
		set @fakename, @fakename ? 0 : 1;
		charcommand "#fakename \""+ strcharinfo(0) +"\""+( @fakename ? "Player" : "" );
	}
}
Link to comment
Share on other sites


  • Group:  Forum Moderator
  • Topic Count:  33
  • Topics Per Day:  0.01
  • Content Count:  1268
  • Reputation:   382
  • Joined:  02/03/12
  • Last Seen:  

Yes sir this is the whole script I used which also already had the edits you mentioned above:

Ugh no.... This is the script...

-	script	fake_name	-1,{
OnInit:
	set .eventmap$, "|turbo_roomc|morocc_mem|pvp_y_8-2|";
	end;

OnPCStatCalcEvent:
	set .@map$, "|"+strcharinfo(3)+"|";
	if (  @fakename && !compare( .eventmap$, .@map$ )
	||   !@fakename &&  compare( .eventmap$, .@map$ ) ) {
		set @fakename, @fakename ? 0 : 1;
		charcommand "#fakename \""+ strcharinfo(0) +"\""+( @fakename ? "Player" : "" );
	}
}
That's it nothing else.
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  113
  • Topics Per Day:  0.03
  • Content Count:  457
  • Reputation:   11
  • Joined:  02/17/13
  • Last Seen:  

Ugh no.... This is the script...

-	script	fake_name	-1,{
OnInit:
	set .eventmap$, "|turbo_roomc|morocc_mem|pvp_y_8-2|";
	end;

OnPCStatCalcEvent:
	set .@map$, "|"+strcharinfo(3)+"|";
	if (  @fakename && !compare( .eventmap$, .@map$ )
	||   !@fakename &&  compare( .eventmap$, .@map$ ) ) {
		set @fakename, @fakename ? 0 : 1;
		charcommand "#fakename \""+ strcharinfo(0) +"\""+( @fakename ? "Player" : "" );
	}
}

That's it nothing else.

 

 

Oh sorry about that.

 

Okay I have tested it again. Player does not get warped to savepoint upon 2nd death in pvp but his name inside the maps is not in fakename. I mean no fakename occuring. I think the script has missing codes.

 

Thank you sir.

Link to comment
Share on other sites


  • Group:  Forum Moderator
  • Topic Count:  33
  • Topics Per Day:  0.01
  • Content Count:  1268
  • Reputation:   382
  • Joined:  02/03/12
  • Last Seen:  

Oh sorry about that.

 

Okay I have tested it again. Player does not get warped to savepoint upon 2nd death in pvp but his name inside the maps is not in fakename. I mean no fakename occuring. I think the script has missing codes.

 

Thank you sir.

 

It's not missing anything. It works fine for me, and I've tested it multiple times with different characters of varying gm levels. If that version isn't working for you try the untrimmed version I posted instead.

  • Upvote 1
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  113
  • Topics Per Day:  0.03
  • Content Count:  457
  • Reputation:   11
  • Joined:  02/17/13
  • Last Seen:  

 

Oh sorry about that.

 

Okay I have tested it again. Player does not get warped to savepoint upon 2nd death in pvp but his name inside the maps is not in fakename. I mean no fakename occuring. I think the script has missing codes.

 

Thank you sir.

 

It's not missing anything. It works fine for me, and I've tested it multiple times with different characters of varying gm levels. If that version isn't working for you try the untrimmed version I posted instead.

 

 

 

I used the "untrimmed version" and its working. The "dead animation" now shows after killing for the second time just before killed player gets automatically warped back to savepoint.

 

Btw, just a small problem remains. Whenever the killed player for the 2nd time in pvp automatically respawns in savepoint his name still remains being "Player". Can we make it that when the player killed for the 2nd time in pvp and automatically spawns in savepoint that his name will be back to normal?

 

Thank you very much sir Skorm for all the help! :D

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  113
  • Topics Per Day:  0.03
  • Content Count:  457
  • Reputation:   11
  • Joined:  02/17/13
  • Last Seen:  

 

Oh sorry about that.

 

Okay I have tested it again. Player does not get warped to savepoint upon 2nd death in pvp but his name inside the maps is not in fakename. I mean no fakename occuring. I think the script has missing codes.

 

Thank you sir.

 

It's not missing anything. It works fine for me, and I've tested it multiple times with different characters of varying gm levels. If that version isn't working for you try the untrimmed version I posted instead.

 

 

 

Sir still slight problem as I had mentioned above.

 

Everything was already good but when a player is killed twice in pvp and when he gets summoned back to savepoint, his name is still "Player". Can we make it that when he is back to savepoint his name will be normal again?

Thank you Sir Skorm.

Link to comment
Share on other sites


  • Group:  Forum Moderator
  • Topic Count:  33
  • Topics Per Day:  0.01
  • Content Count:  1268
  • Reputation:   382
  • Joined:  02/03/12
  • Last Seen:  

 

Sir still slight problem as I had mentioned above.

 

Everything was already good but when a player is killed twice in pvp and when he gets summoned back to savepoint, his name is still "Player". Can we make it that when he is back to savepoint his name will be normal again?

Thank you Sir Skorm.

 

 

I don't have this problem.

 

Try putting sleep2(2000);

after OnPCStatCalcEvent:

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...