Need help with /n command
#1

Hi sa-mp.com . I have some problem with this script .. When i compile this i have no error but when i'am in-game and i type /n test he does nothing .. Sorry for bad english , i'am from Romania .

Код:
	if(strcmp(cmd, "/newbie", true) == 0 || strcmp(cmd, "/n", true) == 0)
	{
	    if(IsPlayerConnected(playerid))
	    {
	        if(gPlayerLogged[playerid] == 0)
	        {
	            SendClientMessage(playerid, COLOR_GREY, "   You havent logged in yet !");
	            return 1;
	        }
			if ((noooc) && PlayerInfo[playerid][pAdmin] < 1)
			{
				SendClientMessage(playerid, COLOR_GRAD2, "   The OOC channel has been disabled by an Admin !");
				return 1;
			}
			if(PlayerInfo[playerid][pMuted] == 1)
			{
				SendClientMessage(playerid, TEAM_CYAN_COLOR, "   You can't speak, you have been silenced !");
				return 1;
			}
			GetPlayerName(playerid, sendername, sizeof(sendername));
			new length = strlen(cmdtext);
			while ((idx < length) && (cmdtext[idx] <= ' '))
			{
				idx++;
			}
			new offset = idx;
			new result[64];
			while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
			{
				result[idx - offset] = cmdtext[idx];
				idx++;
			}
	for(new i=0; i<MAX_PLAYERS; i++)
	if(FindIP(result)) ///
	{
	   new advertiser[MAX_PLAYER_NAME];
	   GetPlayerName(playerid, advertiser, sizeof(advertiser));
	   format(string, sizeof(string), "[Warning]: %s[ID: %d] face reclama ",advertiser,i);
	   ABroadCast(COLOR_LIGHTRED,string,1);
	   return 0;
	}
			result[idx - offset] = EOS;
			if(!strlen(result))
			{
				SendClientMessage(playerid, COLOR_GRAD2, "{55D4FF}SCRIE:{B4B4B4} (/n)ewbie [text]");
				return 1;
			}

				if(PlayerInfo[playerid][pLevel] == 1)
			format(string, sizeof(string), "{7F90E5}*(N) Incepator Nivel 1 - %s[%d]:{FFFFFF} %s",sendername, result);
	            if(PlayerInfo[playerid][pLevel] == 2)
	            format(string, sizeof(string), "{7F90E5}*(N) Incepator Nivel 2 - %s[%d]:{FFFFFF} %s",sendername, result);
	            if(PlayerInfo[playerid][pLevel] == 3)
	            format(string, sizeof(string), "{7F90E5}*(N) Incepator Nivel 3 - %s[%d]:{FFFFFF} %s",sendername, result);
	            if(PlayerInfo[playerid][pAdmin] == 1)
	            format(string, sizeof(string), "{7F90E5}*(N) Administrator Nivel 1 - %s[%d]:{FFFFFF} %s",sendername, result);
	            if(PlayerInfo[playerid][pAdmin] == 2)
	            format(string, sizeof(string), "{7F90E5}*(N) Administrator Nivel 2 - %s[%d]:{FFFFFF} %s",sendername, result);
		}
		return 1;
	}
	if(strcmp(cmd, "/non", true) == 0)
	{
	    if(IsPlayerConnected(playerid))
	    {
			if (PlayerInfo[playerid][pAdmin] >= 7 && (!noooc))
			{
				noooc = 1;
				BroadCast(COLOR_GRAD2, "   Newbie chat channel disabled by an Admin !");
			}
			else if (PlayerInfo[playerid][pAdmin] >= 2 && (noooc))
			{
				noooc = 0;
				BroadCast(COLOR_GRAD2, "   Newbie chat channel enabled by an Admin !");
			}
			else
			{
				SendClientMessage(playerid, COLOR_GRAD1, "   you are not authorized to use that command!");
			}
		}
		return 1;
	}
Reply
#2

Someone ? Please !
Reply
#3

Are you sure that PlayerInfo[playerid][pLevel] is not 0 for your character in game?
Reply
#4

Doesn't work , anyone ?
Reply
#5

Код:
if(strcmp(cmd, "/newbie", true) == 0 || strcmp(cmd, "/n", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            if(gPlayerLogged[playerid] == 0)
	        {
	            SendClientMessage(playerid, COLOR_GREY, "   You havent logged in yet !");
	            return 1;
	        }
	        if(PlayerInfo[playerid][pTut] == 0)
	        {
	            return 1;
	        }
	        if((nonewbie) && PlayerInfo[playerid][pAdmin] < 3)
			{
				SendClientMessage(playerid, COLOR_GREY, "   The Newbie channel has been disabled by an Admin !");
				return 1;
			}
			if(PlayerInfo[playerid][pNewbieMuted] == 1)
			{
				SendClientMessage(playerid, COLOR_GREY, "   You are banned from speaking in that channel !");
				return 1;
			}
			if(UseNewbieTimer[playerid]) return SendClientMessage(playerid,COLOR_GREY,"  You must wait 50 seconds before speaking in that channel !");
        	GetPlayerName(playerid, sendername, sizeof(sendername));
			new length = strlen(cmdtext);
			while ((idx < length) && (cmdtext[idx] <= ' '))
			{
				idx++;
			}
			new offset = idx;
			new result[96];
			while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
			{
				result[idx - offset] = cmdtext[idx];
				idx++;
			}
			result[idx - offset] = EOS;
			if(!strlen(result))
			{
				SendClientMessage(playerid, COLOR_WHITE, "USAGE: (/n)ewbie [newbie chat]");
				return 1;
			}
			new plevel = PlayerInfo[playerid][pLevel];
			new hlevel = PlayerInfo[playerid][pHelper];
			new alevel = PlayerInfo[playerid][pAdmin];
			new vlevel = PlayerInfo[playerid][pDonateRank];
			new stealthed = PlayerInfo[playerid][pStealthed];
			if(plevel >= 2 && vlevel == 0 && alevel == 0 && stealthed == 0) format(string, sizeof(string), "** Player %s: %s", sendername, result);
			if(plevel == 1 && vlevel == 0 && alevel == 0 && stealthed == 0) format(string, sizeof(string), "** Newbie %s: %s", sendername, result);
			if(hlevel == 1) format(string, sizeof(string), "** Helper %s: %s", sendername, result);
			if(hlevel >= 2) format(string, sizeof(string), "** Head Helper %s: %s", sendername, result);
			if(vlevel == 1) format(string, sizeof(string), "** Bronze VIP %s: %s", sendername, result);
			if(vlevel == 2) format(string, sizeof(string), "** Silver VIP %s: %s", sendername, result);
			if(vlevel == 3) format(string, sizeof(string), "** Gold VIP %s: %s", sendername, result);
			if(alevel >= 2 && stealthed == 0) format(string, sizeof(string), "** Admin %s: %s", sendername, result);
			OOCNewbie(NEWBIE_COLOR,string);
			if(PlayerInfo[playerid][pAdmin] <= 1 && PlayerInfo[playerid][pHelper] <= 0) { UseNewbieTimer[playerid] = true; SetTimerEx("UseNewbie",50*1000,0,"i",playerid); }
        }
    }
Try this instead.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)