22.04.2014, 12:24
(
Последний раз редактировалось paulbobin; 04.05.2014 в 14:06.
Причина: TITLE Change because no one seen this Thread
)
Hi
I want a Code Of Ladmin Script Which Has Register and Login In Dialog .SATDM v9
Player Info
On player Spawn
On Dialog Response
On player disconnect
I Think i Given You All Things Also In Attactments FILES
Please Help Me .Get REP++
----------------------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------------------
__________________________________________________ ________________________________________________
I want a Code Of Ladmin Script Which Has Register and Login In Dialog .SATDM v9
Player Info
Код:
enum pInfo { name[MAX_PLAYER_NAME], bowner, bowned, pass, pcash, bank, team, Jailed, vhpb, weed, gang, condoms, inalcatraz, Registered, LoggedIn, Level, Muted, Caps, LJailTime, Frozen, FreezeTime, Kills, Deaths, hours, mins, secs, TotalTime, ConnectTime, MuteWarnings, Warnings, Spawned, TimesSpawned, God, DoorsLocked, SpamCount, SpamTime, PingCount, PingTime, BotPing, pPing[PING_MAX_EXCEEDS], blip, blipS, pColour, SpecID, SpecType, bool:AllowedIn, FailLogin, vowned, vowner, vowned2, vowner2, vowned3, vowner3, vowned4, vowner4, vowned5, vowner5, vowned6, vowner6, vowned7, vowner7, vowned8, vowner8, vowned9, vowner9, vowned10, vowner10, vowned11, vowner11, vowned12, vowner12, vowned13, vowner13, vowned14, vowner14, vowned15, vowner15, } new PlayerInfo[MAX_PLAYERS][pInfo];
Код:
if(ServerInfo[Locked] == 1 && PlayerInfo[playerid][AllowedIn] == false) { GameTextForPlayer(playerid,"~r~Server Locked~n~You must enter password before spawning~n~/password <password>",4000,3); SetTimerEx("DelayKillPlayer", 2500,0,"d",playerid); return 1; } if(ServerInfo[MustLogin] == 1 && PlayerInfo[playerid][Registered] == 1 && PlayerInfo[playerid][LoggedIn] == 0) { GameTextForPlayer(playerid,"~r~Before you can play, you must login!",4000,3); // new paramsl[128]; // ShowPlayerDialog(playerid, DIALOGID0+2, DIALOG_STYLE_INPUT,"Login Password", paramsl, "OK", "Cancel"); //Broken SetTimerEx("DelayKillPlayer", 2500,0,"d",playerid); return 1; } if(ServerInfo[MustRegister] == 1 && PlayerInfo[playerid][Registered] == 0) { new params[128]; GameTextForPlayer(playerid,"~r~Before you can play, you must register!",4000,3); ShowPlayerDialog(playerid, DIALOGID0+1, DIALOG_STYLE_INPUT,"Password", params, "OK", "Cancel"); SetTimerEx("DelayKillPlayer", 2500,0,"d",playerid); return 1; }
Код:
if(dialogid == DIALOGID0+1) { if(response) { cmd_register(playerid,inputtext); if (PlayerInfo[playerid][LoggedIn] == 1) return SendClientMessage(playerid,COLOR_RED,"ACCOUNT: You are already registered and logged in."); if (udb_Exists(PlayerName2(playerid))) return SendClientMessage(playerid,COLOR_RED,"ACCOUNT: This account already exists, please use '/login [password]'."); if (strlen(inputtext) < 4 || strlen(inputtext) > 20) return SendClientMessage(playerid,COLOR_RED,"ACCOUNT: Password length must be greater than three characters"); if (udb_Create(PlayerName2(playerid),inputtext)) { new file[256],rname[MAX_PLAYER_NAME], tmp3[100]; new strdate[20], year,month,day; getdate(year, month, day); GetPlayerName(playerid,rname,sizeof(rname)); format(file,sizeof(file),"/ladmin/users/%s.sav",udb_encode(rname)); GetPlayerIp(playerid,tmp3,100); dini_Set(file,"ip",tmp3); // dini_Set(file,"password",params); dUserSetINT(PlayerName2(playerid)).("registered",1); format(strdate, sizeof(strdate), "%d/%d/%d",day,month,year); dini_Set(file,"RegisteredDate",strdate); dUserSetINT(PlayerName2(playerid)).("loggedin",1); dUserSetINT(PlayerName2(playerid)).("banned",0); dUserSetINT(PlayerName2(playerid)).("level",0); dUserSetINT(PlayerName2(playerid)).("LastOn",0); dUserSetINT(PlayerName2(playerid)).("money",0); dUserSetINT(PlayerName2(playerid)).("kills",0); dUserSetINT(PlayerName2(playerid)).("deaths",0); PlayerInfo[playerid][LoggedIn] = 1; PlayerInfo[playerid][Registered] = 1; SendClientMessage(playerid, green, "ACCOUNT: You are now registered, and have been automaticaly logged in"); PlayerPlaySound(playerid,1057,0.0,0.0,0.0); return 1; } } return 1; } if(dialogid == DIALOGID0+2) { if(response) { cmd_login(playerid,inputtext); if (PlayerInfo[playerid][LoggedIn] == 1) return SendClientMessage(playerid,COLOR_RED,"ACCOUNT: You are already logged in."); if (!udb_Exists(PlayerName2(playerid))) return SendClientMessage(playerid,COLOR_RED,"ACCOUNT: Account doesn't exist, please use '/register [password]'."); if (udb_CheckLogin(PlayerName2(playerid),inputtext)) { new file[256], tmp3[100], lname[MAX_PLAYER_NAME]; GetPlayerName(playerid,lname,sizeof(lname)); format(file,sizeof(file),"/ladmin/users/%s.sav",udb_encode(lname)); GetPlayerIp(playerid,tmp3,100); dini_Set(file,"ip",tmp3); LoginPlayer(playerid); PlayerPlaySound(playerid,1057,0.0,0.0,0.0); if(PlayerInfo[playerid][Level] > 0) { format(string,sizeof(string),"ACCOUNT: Successfully Logged In. (Level %d)", PlayerInfo[playerid][Level] ); return SendClientMessage(playerid,green,string); } else return SendClientMessage(playerid,green,"ACCOUNT: Successfully Logged In"); }*/ return ShowPlayerDialog(playerid, DIALOGID0+2, DIALOG_STYLE_INPUT,"Password", "WRONG Password, Try Again", "OK", "Cancel"); } return 1; }
Код:
if(PlayerInfo[playerid][LoggedIn] == 1) SavePlayer(playerid); if(udb_Exists(PlayerName2(playerid))) dUserSetINT(PlayerName2(playerid)).("loggedin",0);
Please Help Me .Get REP++
----------------------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------------------
__________________________________________________ ________________________________________________