luxadmin login
#5

here is the OnPlayerSpawn what should i do ?
Код:
 public OnPlayerSpawn(playerid)
{
//==============================================================================
// Request Register
//==============================================================================
	if(AccInfo[playerid][Registered] == 0 && ServerInfo[MustRegister] == 1)
	{
		#if USE_DIALOGS == true
		new rstring[256];
		format(rstring,256,"Welcome to the '%s'\n\nAccount '%s' is not registred!\n\nEnter the password to Register your Account:",GetServerHostName(),pName(playerid));
		ShowPlayerDialog(playerid,DIALOGID+66,DIALOG_STYLE_INPUT,"Register Account",rstring,"Register","Quit");
		#endif
		return 1;
	}
//==============================================================================
// Request Login
//==============================================================================
	if(ServerInfo[MustLogin] == 1 && AccInfo[playerid][Registered] == 1 && AccInfo[playerid][LoggedIn] == 0)
	{
		#if USE_DIALOGS == true
		new lstring[256];
		format(lstring,256,"That account '%s 'is Registered!\n\n Login to access your Account:",pName(playerid));
		ShowPlayerDialog(playerid,DIALOGID+67,DIALOG_STYLE_INPUT,"Login Account",lstring,"Login","Quit");
		#endif
		return 1;
	}
//==============================================================================
// Player Frozen (Prevent scape)
//==============================================================================
	AccInfo[playerid][Spawned] = 1;

	if(AccInfo[playerid][Frozen] == 1) {
		TogglePlayerControllable(playerid,false);
		return SendClientMessage(playerid,red,"You cant escape your punishment. You Are Still Frozen");
	}
//==============================================================================
// Player Jail (Prevent scape)
//==============================================================================
	if(AccInfo[playerid][Jailed] == 1) {
	    SetTimerEx("JailPlayer",3000,0,"d",playerid);
		return SendClientMessage(playerid,red,"You cant escape your punishment. You Are Still In Jail");
	}
//==============================================================================
// Administrators Skins/Prevent players to use
//==============================================================================
	if(ServerInfo[AdminOnlySkins] == 1)
	{
		if( (GetPlayerSkin(playerid) == ServerInfo[AdminSkin]) || (GetPlayerSkin(playerid) == ServerInfo[AdminSkin2]))
		{
			if(AccInfo[playerid][Level] >= 1)
			GameTextForPlayer(playerid,"~b~Welcome~n~~w~Admin",3000,1);
			else
			{
			GameTextForPlayer(playerid,"~r~This Skin Is For~n~Administrators~n~Only",4000,1);
			SetTimerEx("DelayKillPlayer", 2500,0,"d",playerid);
			return 1;
			}
		}
	}
	if((dUserINT(PlayerName2(playerid)).("UseSkin")) == 1)
		if((AccInfo[playerid][Level] >= 1) && (AccInfo[playerid][LoggedIn] == 1))
		SetPlayerSkin(playerid,(dUserINT(PlayerName2(playerid)).("FavSkin")) );

//==============================================================================
// Verify player in CAGE
//==============================================================================
	if(AccInfo[playerid][pCaged] == 1)
	{
 	SetTimerEx("CagePrevent", 300, 0, "i", playerid);
 	}
	if(ServerInfo[Announce] == 1)
 	TextDrawShowForPlayer(playerid, Announcements);
//==============================================================================
// Weapons
//==============================================================================
	if(ServerInfo[GiveWeap] == 1)
	{
		if(AccInfo[playerid][LoggedIn] == 1)
		{
			AccInfo[playerid][TimesSpawned]++;
			if(AccInfo[playerid][TimesSpawned] == 1)
			{
			GivePlayerWeapon(playerid,dUserINT(PlayerName2(playerid)).("Weapon1"),dUserINT(PlayerName2(playerid)).("Weapon1Ammo"));
			GivePlayerWeapon(playerid,dUserINT(PlayerName2(playerid)).("Weapon2"),dUserINT(PlayerName2(playerid)).("Weapon2Ammo"));
			GivePlayerWeapon(playerid,dUserINT(PlayerName2(playerid)).("Weapon3"),dUserINT(PlayerName2(playerid)).("Weapon3Ammo"));
			GivePlayerWeapon(playerid,dUserINT(PlayerName2(playerid)).("Weapon4"),dUserINT(PlayerName2(playerid)).("Weapon4Ammo"));
			GivePlayerWeapon(playerid,dUserINT(PlayerName2(playerid)).("Weapon5"),dUserINT(PlayerName2(playerid)).("Weapon5Ammo"));
			GivePlayerWeapon(playerid,dUserINT(PlayerName2(playerid)).("Weapon6"),dUserINT(PlayerName2(playerid)).("Weapon6Ammo"));
			}
		}
	}
	return 1;
}

//==============================================================================
//-------------------------------------------------
// Player Death
//-------------------------------------------------
//==============================================================================
public OnPlayerDeath(playerid, killerid, reason)
{
	#if USE_STATS == true
    AccInfo[playerid][Deaths]++;
	#endif
    InDuel[playerid] = 0;
    
    if(AccInfo[playerid][pCaged] == 1)
    {
   	cage[playerid] 	= DestroyObject(cage[playerid]);
	cage2[playerid] = DestroyObject(cage2[playerid]);
	cage3[playerid] = DestroyObject(cage3[playerid]);
	cage4[playerid] = DestroyObject(cage4[playerid]);
	}
	
	if(IsPlayerConnected(killerid) && killerid != INVALID_PLAYER_ID)
	{
		#if USE_STATS == true
		AccInfo[killerid][Kills]++;
	    #endif
//==============================================================================
// In Duel
//==============================================================================
		if(InDuel[playerid] == 1 && InDuel[killerid] == 1)
		{
		GameTextForPlayer(playerid,"Loser!",3000,3);
		GameTextForPlayer(killerid,"Winner!",3000,3);
		InDuel[killerid] = 0;
		SetPlayerPos(killerid, 0.0, 0.0, 0.0);
		SpawnPlayer(killerid);
		}
		else if(InDuel[playerid] == 1 && InDuel[killerid] == 0)
		{
		GameTextForPlayer(playerid,"Loser !",3000,3);
		}
	}
//==============================================================================
// Spectate
//==============================================================================
	for(new x=0; x<MAX_PLAYERS; x++)
	    if(GetPlayerState(x) == PLAYER_STATE_SPECTATING && AccInfo[x][SpecID] == playerid)
     	AdvanceSpectate(x);
	return 1;
}
//==============================================================================
//-------------------------------------------------
// Player Text
//-------------------------------------------------
//==============================================================================
public OnPlayerText(playerid, text[])
{
//==============================================================================
// Vip Chat
//==============================================================================
	if(text[0] == '*' && AccInfo[playerid][pVip] >= 1)
	{
	    new string[128]; GetPlayerName(playerid,string,sizeof(string));
		format(string,sizeof(string),"|ChatVip| %s: %s",string,text[1]);
		MessageToPlayerVIP(0xDC686BAA,string);
		SaveIn("ChatVipLog",string);
	    return 0;
	}
//==============================================================================
// Administration Chat
//==============================================================================
	if(text[0] == '#' && AccInfo[playerid][Level] >= 1)
	{
	    new string[128]; GetPlayerName(playerid,string,sizeof(string));
		format(string,sizeof(string),"Admin Chat: %s: %s",string,text[1]);
		MessageToAdmins(green,string);
		#if ADM_CHAT_LOG == true
		SaveIn("AdmChatLog",string);
		#endif
	    return 0;
	}
//==============================================================================
// Chat Disabled
//==============================================================================
	if(ServerInfo[DisableChat] == 1)
	{
		SendClientMessage(playerid,red,"Chat has been Disabled!");
	 	return 0;
	}
//==============================================================================
// Player Muted
//==============================================================================
 	if(AccInfo[playerid][Muted] == 1)
	{
 		AccInfo[playerid][MuteWarnings]++;
 		new string[128];
		if(AccInfo[playerid][MuteWarnings] < ServerInfo[MaxMuteWarnings])
		{
		format(string, sizeof(string),"ATTENTION: You are Muted! Cannot talk (Warnings: %d/%d)",AccInfo[playerid][MuteWarnings],ServerInfo[MaxMuteWarnings]);
		SendClientMessage(playerid,red,string);
		}
		else
		{
		SendClientMessage(playerid,red,"You have been Automatically Kicked. (Reason: Exceeding Mute Warnings)");
		format(string, sizeof(string),"Player %s (Id:%d) has been Automatically Kicked. (Reason: Exceeding Mute Warnings)",PlayerName2(playerid),playerid);
		SendClientMessageToAll(grey,string);
		SaveIn("KickLog",string); Kick(playerid);
		} return 0;
	}
//==============================================================================
// Flood/Spam Protection
//==============================================================================
	if(ServerInfo[AntiSpam] == 1 && (AccInfo[playerid][Level] == 0 && !IsPlayerAdmin(playerid)))
	{
		if(AccInfo[playerid][SpamCount] == 0) AccInfo[playerid][SpamTime] = TimeStamp();

	    AccInfo[playerid][SpamCount]++;
		if(TimeStamp() - AccInfo[playerid][SpamTime] > SPAM_TIMELIMIT) { // Its OK your messages were far enough apart
			AccInfo[playerid][SpamCount] = 0;
			AccInfo[playerid][SpamTime] = TimeStamp();
		}
		else if(AccInfo[playerid][SpamCount] == SPAM_MAX_MSGS) {
			new string[64]; format(string,sizeof(string),"Player %s (Id:%d) has been Automatically Kicked. (Reason: Flood/Spam Protection)", PlayerName2(playerid),playerid);
			SendClientMessageToAll(grey,string); print(string);
			SaveIn("KickLog",string);
			Kick(playerid);
		}
		else if(AccInfo[playerid][SpamCount] == SPAM_MAX_MSGS-1) {
			SendClientMessage(playerid,red,"ATTENTION: Anti Spam Warning! Next is a Kick!");
			return 0;
		}
	}
//==============================================================================
// Send Admin in front of name
//==============================================================================
	#if ADM_InMSG == true
	if (AccInfo[playerid][Hide] == 0)
	{
	if(AccInfo[playerid][Level] > 0)
	{
	new str3[256];
	format(str3, 256, "(Admin): %s", text);
	for(new gz=0;gz<200;gz++)
	if(IsPlayerConnected(gz))
	SendPlayerMessageToPlayer(gz, playerid, str3);
	else SendPlayerMessageToPlayer(gz, playerid, text);
	}
	return 0;
	}
	#endif
//==============================================================================
// Forbidden Words
//==============================================================================
	if(ServerInfo[AntiSwear] == 1 && AccInfo[playerid][Level] < ServerInfo[MaxAdminLevel])
	for(new s = 0; s < BadWordsCount; s++)
	{
	new pos;
	while((pos = strfind(text,BadWords[s],true)) != -1)
	for(new i = pos, j = pos + strlen(BadWords[s]); i < j; i++) text[i] = '*';
	}
//==============================================================================
// Anti Advertisements
//==============================================================================
	if(ServerInfo[AntiAds] == 1)
	{
		if(AdvertisementCheck(text) && AccInfo[playerid][Level] < 3)
		{
			AccInfo[playerid][MaxAdv]++;
			new string[128];
			format(string,sizeof(string),"Warning! Suspected ads in your message! (Warnings: %d/%d)",AccInfo[playerid][MaxAdv], MAX_ADV_WARNINGS);
			SendClientMessage(playerid, grey,string);
				
			if(AccInfo[playerid][MaxAdv] == MAX_ADV_WARNINGS)
			{
				format(string,sizeof(string),"You is Automatically Kicked. (Reason: Many ads in your Messages) (%d/%d)",AccInfo[playerid][MaxAdv], MAX_ADV_WARNINGS);
 				SendClientMessage(playerid, lightred,string);
 	
 				format(string,sizeof(string),"Player %s (Id:%d) has beenAutomatically  Kicked. (Reason: Many Advertisements!) (%d)",PlayerName2(playerid),playerid, MAX_ADV_WARNINGS);
 				SaveIn("KickLog",string); Kick(playerid);
				SendClientMessageToAll(lightred, string);
				print(string);
			}
			return 0;
		}
	}
//==============================================================================
// Block CapsLock
//==============================================================================
	if(AccInfo[playerid][Caps] == 1)
	UpperToLower(text);
	if(ServerInfo[NoCaps] == 1)
	UpperToLower(text);
	
//==============================================================================
// Chat Lines (Console)
//==============================================================================
	for(new i = 1; i < MAX_CHAT_LINES-1; i++)
	Chat[i] = Chat[i+1];
	new ChatSTR[128];
	GetPlayerName(playerid,ChatSTR,sizeof(ChatSTR));
	format(ChatSTR,128,"[CHAT]%s: %s",ChatSTR, text[0]);
	Chat[MAX_CHAT_LINES-1] = ChatSTR;
	return 1;
}
//==============================================================================
//-------------------------------------------------
// Private Message (PM)
//-------------------------------------------------
//==============================================================================
public OnPlayerPrivmsg(playerid, recieverid, text[])
{
	if(ServerInfo[ReadPMs] == 1 && AccInfo[playerid][Level] != ServerInfo[MaxAdminLevel])
	{
//==============================================================================
// Send PM
//==============================================================================
    	new string[128];
		new pReciever[MAX_PLAYER_NAME];
		GetPlayerName(playerid, string, sizeof(string));
		GetPlayerName(recieverid, pReciever, sizeof(pReciever));
		format(string, sizeof(string), "PM: %s To %s: %s", string, pReciever, text);
  		for (new a = 0; a < MAX_PLAYERS; a++)
		if(IsPlayerConnected(a) && (AccInfo[a][Level] >= ServerInfo[MaxAdminLevel]) && a != playerid)
		SendClientMessage(a, grey, string);
		#if PM_CHAT_LOG == true
		SaveIn("AdmChatLog",string);
		#endif
	}
//==============================================================================
// Muted
//==============================================================================
 	if(AccInfo[playerid][Muted] == 1)
	{
		new string[128];
 		AccInfo[playerid][MuteWarnings]++;
		if(AccInfo[playerid][MuteWarnings] < ServerInfo[MaxMuteWarnings])
		{
		format(string, sizeof(string),"ATTENTION: You are Muted! Cannot talk (Warnings: %d/%d)",AccInfo[playerid][MuteWarnings],ServerInfo[MaxMuteWarnings]);
		SendClientMessage(playerid,red,string);
		}
		else
		{
		SendClientMessage(playerid,red,"You have been Automatically Kicked. (Reason: Exceeding Mute Warnings)");
		GetPlayerName(playerid, string, sizeof(string));
		format(string, sizeof(string),"Player %s (Id:%d) has been Automatically Kicked. (Reason: Exceeding Mute Warnings)", string, playerid);
		SendClientMessageToAll(lightred,string);
		SaveIn("KickLog",string);
		Kick(playerid);
		}
		return 0;
	}
	#if EnablePM_Cmd == true
	new string[128];
	format(string,256,"PM: Message to '%s(%d)': \"%s\"",PmReceiver,PMplayer1,text);
	SendClientMessage(playerid,0x00A765AA,string);
 	PlayerPlaySound(playerid,1057,0.0,0.0,0.0);
            
	GetPlayerName(playerid, string, sizeof(string));
	format(string, sizeof(string),"PM: Message from: %s: \"%s\"",string,text);
	SendClientMessage(recieverid,0x00A765AA,string);
	#endif
	return 1;
}
Reply


Messages In This Thread
luxadmin login - by Wonderweiss - 24.10.2012, 11:58
Re: luxadmin login - by Wonderweiss - 24.10.2012, 12:26
Re: luxadmin login - by Ironboy - 24.10.2012, 12:29
Re: luxadmin login - by Wonderweiss - 24.10.2012, 12:39
Re: luxadmin login - by Wonderweiss - 24.10.2012, 13:07

Forum Jump:


Users browsing this thread: 1 Guest(s)