Need help this wont work
#1

So idk what it is but when i type my command the motds part wont work not sure it just does nothing when i type it.

Код:
if(strcmp(option1, "motds", true, 5) == 0)
    {
        if(sscanf(params, "s[32]s[32]", option1, option2))
        {
            SendClientMessage(playerid, COLOR_WHITE, "** [Usage]: /update motds [option]");
            SendClientMessage(playerid, COLOR_GREY, "OPTIONS: motd1, motd2, motd3");
            return 1;
        }
        if(strcmp(option2, "motd1", true, 5) == 0)
        {
            if(sscanf(params, "s[32]s[32]s[100]", option1, option2, params))
            {
                SendClientMessage(playerid, COLOR_WHITE, "** [Usage]: /update motds motd1 [text]");
                return 1;
            }
	        format(ServerMOTD1, sizeof(ServerMOTD1), "%s", params);
	        format(string, sizeof(string), "AdmCmd: [motd1]%s has changed the message of the day to %s.", RPN(playerid), params);
	        SendClientMessageToAll(COLOR_LIGHTRED, string);
	        format(string, sizeof(string), "%s", params);
	     	TextDrawSetString(MainMenuTxtdraw[6], string);
            return 1;
        }
        if(strcmp(option2, "motd2", true, 5) == 0)
        {
            if(sscanf(params, "s[32]s[32]i", option1, option2, line))
            {
                SendClientMessage(playerid, COLOR_WHITE, "** [Usage]: /update motds motd2 [text]");
                return 1;
            }
	        format(ServerMOTD2, sizeof(ServerMOTD2), "%s", params);
	        format(string, sizeof(string), "AdmCmd: [motd2]%s has changed the message of the day to %s.", RPN(playerid), params);
	        SendClientMessageToAll(COLOR_LIGHTRED, string);
	        format(string, sizeof(string), "%s", params);
	     	TextDrawSetString(MainMenuTxtdraw[7], string);
            return 1;
        }
        if(strcmp(option2, "motd3", true, 5) == 0)
        {
            if(sscanf(params, "s[32]s[32]i", option1, option2, line))
            {
                SendClientMessage(playerid, COLOR_WHITE, "** [Usage]: /update motds motd3 [text]");
                return 1;
            }
	        format(ServerMOTD3, sizeof(ServerMOTD3), "%s", params);
	        format(string, sizeof(string), "AdmCmd: [motd3]%s has changed the message of the day to %s.", RPN(playerid), params);
	        SendClientMessageToAll(COLOR_LIGHTRED, string);
	        format(string, sizeof(string), "%s", params);
	     	TextDrawSetString(MainMenuTxtdraw[8], string);
            return 1;
        }
Reply
#2

bump
Reply
#3

bump!
Reply
#4

BUMP please help me i really need help!
Reply
#5

Try string length 6 in your strcmp function for NULL, I can count 5 cells, 5 + NULL = 6
Reply
#6

Nope any other ideas?
Reply
#7

bump
Reply
#8

please help me ffs!
Reply
#9

Код:
if(strcmp(option2, "motd1", true) == 0)

if(strcmp(option2, "motd2", true) == 0)

if(strcmp(option2, "motd3", true) == 0)
try that instaead of what you have
Reply
#10

sorta fixed, now only motd1 works, not motd2 and motd3
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)