SA-MP Forums Archive
Abit of help. - 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: Abit of help. (/showthread.php?tid=382250)



Abit of help. - Dizzle - 02.10.2012

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!


Re: Abit of help. - Gangster-rocks - 02.10.2012

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;
}



Re: Abit of help. - Dizzle - 02.10.2012

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.



Re: Abit of help. - Danyal - 02.10.2012

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...