Display logged in message
#1

Код:
	if(mPlayerCreate(playerid,params[0])) {
		format(string,sizeof(string),"You have successfully registered your username %s with the password %s",ReturnName(playerid),params);
		SendClientMessage(playerid,COLOUR_IVORY,string);
		format(string,sizeof(string),"** You must now login to your account with /login %s",params);
		SendClientMessage(playerid,COLOUR_RED,string);
	    new vps[186];
	    format(vps,sizeof(vps),"Player: ' %s ' Has registered to the server, We now have a total of '%d' registered users",ReturnName(playerid),mGetRegistered());
        SendClientMessageToAll(COLOUR_YELLOW,vps);
	}
	else {
		SendClientMessage(playerid,COLOUR_RED,"Error: There was an unknown error while trying to create your account, contact an /admins");
	}
	return 1;
}
I want it to say "You have been succesfully logged in" when a player does /login

Help please?
Reply
#2

add this to the command

pawn Код:
SendClientMessage(playerid, COLOR_GREEN, "You have been successfully logged in");
pawn Код:
#define COLOR_GREEN 0x33AA33AA //at the top of script
show me the /login code if you don't know where to put the message
Reply
#3

I'm guessing this is /register. You need to add that to the /login command, once the player has been successfully logged in.
Reply
#4

Here's the dcmd_login

Код:
dcmd_login(playerid,params[]) {
	if(LoggedIn[playerid]) {
		SendClientMessage(playerid,COLOUR_RED,"Error: You are already logged in to your account!");
		return 1;
	}
	if(!mDoesAccExist(playerid)) {
		SendClientMessage(playerid,COLOUR_RED,"Error: This account doesn't exist, please /register it first");
		return 1;
	}
	
        if(!strlen(params)) {
		SendClientMessage(playerid,COLOUR_RED,"Usage: /login [password]");
		return 1;
	}
	if(mCheckPass(playerid,params)) {
		LoggedIn[playerid] = 1;
		new ip[20];
		GetPlayerIp(playerid,ip,20);
		mPlayerUpdateS(playerid,"ip",ip);
 		mPlayerUpdateI(playerid,"online",1);
  		XP[playerid] 			=	mPlayerGetI(playerid,"XP");
 		XLevel[playerid] 		=	mPlayerGetI(playerid,"Level");
 		Adminlevel[playerid]    =	mPlayerGetI(playerid,"Adminlevel");
 		Kills[playerid]         =   mPlayerGetI(playerid,"kills");
    		Deaths[playerid]        =   mPlayerGetI(playerid,"deaths");
 		PmsSent[playerid]       =   mPlayerGetI(playerid,"pms_sent");
 		ChatLines[playerid]     =   mPlayerGetI(playerid,"Textsent");
 		PlayerJoins[playerid]   =   mPlayerGetI(playerid,"player_joins");
 		CommandsUsed[playerid]  =   mPlayerGetI(playerid,"commands_used");
 		Raceswon[playerid]      =   mPlayerGetI(playerid,"Raceswon");
 		PlayerMoney[playerid]   =   mPlayerGetI(playerid,"cash");
 		//Bank[playerid]        =   mPlayerGetI(playerid,"Bank");
 		//Reactionswon[playerid] =  mPlayerGetI(playerid,"Reactionswon");
                TogglePlayerControllable(playerid,1);
		format(string,sizeof(string),"Logged in: Welcome back %s(Account id: %d) - [XP: %d | Level: %d ] - Admin Level: %d",ReturnName(playerid),mPlayerGetI(playerid,"id"),mPlayerGetI(playerid,"XP"),mPlayerGetI(playerid,"level"),mPlayerGetI(playerid,"Adminlevel"));
	        SendClientMessage(playerid,COLOUR_IVORY,string);
		return 1;
	}
	//printf("[MySQL Reg]: Warning: Player %s(%d) attempted login with incorrect password",ReturnName(playerid),playerid);
	//SendClientMessage(playerid,0xAA0000FF,"You have been kicked from the server (Incorrect Password)");
	//Kick(playerid);
	return 1;
}
But it displays NOTHING after you logged in :/
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)