SA-MP Forums Archive
chat for noobs - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: chat for noobs (/showthread.php?tid=240960)



chat for noobs - ConsoleX - 17.03.2011

Hello my /n chat for my server seems to be bugged

I set a helper such as /makehelper playerid <1-2> and it tells them

You must wait 50 seconds before speaking in that channel ! for helpers should use /n chat without waiting the seconds should be for newbies only.



code:

Код:
    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)
	        {
				Kick(playerid);
	            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;
			}
			if(PlayerInfo[playerid][pLevel] > 1 && PlayerInfo[playerid][pAdmin] <= 1 && PlayerInfo[playerid][pHelper] <= 0) format(string, sizeof(string), "** Player %s: %s", sendername, result);
            else if(PlayerInfo[playerid][pAdmin] >= 2) format(string, sizeof(string), "** Admin %s: %s", sendername, result);
            else if(PlayerInfo[playerid][pHelper] >= 2) format(string, sizeof(string), "** Head Helper %s: %s", sendername, result);
            else if(PlayerInfo[playerid][pDonateRank] >= 1) format(string, sizeof(string), "** VIP ** %s: %s", sendername, result);
            else if(PlayerInfo[playerid][pHelper] == 1) format(string, sizeof(string), "** Helper %s: %s", sendername, result);
			else format(string, sizeof(string), "** Newbie %s: %s", sendername, result);
			OOCNewbie(NEWBIE_COLOR,string);
			if(PlayerInfo[playerid][pAdmin] <= 1 && PlayerInfo[playerid][pHelper] <= 1) { UseNewbieTimer[playerid] = true; SetTimerEx("UseNewbie",50*1000,0,"i",playerid); }
        }
    }



AW: chat for noobs - XCarBOn - 17.03.2011

It's easy:

pawn Код:
if(UseNewbieTimer[playerid] && Insert here your function when a player isnt a newbie) return SendClientMessage(playerid,COLOR_GREY,"  You must wait 50 seconds before speaking in that channel !");



Re: chat for noobs - ConsoleX - 17.03.2011

thanks, what would I add in this line exactly?

i&& Insert here your function when a player isnt a newbie) how would the whole code look, sorry new at this.


AW: chat for noobs - XCarBOn - 17.03.2011

pawn Код:
if(UseNewbieTimer[playerid] && !Supporter[playerid])
For example.. I don't know if your variable is called Supporter[playerid]. There you need to insert the name of you variable for your supporter.


The "!" before Supporter[playerid] means "if not". So -> Means always in scripts (E.g. In C++ also) the opposite


Re: chat for noobs - ConsoleX - 17.03.2011

Ok helpers can now talk in /n without time to wait, but newbies and regular players can talk in /n without waiting 50 seconds? Same as helpers.

So it would look like
Код:
if(UseNewbieTimer[playerid] && HelperDuty[playerid]) return SendClientMessage(playerid,COLOR_GREY,"  You must wait 50 seconds before speaking in that channel !");



Re: chat for noobs - ConsoleX - 17.03.2011

someone?


Re: chat for noobs - Jochemd - 17.03.2011

Uhm, that sounds a bit unclear to me.


Re: chat for noobs - ConsoleX - 17.03.2011

Newbies - 60 second wait time to use /n after each use

Players - 50 seconds wait time when using /n after each use

Helpers - No wait time no seconds minutes anything

Right now on my server those 3 categories on /n have no wait time so they can talk in /n without wait time.


Re: chat for noobs - Stigg - 17.03.2011

Quote:
Originally Posted by ConsoleX
Посмотреть сообщение
Newbies - 60 second wait time to use /n after each use

Players - 50 seconds wait time when using /n after each use

Helpers - No wait time no seconds minutes anything

Right now on my server those 3 categories on /n have no wait time so they can talk in /n without wait time.
Unfair on the new players. Donator Chaser.


Re: chat for noobs - ConsoleX - 17.03.2011

Could anyone help? to add time to /n chat.

Quote:

Unfair on the new players. Donator Chaser.

That comment was not needed.