2 small questions
#5

Not add that at the cmd? /G ? Cause i got this:
Код:
CMD:g(playerid, params[])
{
	if(gPlayerLogged[playerid] == 0)
	{
		SendClientMessage(playerid, COLOR_GREY, "You're not logged in.");
		return 1;
	}
	if(PlayerInfo[playerid][pGCMuted] > 0)
	{
		SendClientMessage(playerid, COLOR_GREY, "You're muted from this channel.");
		return 1;
	}
	new string[128];
	if(GlobalChatTimer[playerid] > 0)
	{
		format(string, sizeof(string), "You must wait %d seconds before speaking again in this channel.", GlobalChatTimer[playerid]);
		SendClientMessage(playerid, COLOR_GREY, string);
		return 1;
	}
	if(GlobalChat[playerid] == 0)
	{
		SendClientMessage(playerid, COLOR_WHITE, "You're not in the global chat, type /toggc.");
		return 1;
	}

	if(isnull(params))
		return SendClientMessage(playerid, COLOR_WHITE, "USAGE: (/g) [text]");

	if(strlen(params) > 80)
	    return SendClientMessage(playerid, COLOR_GREY, "Your message is too long - the limit is 80 characters.");

	if(PlayerInfo[playerid][pAdmin] < 1 && PlayerInfo[playerid][pDonator] == 1)
	{
		format(string, sizeof(string), "(( Ruby Donator %s: %s ))", GetPlayerNameEx(playerid), params);
		GlobalChatTimer[playerid] = 5;
	}
	else if(PlayerInfo[playerid][pAdmin] < 1 && PlayerInfo[playerid][pDonator] == 2)
	{
		format(string, sizeof(string), "(( Sapphire Donator %s: %s ))", GetPlayerNameEx(playerid), params);
		GlobalChatTimer[playerid] = 5;
	}
	else if(PlayerInfo[playerid][pAdmin] < 1 && PlayerInfo[playerid][pDonator] == 3)
	{
		format(string, sizeof(string), "(( Diamond Donator %s: %s ))", GetPlayerNameEx(playerid), params);
		GlobalChatTimer[playerid] = 5;
	}
	else if(PlayerInfo[playerid][pHelper] == 1)
	{
		format(string, sizeof(string), "(( Junior Helper %s: %s ))", GetPlayerNameEx(playerid), params);
		GlobalChatTimer[playerid] = 2;
	}
	else if(PlayerInfo[playerid][pHelper] == 2)
	{
		format(string, sizeof(string), "(( Senior Helper %s: %s ))", GetPlayerNameEx(playerid), params);
		GlobalChatTimer[playerid] = 2;
	}
	else if(PlayerInfo[playerid][pAdmin] < 1 && PlayerInfo[playerid][pDonator] == 1)
	{
		format(string, sizeof(string), "(( Level %d Player %s: %s ))", PlayerInfo[playerid][pLevel], GetPlayerNameEx(playerid), params);
		GlobalChatTimer[playerid] = 5;
	}
	else if(PlayerInfo[playerid][pAdmin] < 1 && PlayerInfo[playerid][pDonator] == 0)
	{
		format(string, sizeof(string), "(( Level %d Player %s: %s ))", PlayerInfo[playerid][pLevel], GetPlayerNameEx(playerid), params);
		GlobalChatTimer[playerid] = 5;
	}
	else if(PlayerInfo[playerid][pAdmin] >= 1)
	{
 		format(string, sizeof(string), "(( Level %d Admin %s: %s ))", PlayerInfo[playerid][pAdmin], GetPlayerNameEx(playerid), params);
	}

	foreach(Player, i)
	{
		if(GlobalChat[i] == 1)
		{
			SendClientMessage(i, COLOR_NEWS, string);
		}
	}
	return 1;
}
Reply


Messages In This Thread
2 small questions - by Lisaax - 21.03.2014, 21:05
Re: 2 small questions - by Carxi - 21.03.2014, 21:09
Re: 2 small questions - by Lisaax - 23.03.2014, 09:45
Re: 2 small questions - by MythicalMarauder - 23.03.2014, 09:50
Re: 2 small questions - by Lisaax - 23.03.2014, 10:46
Re: 2 small questions - by MythicalMarauder - 23.03.2014, 11:04
Re: 2 small questions - by Lisaax - 23.03.2014, 11:06
Re: 2 small questions - by Lisaax - 23.03.2014, 18:21
Re: 2 small questions - by Lisaax - 24.03.2014, 13:38
Re: 2 small questions - by newbie scripter - 24.03.2014, 13:52

Forum Jump:


Users browsing this thread: 1 Guest(s)