Registered Nickname Protection
#4

wow cool

so after passing the player id, let it check if player has not logged in. then i have done killtimer event on succesfull login so logged in persons dont get renamed lol

it looks like it is workin now =))) thanks DutchDominator


for the ones interested .....

Code:
new Namechanger;

//========================


new Name[200][MAX_PLAYER_NAME]={
{"funny name"},

..200 of em...

};


//===========================


forward Namechange(playerid);
public Namechange(playerid)
{
  if(ServerInfo[MustLogin] == 1 && PlayerInfo[playerid][Registered] == 1 && PlayerInfo[playerid][LoggedIn] == 0)
  {
	new randnbr = random(100);
	SetPlayerName(playerid, Name[randnbr]);
  }
}

 
//==========================this is in ladmin4v2 script

	if(!udb_Exists(PlayerName2(playerid))) SendClientMessage(playerid,orange, "ACCOUNT: Type /register [password] to create an account and save your stats");
	else
	{
	  PlayerInfo[playerid][Registered] = 1;
		format(file,sizeof(file),"/ladmin/users/%s.sav",udb_encode(PlayerName));
		new tmp2[256]; tmp2 = dini_Get(file,"ip");
		if( (!strcmp(tmp3,tmp2,true)) && (ServerInfo[AutoLogin] == 1) )
		{
			LoginPlayer(playerid);
			if(PlayerInfo[playerid][Level] > 0)
			{
				format(string,sizeof(string),"ACCOUNT: You have been automatically logged in. (Level %d)", PlayerInfo[playerid][Level] );
				SendClientMessage(playerid,green,string);
    		}
	  		else SendClientMessage(playerid,green,"ACCOUNT: You have been automatically logged in.");
 	  }
 		else SendClientMessage(playerid, green, "ACCOUNT: Nickname is registed, login by typing /login [password].If you don't login in 15 Seconds,you Name will be changed");
		Namechanger = SetTimerEx("Namechange",15000,false,"i",playerid); // pass the id^^
	}
	return 1;
}

//=======================this is in ladmin4v2 script

in function dcmd_login(playerid,params[])

after LoginPlayer...

KillTimer(Namechanger);
Reply


Messages In This Thread
Registered Nickname Protection - by am0k - 29.12.2008, 21:22
Re: Registered Nickname Protection - by am0k - 30.12.2008, 00:39
Re: Registered Nickname Protection - by DutchDominator - 30.12.2008, 00:53
Re: Registered Nickname Protection - by am0k - 30.12.2008, 01:20

Forum Jump:


Users browsing this thread: 1 Guest(s)