SA-MP Forums Archive
Need help this wont work - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Need help this wont work (/showthread.php?tid=489313)



Need help this wont work - JacobSanchez - 21.01.2014

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



Re: Need help this wont work - JacobSanchez - 21.01.2014

bump


Re: Need help this wont work - JacobSanchez - 25.01.2014

bump!


Re: Need help this wont work - JacobSanchez - 26.01.2014

BUMP please help me i really need help!


Re: Need help this wont work - Weponz - 26.01.2014

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


Re: Need help this wont work - JacobSanchez - 26.01.2014

Nope any other ideas?


Re: Need help this wont work - JacobSanchez - 26.01.2014

bump


Re: Need help this wont work - JacobSanchez - 28.01.2014

please help me ffs!


Re: Need help this wont work - Shockey HD - 28.01.2014

Код:
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


Re: Need help this wont work - JacobSanchez - 28.01.2014

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