sscanf problem
#2

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


Messages In This Thread
sscanf problem - by Amator - 24.04.2013, 00:58
Re: sscanf problem - by Ballu Miaa - 24.04.2013, 04:33
Re: sscanf problem - by Unte99 - 24.04.2013, 05:01
Re: sscanf problem - by Ballu Miaa - 24.04.2013, 09:56
Re : Re: sscanf problem - by Amator - 24.04.2013, 10:12
Re: sscanf problem - by Ballu Miaa - 24.04.2013, 11:26
Re : sscanf problem - by Amator - 24.04.2013, 13:55
Re : sscanf problem - by Amator - 27.04.2013, 13:18
Re: sscanf problem - by Chenko - 27.04.2013, 15:49

Forum Jump:


Users browsing this thread: 1 Guest(s)