(181) : warning 225: unreachable code
#3

like this?

Код:
	// Display a message if the player hasn't accepted the rules yet
    if(APlayerData[playerid][RulesRead] == false)
	{
    SendClientMessage(playerid, 0xFFFFFFFF, "{FF0000}You haven't accepted the {FFFF00}/rules{FF0000} yet");
    }
	return 1;
}



// This function shows the player how long his ban still is when he tries to login (in days, hours, minutes, seconds)
ShowRemainingBanTime(playerid)
{
	// Setup local variables
	new TotalBanTime, Days, Hours, Minutes, Seconds, Msg[128];

	// Get the total ban-time
	TotalBanTime = APlayerData[playerid][BanTime] - gettime();

	// Calculate days
	if (TotalBanTime >= 86400)
	{
		Days = TotalBanTime / 86400;
		TotalBanTime = TotalBanTime - (Days * 86400);
	}
	// Calculate hours
	if (TotalBanTime >= 3600)
	{
		Hours = TotalBanTime / 3600;
		TotalBanTime = TotalBanTime - (Hours * 3600);
	}
	// Calculate minutes
	if (TotalBanTime >= 60)
	{
		Minutes = TotalBanTime / 60;
		TotalBanTime = TotalBanTime - (Minutes * 60);
	}
	// Calculate seconds
	Seconds = TotalBanTime;

	// Display the remaining ban-time for this player
	SendClientMessage(playerid, 0xFFFFFFFF, TXT_StillBanned);
	format(Msg, 128, TXT_BannedDuration, Days, Hours, Minutes, Seconds);
	SendClientMessage(playerid, 0xFFFFFFFF, Msg);
}



// This callback gets called when a player disconnects from the server
public OnPlayerDisconnect(playerid, reason)
{
	// Always allow NPC's to logout without password or account
	if (IsPlayerNPC(playerid))
		return 1;
Reply


Messages In This Thread
(181) : warning 225: unreachable code - by falling - 02.01.2012, 08:21
Re: (181) : warning 225: unreachable code - by Dark_Kostas - 02.01.2012, 08:24
Re: (181) : warning 225: unreachable code - by falling - 02.01.2012, 08:25
Re: (181) : warning 225: unreachable code - by Dark_Kostas - 02.01.2012, 08:29
Re: (181) : warning 225: unreachable code - by falling - 02.01.2012, 08:30
Re: (181) : warning 225: unreachable code - by Dark_Kostas - 02.01.2012, 08:34
Re: (181) : warning 225: unreachable code - by falling - 02.01.2012, 08:35
Re: (181) : warning 225: unreachable code - by PaulCrouseVS - 07.04.2018, 18:59

Forum Jump:


Users browsing this thread: 1 Guest(s)