[Help]CallLocal/RemoteFunction -
yezizhu - 07.06.2009
Well,not very bad,but I need ur help.
How to pass null string by CallLocal/RemoteFunction?
pawn Код:
#include <a_samp>
main(){}
public OnGameModeInit(){
print "test1"
CallLocalFunction("test","s","");
print "test2"
return true;
}
forward test(str[]);
public test(str[]){
if(str[0]) print "not null string"
else(str[0]) print "null string"
}
It'll crash my server.
I puzzled a day long,someone able to help me?
Thx.
Re: [Help]CallLocal/RemoteFunction -
yom - 07.06.2009
No -proper- solution for this, but in what case you will pass an empty string to it?
Re: [Help]CallLocal/RemoteFunction -
[CK]Steel - 07.06.2009
Quote:
Originally Posted by 0rb
No -proper- solution for this, but in what case you will pass an empty string to it?
|
Mhm, There's actually a proper solution because he just messed up the script........... If he knew how to organize it, then yeah the solution will be fixed. I put that in my script i had like 1 million errors, then I tried to fix it for 5 minutes and I had 3 or 2 errors :S I'm going to try to fix it so I can post it.... Brb
Re: [Help]CallLocal/RemoteFunction -
yezizhu - 07.06.2009
Reply for Orb:
something like:
pawn Код:
forward command(playerid,params[]);
public command(playerid,params[]){
if(!params[0])return SendClientMessage(playerid,COLOR_SYSTEM,"no param.");
else blablablablah..
return true;
}
Reply for [CK]Steel:
Waitting for you solution,Don't make me dispointted.
PS:I've looked many code,but find no solution.
Re: [Help]CallLocal/RemoteFunction -
lavamike - 07.06.2009
I used to do this i will see if I can find it in my script hold on..
EDIT: Nevermind, mine was calling something without transferring any variables at all.
Re: [Help]CallLocal/RemoteFunction -
yezizhu - 07.06.2009
Reply for Lavamike
Thx for ur help.
Re: [Help]CallLocal/RemoteFunction -
yom - 07.06.2009
The only solution i can think of now, is to do something like that:
pawn Код:
#include <a_samp>
main(){}
public OnGameModeInit()
{
print("test1");
new bla[] = ""; // = "blabla";
if (bla[0])
CallRemoteFunction("test", "s", bla);
else
CallRemoteFunction("test", "s", "<NULL>");
print ("test2");
return true;
}
forward test(str[]);
public test(str[])
{
if (!strcmp(str, "<NULL>"))
print("null string");
else
print("not null string");
}
But i think you already knew that.
Re: [Help]CallLocal/RemoteFunction -
yezizhu - 07.06.2009
Reply for Orb:
Hehe,if my code is only used by me, I'll do what you do.
But it'll be used for other user,and they're almost used useing !param[0].
Anyway,thx for ur help.
Re: [Help]CallLocal/RemoteFunction -
yezizhu - 07.06.2009
Now,any help?