CallRemoteFunction - 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: CallRemoteFunction (
/showthread.php?tid=159850)
CallRemoteFunction -
Ironboy500[TW] - 14.07.2010
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.
Re: CallRemoteFunction -
Calgon - 14.07.2010
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.
Re: CallRemoteFunction -
Correlli - 14.07.2010
The function has to be public, not stock.
Re: CallRemoteFunction -
Ironboy500[TW] - 14.07.2010
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;
}
Re: CallRemoteFunction -
Calgon - 14.07.2010
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.
Re: CallRemoteFunction -
Ironboy500[TW] - 14.07.2010
Thank you.
Re: CallRemoteFunction -
dice7 - 14.07.2010
If you get an incorrect color, try using "ds" or "xs" in CallRemoteFunction