12.01.2011, 22:12
How could i make this to where it uses login?
pawn Код:
public OnPlayerRequestClass(playerid, classid)
{
if (PlayerInfo[playerid][pDeath] == 1) return SpawnPlayer(playerid);
if(gPlayerLogged[playerid] == 0)
{
SendClientMessage(playerid, RED, ":::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::");
new File:welcome = fopen("WelcomeMessage.txt",io_read);
if (welcome)
{
new lines;
new message[500];
while (fread(welcome,message))
{
lines++;
SendClientMessage(playerid,COLOR_WHITE,message);
}
}
SendClientMessage(playerid, RED, ":::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::");
if(PlayerInfo[playerid][pSQLId] != INVALID_SQL_ID)
{
new nick[128];
format(nick,sizeof(nick),"Hello %s, type /login <password> to proceed",PlayerInfo[playerid][pName]);
SendClientMessage(playerid, COLOR_WHITE, nick);
}
else
{
SendClientMessage(playerid, COLOR_WHITE, "Your account isn't registered. You may use /register <password> ");
SendClientMessage(playerid, COLOR_WHITE, "Please make the effort to ensure your name is properly capitalized or you may be requested to change it");
}
}
return 0;
}