Script.pwn(488) : error 028: invalid subscript (not an array or too many subscripts): "NameOfPlayer"
Script.pwn(488) : warning 215: expression has no effect
Script.pwn(488) : error 001: expected token: ";", but found "]"
Script.pwn(488) : error 029: invalid expression, assumed zero
Script.pwn(488) : fatal error 107: too many error messages on one line
CMD:newbie(playerid, params[])
{
if(Player[playerid][NMute] == 1) return SendErrorMessage(playerid, "You are unable to use /(n)ewbie, reason: muted");
new text[255], string[255];
if(sscanf(params, "s[255]", text)) return SendErrorMessage(playerid, "/(n)ewbie [text]");
for(new p = 0; p < MAX_PLAYERS; p++)
{
if(Player[p][NToggled] != 1 && Player[p][NMute] != 1)
{
format(string, sizeof(string), "%s", NameOfPlayer[playerid]);
SendClientMessage(p, Colour_Newbie_Chat, string);
}
}
return 1;
}
format(string, sizeof(string), "%s", NameOfPlayer[playerid]);
Steve |
CMD:newbie(playerid, params[])
{
if(Player[playerid][NMute] == 1) return SendErrorMessage(playerid, "You are unable to use /(n)ewbie, reason: muted");
new text[200], string[250];
if(sscanf(params, "s[200]", text)) return SendErrorMessage(playeid, "/(n)ewbie [text]");
for(new i = 0; i < MAX_PLAYERS; i ++)
{
if(IsPlayerConnected(i))
{
if(Player[p][NToggled] != 1 && Player[p][NMute] != 1)
{
format(string, sizeof(string), "Newbie chat: %s: %s", NameOfPlayer[playerid], text); // make sure that your stock for NameOfPlayer has square brackets,
SendClientMessage(i, Colour_Newbie_Chat, string);
}
}
return 1;
}
return 1;
}
In your code, all you're sending is just the NameOfPlayer, so all it will say is:
And that's it, it won't say the text. I fixed that below. pawn Код:
|
stock NameOfPlayer(id)
{
new pName[MAX_PLAYER_NAME];
GetPlayerName(id, pName, sizeof(pName));
for(new i = 0; i < MAX_PLAYER_NAME; i++)
{
if(pName[i] == '_') pName[i] = ' ';
}
return pName;
}
format(string, sizeof(string), "Newbie chat: %s: %s", NameOfPlayer[playerid], text);
format(string, sizeof(string), "Newbie chat: %s: %s", NameOfPlayer(playerid), text);
This forum requires that you wait 240 seconds between posts. Please try again in 136 seconds.
Now thanks, I've seen your problem
pawn Код:
pawn Код:
Код:
This forum requires that you wait 240 seconds between posts. Please try again in 136 seconds. |