22.01.2015, 15:19
Hello, Guys I'm having a problem in my gamemode and that is..when a player login in the server for first time then textdraw appear but when he login in the server for second,third,fourth,etc Times then textdraw doesn't appear.. Here's my Code:-
Textdraw no 0 Doesn't appear when player login for more than 1 more.. this is happening from the time I Mixed Jewel's Admin System With My Gamemode..
pawn Код:
public OnPlayerConnect(playerid)
{
if(IsPlayerNPC(playerid)) return 1;
#if SpecTextDraw == true
CreateSpecTD(playerid);
#endif
new Jfile[100],pIP[16],Jstr[128];
strdel(aka,0,256);
GetPlayerIp(playerid,pIP,16);
GetPlayerIp(playerid,playerIP,16);
format(Jfile,sizeof(Jfile),"JLadmin/Logs/aka.ini");
INI_ParseFile(Jfile,"GetAkaLog");
ResetVariables(playerid);
if(strlen(aka) < 3)
{
format(Jfile,sizeof(Jfile),"JLadmin/Logs/aka.ini");
new INI:AKA = INI_Open(Jfile);
INI_WriteString(AKA, pIP, GetName(playerid));
INI_Close(AKA);
}
else if(strfind(aka, GetName(playerid), true) == -1)
{
format(Jfile,sizeof(Jfile),"JLadmin/Logs/aka.ini");
format(Jstr,sizeof(Jstr),"%s,%s", aka, GetName(playerid));
new INI:AKA = INI_Open(Jfile);
INI_WriteString(AKA, pIP, Jstr);
INI_Close(AKA);
}
if(strlen(aka) > 70)
{
strmid(Jstring,aka,0,70);
format(Jstr, sizeof(Jstr),"Sign in >> Player: %s - IP: %s - AKA: %s", GetName(playerid),playerIP , Jstring);
SendToAdmins(Cmdcolor,Jstr);
strmid(Jstring,aka,70,sizeof(aka));
format(Jstr, sizeof(Jstr),"%s", Jstring);
SendToAdmins(Cmdcolor,Jstr);
}
else
{
if(strlen(aka) > 2) format(Jstr, sizeof(Jstr),"Sign in >> Player: %s - IP: %s - AKA: %s", GetName(playerid),playerIP , aka);
else format(Jstr, sizeof(Jstr),"Sign in >> Player: %s - IP: %s - AKA: No aka found!", GetName(playerid),playerIP);
SendToAdmins(Cmdcolor,Jstr);
}
format(Jfile, 100, ACCOUNTS_PATH, GetName(playerid));
if(!fexist(Jfile))
{
format(Jstring, sizeof(Jstring),"Your Account Name \"%s\" is not registered. Please register your nick name to save your status\nEnter the password Below:", GetName(playerid));
if(MustRegister == 1) ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_PASSWORD,"Register ", Jstring, "Register", "Kick");
SendClientMessage(playerid,red,"Your Account Isn't Registered. Please type your password in the dialog box.");
}
else
{
pInfo[playerid][Registered] = 1;
format(Jfile, 100, ACCOUNTS_PATH, GetName(playerid));
INI_ParseFile(Jfile, "GetPlayerInfo", .bExtra = true, .extra = playerid);
if(AutoLogin == 1 && (!strcmp(pIP, pInfo[playerid][IP],true) && pInfo[playerid][pAutoLogin] == 1))
{
format(Jfile, 100, ACCOUNTS_PATH, GetName(playerid));
INI_ParseFile(Jfile, "LoginPlayer", .bExtra = true, .extra = playerid);
SetPlayerScore(playerid, pInfo[playerid][Score]);
GivePlayerMoney(playerid, pInfo[playerid][Cash]);
pInfo[playerid][Logged] = 1;
if(pInfo[playerid][pLevel] >= 1)
{
switch(pInfo[playerid][pLevel])
{
case 1: LevelName = ADMIN_LEVEL_1;
case 2: LevelName = ADMIN_LEVEL_2;
case 3: LevelName = ADMIN_LEVEL_4;
case 4: LevelName = ADMIN_LEVEL_3;
case 5: LevelName = ADMIN_LEVEL_5;
case 6: LevelName = ADMIN_LEVEL_6;
case 7: LevelName = ADMIN_LEVEL_7;
case 8: LevelName = ADMIN_LEVEL_8;
case 9: LevelName = ADMIN_LEVEL_9;
case 10: LevelName = ADMIN_LEVEL_10;
}
format(Jstring, sizeof(Jstring),"Welcome back, You have been automatically logged in! | Level: %d (%s)", pInfo[playerid][pLevel], LevelName);
SendClientMessage(playerid,lighterblue,Jstring);
}
else
SendClientMessage(playerid,lighterblue,"Welcome back, You have been automatically logged in!");
}
else
{
#if LoginTextDraw == false
format(Jstring, sizeof(Jstring),"This Account Name \"%s\" is registered in our server.\nIf You are the owner of the account then please Login.\nPlease enter your password below:", GetName(playerid));
ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD,"Login Please", Jstring, "Login", "Quit");
#endif
SendClientMessage(playerid,yellow,"Welcome Back, Please Login To Access Your Account");
}
}
if(ForbiddenNamesKick == 1 && IsForbiddenNick(playerid) == 1)
{
format(Jstring, sizeof(Jstring),"Your nick name \"%s\" is in blacklist. Please relog\nwith a new nick name", GetName(playerid));
ShowPlayerDialog(playerid, JDIALOGS+45, DIALOG_STYLE_MSGBOX," {FB0404}Forbidden nick", Jstring, "Ok", "");
SetTimerEx("KickPlayer",200,false,"d", playerid);
format(Jstring, sizeof(Jstring),"\"%s\" has been automatically kicked | reason: 'Forbidden Name'", GetName(playerid));
SendToAdmins(red,Jstring);
WriteToLog(Jstring,"KickLog");
}
if(KickPartNicks == 1 && IsBadNickPart(playerid) == 1)
{
format(Jstring, sizeof(Jstring),"Your nick name part \"%s\" is in Forbidden part nick names list.\nplease relog with a new nick name", BadNickParts[BadPartID]);
ShowPlayerDialog(playerid, JDIALOGS+45, DIALOG_STYLE_MSGBOX," {FB0404}Forbidden part nick", Jstring, "Ok", "");
SetTimerEx("KickPlayer",200,false,"d", playerid);
format(Jstring, sizeof(Jstring),"\"%s\" has been automatically kicked | reason: 'Forbidden part nick (%s)'", GetName(playerid),BadNickParts[BadPartID]);
SendToAdmins(orange,Jstring);
WriteToLog(Jstring,"KickLog");
}
for(new i = 0; i < 40; i++)
SendClientMessage(playerid,-1," ");
TextDrawShowForPlayer(playerid, Textdraw0);
TextDrawShowForPlayer(playerid, Textdraw1);
TextDrawShowForPlayer(playerid, Textdraw2);
TextDrawShowForPlayer(playerid, Textdraw3);
TextDrawShowForPlayer(playerid, Textdraw4);
TextDrawShowForPlayer(playerid, Textdraw5);
TextDrawShowForPlayer(playerid, Textdraw6);
TextDrawShowForPlayer(playerid, Textdraw7);
TextDrawShowForPlayer(playerid, Textdraw8);
Connect[playerid]=1;
return 1;
}