CallRemoteFunction
#1

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.
Reply
#2

Just use a Timer to set when the next TD shows.
Reply
#3

I edit the Servercfg and added the filterscript then after it loaded the textdraw it just closed in a second.
Reply
#4

Quote:
Originally Posted by bennyisme
View Post
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() }
Reply
#5

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.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)