SA-MP Forums Archive
Help, Message is not being sent. - 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, Message is not being sent. (/showthread.php?tid=596390)



Help, Message is not being sent. - Ritzy2K - 17.12.2015

Код:
public OnPlayerDeath(playerid, killerid, reason)
{
    SendDeathMessage(killerid, playerid, reason);
    
	if (killerid != INVALID_PLAYER_ID)
	{
		Log_Write("logs/kill_log.txt", "[%s] %s has killed %s (%s).", ReturnDate(), ReturnName(killerid), ReturnName(playerid), DeathReason[reason]);
		SendClientMessageToAllEx(-1, "{FF0000}%s Died. Killed By  %s (%s).", ReturnName(playerid), ReturnName(killerid), DeathReason[reason]);
	}
	else
	{
		Log_Write("logs/kill_log.txt", "[%s] %s has killed %s (reason %d).", ReturnDate(), ReturnName(killerid), ReturnName(playerid), DeathReason[reason]);
		SendClientMessageToAllEx(-1, "{FF0000}%s Died (%s).", ReturnName(playerid), DeathReason[reason]);
	}
	return 1;
}
Well, the "SendClientMessageToAllEx" message isn't sent in the chat, i dont know why. everything else works good. Even the SendClientMessageToAllEx works okay on other places.

Well, this stock is by emmet_, ill post the code.
Код:
stock SendClientMessageToAllEx(color, const text[], {Float, _}:...)
{
	static
	    args,
	    str[144];

	/*
     *  Custom function that uses #emit to format variables into a string.
     *  This code is very fragile; touching any code here will cause crashing!
	*/
	if ((args = numargs()) == 2)
	{
	    SendClientMessageToAll(color, text);
	}
	else
	{
		while (--args >= 2)
		{
			#emit LCTRL 5
			#emit LOAD.alt args
			#emit SHL.C.alt 2
			#emit ADD.C 12
			#emit ADD
			#emit LOAD.I
			#emit PUSH.pri
		}
		#emit PUSH.S text
		#emit PUSH.C 144
		#emit PUSH.C str
		#emit LOAD.S.pri 8
		#emit ADD.C 4
		#emit PUSH.pri
		#emit SYSREQ.C format
		#emit LCTRL 5
		#emit SCTRL 4

		SendClientMessageToAll(color, str);

		#emit RETN
	}
	return 1;
}
Help


Re: Help, Message is not being sent. - Ritzy2K - 21.12.2015

Bump ._.


Re: Help, Message is not being sent. - jamesbond007 - 21.12.2015

why are u using a function with emit.. what is emmet doing ..
cant u do the same with normal code?

maybe u have errors in log_write, do u have the file kill_log.txt inside logs folder in scriptfiles? just run the plugin crashdetector and it should show any errors


Re: Help, Message is not being sent. - Ritzy2K - 23.12.2015

Crashdetect isn't showing any error, I got all the log (.txt) files required. I don't know why it doesnt still send the message, any help?


Re: Help, Message is not being sent. - Ritzy2K - 24.12.2015

Help :c