SA-MP Forums Archive
Server crash when type commands [mAdmin] - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Server crash when type commands [mAdmin] (/showthread.php?tid=151383)



Server crash when type commands [mAdmin] - Flashy - 30.05.2010

Hello

I have a little question/problem. I use mAdmin and when I go in game as an Admin and type /reloadfs it works fine. Next to that I type /gmx. Fine here too.
But when I type now /announce or /announce2 and the message it crash the server.

What to do? Say when you need more infomration.
I would be grateful if someone can help.

Код:
dcmd_announce(playerid, params[])
{
	new pName[24], str[128];
	if(PlayerInfo[playerid][AdminLevel] < 1) return false;
	GetPlayerName(playerid, pName, sizeof(pName));
	if(!strlen(params)) return SendClientMessage(playerid, COLOR_WHITE, "Usage: /announce [message]");
	
	SendClientMessageToAll(COLOR_BRIGHTRED, "-------------------------");
	SendClientMessageToAll(COLOR_YELLOW, params);
	SendClientMessageToAll(COLOR_BRIGHTRED, "-------------------------");
  format(str, sizeof(str), "Mod Message: %s (ID: %d) has announced: '%s'.", pName, playerid);
  SendModMsg(COLOR_WHITE, str);
  return 1;
}

dcmd_announce2(playerid, params[])
{
	new pName[24], str[128];
	if(PlayerInfo[playerid][AdminLevel] < 1) return false;
	GetPlayerName(playerid, pName, sizeof(pName));
	if(!strlen(params)) return SendClientMessage(playerid, COLOR_WHITE, "Usage: /announce2 [message]");

	GameTextForAll(params, 3000, 6);
  format(str, sizeof(str), "Mod Message: %s (ID: %d) has announced: '%s'.", pName, playerid);
  SendModMsg(COLOR_WHITE, str);
  return 1;
}



Re: Server crash when type commands [mAdmin] - oNx - 30.05.2010

SendModMsg(COLOR_WHITE, str);
check that out?

why not just use sendclientmessagetoall instead?


Re: Server crash when type commands [mAdmin] - Flashy - 30.05.2010

Cause no one want to know which admin use announce.
And it prevent to spam the chat.

I check that with SendModMsg..

[EDIT]

Well, I just delete >SendModMsg< and put >SendAdminMsg< there. In this way it works.
Thanks for help..I could make it without creating a topic but you know, sometimes the answers is infront of you and you donґt see it xD


Re: Server crash when type commands [mAdmin] - w00tNew - 30.05.2010

use
Код:
sendclientmessage(playerid); ??



Re: Server crash when type commands [mAdmin] - Flashy - 30.05.2010

Nvm. Problem solved