SA-MP Forums Archive
For Current/Past Ravens RP Scripters - 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)
+--- Thread: For Current/Past Ravens RP Scripters (/showthread.php?tid=353958)



For Current/Past Ravens RP Scripters - MrSnapp - 25.06.2012

Hey guys. When I type /o and the message for example, "/o Hello world" it will display the message like normal but it will display a coloured user_name such as blue for cops and red for admins. How do I remove this?

Код:
	if(strcmp(cmd, "/ooc", true) == 0 || strcmp(cmd, "/o", true) == 0) // By CuervO_NegrO
	{
	    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 cannot speak, you have been silenced");
				return 1;
			}
			new length = strlen(cmdtext);
			while ((idx < length) && (cmdtext[idx] <= ' '))
			{
				idx++;
			}
			new offset = idx;
			new result[128];
			while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
			{
				result[idx - offset] = cmdtext[idx];
				idx++;
			}
			result[idx - offset] = EOS;
			if(!strlen(result))
			{
				SendClientMessage(playerid, COLOR_GRAD2, "USAGE: (/o)oc [OOC chat]");
				return 1;
			}
			if(PlayerInfo[playerid][pAdmin] == 0)
			{
				format(string, sizeof(string), "(( %s ))", (result));
			}
			else
			{
			    format(string, sizeof(string), "[[ %s ]]", (result));
			}
   			SendPlayerMessageToAll(playerid, string);
			new year,month,day;
			getdate(year, month, day);
			new hour, minute, second;
			gettime(hour,minute,second);
			format(string, sizeof(string), "(%d/%d/%d)[%d:%d:%d] %s (OOC): (%s)",day,month,year,hour,minute,second, sendername, result);
			PublicLog(string);
		}
		return 1;
	}



Re: For Current/Past Ravens RP Scripters - Jstylezzz - 25.06.2012

here ya go:

pawn Код:
if(strcmp(cmd, "/ooc", true) == 0 || strcmp(cmd, "/o", true) == 0)
{
    if(!strlen(cmdtext[4])) SendClientMessage(playerid, 0xffffffff, "USAGE: /ooc [text]");
    else
    {
        new tmp[128];
        GetPlayerName(playerid,tmp,24);
        format(tmp,128,"((OOC - %s: %s))",tmp,cmdtext[5]);
        SendClientMessageToAll(0xFFFFFFAA,tmp);
       
    }
    return 1;
 }
There may be some mistakes, Long ago I worked with the old commands..
I recommand converting the script to ZCMD or YCMD...


Re: For Current/Past Ravens RP Scripters - MrSnapp - 25.06.2012

Thank you for that <3. Also when they /o it goes like this User_Name: ((Message)). How would I make it ((User_Name:Message))


Re: For Current/Past Ravens RP Scripters - [MM]RoXoR[FS] - 25.06.2012

pawn Код:
format(tmp,128,"(( %s:%s))",tmp,cmdtext[5]);



Re: For Current/Past Ravens RP Scripters - Grand_Micha - 25.06.2012

pawn Код:
if(strcmp(cmd, "/ooc", true) == 0 || strcmp(cmd, "/o", true) == 0)
{
    if(!strlen(cmdtext[4])) SendClientMessage(playerid, 0xffffffff, "USAGE: /ooc [text]");
    else
    {
        new tmp[128],Batz[24];
        GetPlayerName(playerid,Batz,24);
        format(tmp,128,"((OOC - %s: %s))",Batz,cmdtext[5]);
        SendClientMessageToAll(0xFFFFFFAA,tmp);
       
    }
    return 1;
 }
Here you go, kid.


Re: For Current/Past Ravens RP Scripters - Jstylezzz - 25.06.2012

Quote:
Originally Posted by Grand_Micha
Посмотреть сообщение
pawn Код:
if(strcmp(cmd, "/ooc", true) == 0 || strcmp(cmd, "/o", true) == 0)
{
    if(!strlen(cmdtext[4])) SendClientMessage(playerid, 0xffffffff, "USAGE: /ooc [text]");
    else
    {
        new tmp[128],Batz[24];
        GetPlayerName(playerid,Batz,24);
        format(tmp,128,"((OOC - %s: %s))",Batz,cmdtext[5]);
        SendClientMessageToAll(0xFFFFFFAA,tmp);
       
    }
    return 1;
 }
Here you go, kid.
Lolz, that's the same code i posted, you only added that batz thing....


if you want Username: ((message)) use this:
pawn Код:
format(tmp,128,"%s: ((%s))",tmp,cmdtext[5]);
it will output: Jari_Johnson:((OOC Message))


Re: For Current/Past Ravens RP Scripters - MrSnapp - 26.06.2012

Quote:
Originally Posted by Jari_Johnson*
Посмотреть сообщение
Lolz, that's the same code i posted, you only added that batz thing....


if you want Username: ((message)) use this:
pawn Код:
format(tmp,128,"%s: ((%s))",tmp,cmdtext[5]);
it will output: Jari_Johnson(OOC Message))
And for ((Jari_Johnson:OOC Message)) ??


Re: For Current/Past Ravens RP Scripters - Jstylezzz - 26.06.2012

Quote:
Originally Posted by MrSnapp
Посмотреть сообщение
And for ((Jari_Johnson:OOC Message)) ??
For that you do:
pawn Код:
format(tmp,128,"((%s: %s))",tmp,cmdtext[5]);
which will output the ((Jari_Johnson: OOC Message))


Re: For Current/Past Ravens RP Scripters - -CaRRoT - 26.06.2012

PHP код:
format(tmp,128,"(( %s: %s))",tmp,cmdtext[5]); 
Logic.


Edit : too late.