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=170717)
CallRemoteFunction -
bennyisme - 24.08.2010
Code:
#define FILTERSCRIPT
#include <a_samp>
new Text:Textdraw0;
forward Credit(playerid,const string[]);
main()
{
print("\n----------------------------------");
print(" Blank Gamemode by your name here");
print("----------------------------------\n");
}
public OnFilterScriptInit()
{
Textdraw0 = TextDrawCreate(126.000000, 160.000000, "");
TextDrawAlignment(Textdraw0, 2);
TextDrawBackgroundColor(Textdraw0, 255);
TextDrawFont(Textdraw0, 1);
TextDrawLetterSize(Textdraw0, 0.500000, 1.799999);
TextDrawColor(Textdraw0, -1);
TextDrawSetOutline(Textdraw0, 0);
TextDrawSetProportional(Textdraw0, 1);
TextDrawSetShadow(Textdraw0, 1);
return 1;
}
public OnFilterScriptExit()
{
return 1;
}
public Credit(playerid,const string[])
{
new str[128];
format(str, 128, "%s", string);
TextDrawSetString(Textdraw0, str);
TextDrawShowForPlayer(playerid, Textdraw0);
}
that is my filterscript
this is the callremotefunction
Code:
CallRemoteFunction("Credit", "iisi", playerid, -1, "Credits Go To XXX", 4000);
CallRemoteFunction("Credit", "iisi", playerid, -1, "Credits Go To XXX", 14000);
how can i make it so 4000 is the amount of time it shows then it will hide the textdraw then the next one show.
Re: CallRemoteFunction -
willsuckformoney - 24.08.2010
Just use a Timer to set when the next TD shows.
Re: CallRemoteFunction -
bennyisme - 24.08.2010
I edit the Servercfg and added the filterscript then after it loaded the textdraw it just closed in a second.
Re: CallRemoteFunction -
dax123 - 24.08.2010
Quote:
Originally Posted by bennyisme
I edit the Servercfg and added the filterscript then after it loaded the textdraw it just closed in a second.
|
the number of arguments does not match definition.
reference:
pawn Code:
public Credit(playerid,const string[])
your usage:
pawn Code:
CallRemoteFunction("Credit", "iisi", playerid, -1, "Credits Go To XXX", 4000);
which means:
pawn Code:
Credit( playerid, -1, "Credits Go To XXX", 4000 );
you passed an integer to a string argument, the server is likely to crash in a time.
so here is my suggestion:
pawn Code:
new str[32];
format( str, sizeof(str), "Credits Go To %d", 4000 ); //4000 or anything you want to be separated by if ()
CallRemoteFunction( "Credit", "is", playerid, str ); //passes an integer, and then a string. it matches your definition.
in Addition,
CallRemoteFunction() calls the function that doesn't exist in your script whereas
CallLocalFunction() only finds the function in your script { like
SetTimerEx() }
Re: CallRemoteFunction -
bennyisme - 30.08.2010
Umm i don't get it. But for the credit box. How i can i make it change to the message i want. like an info box.