PDA

View Full Version : Abit of help.


Dizzle
02/10/2012, 05:09 PM
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,CO LOR_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,CO LOR_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 (c) 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!

Gangster-rocks
02/10/2012, 05:12 PM
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,CO LOR_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,CO LOR_FADE2);
return 1;
}

Dizzle
02/10/2012, 05:14 PM
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 (c) 1997-2006, ITB CompuPhase


2 Errors.

Danyal
02/10/2012, 05:54 PM
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,CO LOR_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,CO LOR_FADE2);
}
return 1;
}


try this...