24.04.2013, 04:33
You missed szPlayerName while showing the main message. Maybe its cause of that. Try this one.
pawn Код:
CMD:p(playerid, params[]) {
new giveSz[32], param[128], param1[128], param2[128], param3[128], playerName[2][MAX_PLAYER_NAME], string[128];
if(sscanf(params,"s[32]S()[128]S()[128]S()[128]S()[128]", giveSz, param, param1, param2, param3)) {
SendClientMessage(playerid, COLOR_GREY, SYNTAX_MESSAGE"/p [Option]");
SendClientMessage(playerid, COLOR_GREY, "Options: m");
return 1;
}
if(strcmp(giveSz, "m", true) == 0) {
if(isnull(param)) return SendClientMessage(playerid, COLOR_GREY, SYNTAX_MESSAGE"/p m [Message]");
GetPlayerName(playerid, szPlayerName, MAX_PLAYER_NAME);
format(string, sizeof(string), "(Megaphone) %s says: %s",szPlayerName , param);
nearByMessage(playerid, COLOR_HOTORANGE, string, 50.0);
}
return 1;
}