SA-MP Forums Archive
Help! - 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: Help! (/showthread.php?tid=368581)



Help! - San1 - 13.08.2012

Well i am trying to make this command to send messages to players but i want it to show the msg that i type in and i wanna be sure this is correct i dont think it is
So please fix it if it is wrong or please tell me what to do

Код:
CMD:automsg(playerid, params[])
{
	new Msg[80];
	if(sscanf(params, "c[80]",Msg))
	{
    	return SendClientMessage(playerid, 0xFF0000AA, "Usage: /automsg [msg]");
	}
        format(Msg, sizeof(Msg), "{08FF8C}XR-RP:[BOT]{FF8000}.",Msg);
	SendClientMessageToAll(playerid,COLOR_ORANGE,Msg);
	return 1;
}



Re: Help! - lamarr007 - 13.08.2012

pawn Код:
CMD:automsg(playerid, params[])
{
new Msg[80];
if(sscanf(params, "s[80]",Msg)) return SendClientMessage(playerid, 0xFF0000AA, "Usage: /automsg <text>");
format(Msg, sizeof(Msg), "{08FF8C}XR-RP:[BOT]{FF8000} %s."
SendClientMessageToAll(COLOR_ORANGE,Msg);
return 1;
}



Re: Help! - Roko_foko - 13.08.2012

Quote:

format(Msg, sizeof(Msg), "{08FF8C}XR-RP:[BOT]{FF8000}.",Msg);

You sure there is no %s inside?


Re: Help! - Joe2009 - 13.08.2012

I think it shoult!


Re : Help! - Sandiel - 14.08.2012

pawn Код:
CMD:automsg(playerid, params[])
{
    if(!isnull(params))
    {
        new str[128];
        format(str, sizeof(str), "{08FF8C}XR-RP:[BOT]{FF8000} %s.", params);
        SendClientMessageToAll(COLOR_ORANGE, str);
    }
    return 1;
}