I need help with string
#1

I made a colorful Broadcast of /noooc command when it will be opened, but instead of showing the exactly line it shows with the colors numbers and letters:






Код:
CMD:noooc(playerid, params[])
{
	if(PlayerInfo[playerid][pAdmin] >= 2)
	{
		if (!noooc)
		{
			noooc = 1;
			BroadCast(COLOR_GREEN, "   OOC chat channel disabled by an Admin!");
		}
		else
		{
		noooc = 0;
		new string[ 128 ];
		format(string, sizeof(string), "   (0x00FFD0AA)OOC chat channel enabled by an Admin! - (FFFF00)Do (FF0000)NOT (FFFF00)abuse OOC chat with (0099FF)Spamming, (F200FF)Insulting, (8400FF)Cursing, (FFFF00)You will get punishment for that.");
		ABroadCast(COLOR_YELLOW, string, 128 );
		}
	}
	else
	{
		SendClientMessageEx(playerid, COLOR_GRAD1, "You are not authorized to use that command!");
	}
	return 1;
}
what am i doing wrong?
Reply
#2

Try now
pawn Код:
CMD:noooc(playerid, params[])
{
    if(PlayerInfo[playerid][pAdmin] >= 2)
    {
        if (!noooc)
        {
            noooc = 1;
            BroadCast(COLOR_GREEN, "   OOC chat channel disabled by an Admin!");
        }
        else
        {
        noooc = 0;
        new string[ 128 ];
        format(string, sizeof(string), "   (0x00FFD0AA)OOC chat channel enabled by an Admin! - (FFFF00)Do (FF0000)NOT (FFFF00)abuse OOC chat with (0099FF)Spamming, (F200FF)Insulting, (8400FF)Cursing, (FFFF00)You will get punishment for that.");
        ABroadCast(-1, string, 128 );
        }
    }
    else
    {
        SendClientMessageEx(playerid, COLOR_GRAD1, "You are not authorized to use that command!");
    }
    return 1;
}
Reply
#3

Define these colors

make this "
insteed of (


pawn Код:
CMD:noooc(playerid, params[])
{
    if(PlayerInfo[playerid][pAdmin] >= 2)
    {
        if (!noooc)
        {
            noooc = 1;
            BroadCast(COLOR_GREEN, "   OOC chat channel disabled by an Admin!");
        }
        else
        {
        noooc = 0;
        new string[ 256 ];
        format(string, sizeof(string), "   "0x00FFD0AA"OOC chat channel enabled by an Admin! - "FFFF00"Do "FF0000"NOT "FFFF00"abuse OOC chat with "0099FF"Spamming, "F200FF"Insulting, "8400FF"Cursing, "FFFF00"You will get punishment for that.");
        ABroadCast(-1, string, 128 );
        }
    }
    else
    {
        SendClientMessageEx(playerid, COLOR_GRAD1, "You are not authorized to use that command!");
    }
    return 1;
}
this will work
Reply
#4

now that errors show up: (ignore the warnings)


Quote:

C:\Users\Mor\Desktop\CGRP v1.0\CGRP v1.0\gamemodes\CGRP.pwn(18236) : warning 217: loose indentation
C:\Users\Mor\Desktop\CGRP v1.0\CGRP v1.0\gamemodes\CGRP.pwn(18793) : warning 217: loose indentation
C:\Users\Mor\Desktop\CGRP v1.0\CGRP v1.0\gamemodes\CGRP.pwn(18794) : warning 217: loose indentation
C:\Users\Mor\Desktop\CGRP v1.0\CGRP v1.0\gamemodes\CGRP.pwn(18930) : warning 217: loose indentation
C:\Users\Mor\Desktop\CGRP v1.0\CGRP v1.0\gamemodes\CGRP.pwn(31121) : error 001: expected token: "-string end-", but found "-identifier-"
C:\Users\Mor\Desktop\CGRP v1.0\CGRP v1.0\gamemodes\CGRP.pwn(31121) : error 001: expected token: "-string end-", but found "-identifier-"
C:\Users\Mor\Desktop\CGRP v1.0\CGRP v1.0\gamemodes\CGRP.pwn(31121) : warning 215: expression has no effect
C:\Users\Mor\Desktop\CGRP v1.0\CGRP v1.0\gamemodes\CGRP.pwn(31121) : error 001: expected token: ";", but found "-identifier-"
C:\Users\Mor\Desktop\CGRP v1.0\CGRP v1.0\gamemodes\CGRP.pwn(31121) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


4 Errors.

line 31121:

Quote:

format(string, sizeof(string), " "0x00FFD0AA"OOC chat channel enabled by an Admin! - "FFFF00"Do "FF0000"NOT "FFFF00"abuse OOC chat with "0099FF"Spamming, "F200FF"Insulting, "8400FF"Cursing, "FFFF00"You will get punishment for that.");

Doreto your pawn code makes it with numbers and letters and in color white
Namer your pawn code makes errors, how can i fix them?
Reply
#5

pawn Код:
CMD:noooc(playerid, params[])
{
    if(PlayerInfo[playerid][pAdmin] >= 2)
    {
        if (!noooc)
        {
            noooc = 1;
            BroadCast(COLOR_GREEN, "   OOC chat channel disabled by an Admin!");
        }
        else
        {
        noooc = 0;
        new string[ 128 ];
        format(string, sizeof(string), "   {00FFD0}OOC chat channel enabled by an Admin! - {FFFF00}Do {FF0000}NOT {FFFF00}abuse OOC chat with {0099FF}Spamming, {F200FF}Insulting, (8400FF)Cursing, {FFFF00}You will get punishment for that.");
        ABroadCast(COLOR_YELLOW, string, 128 );
        }
    }
    else
    {
        SendClientMessageEx(playerid, COLOR_GRAD1, "You are not authorized to use that command!");
    }
    return 1;
}
Reply
#6

Embed your colors in the following format:
pawn Код:
format(string, sizeof(string), "   {00FFD0}OOC chat channel enabled by an Admin! - {FFFF00}Do {FF0000}NOT {FFFF00}abuse OOC chat with {0099FF}Spamming, {F200FF}Insulting, {8400FF}Cursing, {FFFF00}You will get punishment for that.");
Reply
#7

Areax now after your code i got it:



how to fix the continue of the sentence?

Quote:

CMD:noooc(playerid, params[])
{
if(PlayerInfo[playerid][pAdmin] >= 2)
{
if (!noooc)
{
noooc = 1;
BroadCast(COLOR_GREEN, " OOC chat channel disabled by an Admin!");
}
else
{
noooc = 0;
new string[ 128 ];
format(string, sizeof(string), " {00FFD0}OOC chat channel enabled by an Admin! - {FFFF00}Do {FF0000}NOT {FFFF00}abuse OOC chat with {0099FF}Spamming, {F200FF}Insulting, (8400FF)Cursing, {FFFF00}You will get punishment for that.");
ABroadCast(COLOR_YELLOW, string, 128 );
}
}
else
{
SendClientMessageEx(playerid, COLOR_GRAD1, "You are not authorized to use that command!");
}
return 1;
}

Reply
#8

pawn Код:
CMD:noooc(playerid, params[])
{
if(PlayerInfo[playerid][pAdmin] >= 2)
{
if (!noooc)
{
noooc = 1;
BroadCast(COLOR_GREEN, " OOC chat channel disabled by an Admin!");
}
else
{
noooc = 0;
new string[ 180 ];
format(string, sizeof(string), " {00FFD0}OOC chat channel enabled by an Admin! - {FFFF00}Do {FF0000}NOT {FFFF00}abuse OOC chat with {0099FF}Spamming, {F200FF}Insulting, (8400FF)Cursing, {FFFF00}You will get punishment for that.");
ABroadCast(COLOR_YELLOW, string, 180 );
}
}
else
{
SendClientMessageEx(playerid, COLOR_GRAD1, "You are not authorized to use that command!");
}
return 1;
}
Reply
#9

Now after OOC disabled and again i try to enable nothing show up /:

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)