29.12.2008, 21:22
Hello
I want to modify the ladmin4v2 script, so that if a user has registered a nickname and doesnt login within 15 seconds, he gets a random name assigned. So nobody can fake a registered nickname
My Problem is that it only changes the name on the first player...
Maybe somebody can help me. People here been good help with the random name part =)
Thanks in advance
---------------------------------------
random name
-----------------------------------------------
name change timers
-----------------------------------------
this is from ladmin. i modified: if user(playername2) exists and autologin is not enabled to start namechange after 15seconds.(last 3 lines)
-----------------------------------
i asked lethal himself but he doesnt script anymore and cant help me :/
what am i doing wrong?just first player name does get changed. something with playerid?
I want to modify the ladmin4v2 script, so that if a user has registered a nickname and doesnt login within 15 seconds, he gets a random name assigned. So nobody can fake a registered nickname
My Problem is that it only changes the name on the first player...
Maybe somebody can help me. People here been good help with the random name part =)
Thanks in advance
---------------------------------------
random name
Code:
new Name[200][MAX_PLAYER_NAME]={ {"funnynames"}, ...200 of them... };
name change timers
Code:
forward Namechange(playerid); public Namechange(playerid) { new randnbr = random(200); SetPlayerName(playerid, Name[randnbr]); } forward NameC(playerid); public NameC(playerid) { GameTextForPlayer(playerid,"~r~Not logged in, name changed",4000,3); SetTimer("Namechange",0,true); }
this is from ladmin. i modified: if user(playername2) exists and autologin is not enabled to start namechange after 15seconds.(last 3 lines)
Code:
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"); SetTimer("NameC",15000,false); }
i asked lethal himself but he doesnt script anymore and cant help me :/
what am i doing wrong?just first player name does get changed. something with playerid?