CallRemoteFunction
#1

Hello! I got SendMessageToAdmins function

Код:
stock SendMessageToAdmins(COLOR,text[])
{
    for(new i = 0; i < MAX_PLAYERS; i++)
	{
		if (IsPlayerConnected(i) && PlayerInfo[i][Admin] >= 1)
		{
			SendClientMessage(i,COLOR,text);
		}
	}
	return 1;
}
Can anyone help me CallRemoteFunction for it? I tried with
Код:
CallRemoteFunction("SendMessageToAdmins", "ss", 0xF97804FF, msg);
but it is not working? Can you help please?

Thanks.
Reply
#2

You can only use CallRemoteFunction in external scripts, and the function must be a public and forwarded, you can't use a stock for that.
Reply
#3

The function has to be public, not stock.
Reply
#4

Should I use than?

Код:
forward SendMessageToAdmins(COLOR,text[]);
public SendMessageToAdmins(COLOR,text[])
{
    for(new i = 0; i < MAX_PLAYERS; i++)
	{
		if (IsPlayerConnected(i) && PlayerInfo[i][Admin] >= 1)
		{
			SendClientMessage(i,COLOR,text);
		}
	}
	return 1;
}
Reply
#5

Quote:
Originally Posted by Ironboy500[TW]
Посмотреть сообщение
Should I use than?

Код:
forward SendMessageToAdmins(COLOR,text[]);
public SendMessageToAdmins(COLOR,text[])
{
    for(new i = 0; i < MAX_PLAYERS; i++)
	{
		if (IsPlayerConnected(i) && PlayerInfo[i][Admin] >= 1)
		{
			SendClientMessage(i,COLOR,text);
		}
	}
	return 1;
}
Yes, that should work.
Reply
#6

Thank you.
Reply
#7

If you get an incorrect color, try using "ds" or "xs" in CallRemoteFunction
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)