Abit of help.
#1

I need some help for /shout (example), when a player have mask on his face, when he shouts it will show "Stranger shouts: *text*" and when he remove his mask it will show for example "Dizzle shouts: *text*"

Here is my command:

Код:
CMD:shout(playerid, params[])
{
	new string[128], textm[128];
	if(sscanf(params, "s[128]", params)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /shout [text]");
	if(AntiAdv(playerid, params)) return 1;
    format(string, sizeof(string), "%s shouts: %s!", NAMEGET(playerid), params);
	NearMessageSender(playerid, 22, string, COLOR_FADE2,COLOR_FADE2,COLOR_FADE2,COLOR_FADE2,COLOR_FADE2);
	else
	if(IsMasked[playerid] == true)
	format(textm, sizeof(textm), "Stranger shouts: %s!", params);
	NearMessageSender(playerid, 22, string, COLOR_FADE2,COLOR_FADE2,COLOR_FADE2,COLOR_FADE2,COLOR_FADE2);
	return 1;
}
I've tried to compiled it but it shows me these errors:


Код:
D:\games\Rockstar Games\GTA San Andreas\server\filterscripts\chatcmds.pwn(73) : error 029: invalid expression, assumed zero
D:\games\Rockstar Games\GTA San Andreas\server\filterscripts\chatcmds.pwn(73 -- 74) : warning 215: expression has no effect
D:\games\Rockstar Games\GTA San Andreas\server\filterscripts\chatcmds.pwn(74) : error 001: expected token: ";", but found "if"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


2 Errors.
I think I forgot to put brackets somewhere or something else.. not sure, anyways - I would be happy if someone fixes it.

Thanks in advance!
Reply
#2

pawn Код:
CMD:shout(playerid, params[])
{
    new string[128], textm[128];
    if(sscanf(params, "s[128]", params)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /shout [text]");
    if(AntiAdv(playerid, params)) return 1;
    format(string, sizeof(string), "%s shouts: %s!", NAMEGET(playerid), params);
    NearMessageSender(playerid, 22, string, COLOR_FADE2,COLOR_FADE2,COLOR_FADE2,COLOR_FADE2,COLOR_FADE2);
    else if(IsMasked[playerid] == true)
    format(textm, sizeof(textm), "Stranger shouts: %s!", params);
    NearMessageSender(playerid, 22, string, COLOR_FADE2,COLOR_FADE2,COLOR_FADE2,COLOR_FADE2,COLOR_FADE2);
    return 1;
}
Reply
#3

Mm nope, I've tried this several times.. still the same

Код:
D:\games\Rockstar Games\GTA San Andreas\server\filterscripts\chatcmds.pwn(52) : error 029: invalid expression, assumed zero
D:\games\Rockstar Games\GTA San Andreas\server\filterscripts\chatcmds.pwn(52) : warning 215: expression has no effect
D:\games\Rockstar Games\GTA San Andreas\server\filterscripts\chatcmds.pwn(52) : error 001: expected token: ";", but found "if"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


2 Errors.
Reply
#4

pawn Код:
CMD:shout(playerid, params[])
{
    new string[128], textm[128];
    if(sscanf(params, "s[128]", params)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /shout [text]");
    if(!AntiAdv(playerid, params))
    {
        format(string, sizeof(string), "%s shouts: %s!", NAMEGET(playerid), params);
        NearMessageSender(playerid, 22, string, COLOR_FADE2,COLOR_FADE2,COLOR_FADE2,COLOR_FADE2,COLOR_FADE2);      
    }
    else if(IsMasked[playerid] == 1)
    {
        format(textm, sizeof(textm), "Stranger shouts: %s!", params);
        NearMessageSender(playerid, 22, string, COLOR_FADE2,COLOR_FADE2,COLOR_FADE2,COLOR_FADE2,COLOR_FADE2);
    }
    return 1;
}
try this...
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)