Help, Message is not being sent.
#1

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

Bump ._.
Reply
#3

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
Reply
#4

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?
Reply
#5

Help :c
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)