SA-MP Forums Archive
recreate a function - 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: recreate a function (/showthread.php?tid=250441)



recreate a function - legodude - 23.04.2011

i want to make print so that it does SendClientMessageToAll too.

it MUST be a stock function, as imho they generate better errors if used wrong.

i would like it to do:
pawn Код:
print(string[]){
SendClientMessageToAll(0xffffff,string);
print(string);
}



Re: recreate a function - [ADC]Aldi96 - 23.04.2011

SendClientMessageToAll(0xffffff, " message here");

I think if is work ok------- if is doesnt work.. contact with scripters !!!!!!!


Re: recreate a function - legodude - 23.04.2011

lol, i want it to be in one function, not adding a extra line..


Re: recreate a function - Ash. - 23.04.2011

Do you want the actual function to be called, "print"?


Re: recreate a function - legodude - 23.04.2011

if can, yes.


Re: recreate a function - xRyder - 23.04.2011

Quote:
Originally Posted by [ADC]Aldi96
Посмотреть сообщение
SendClientMessageToAll(0xffffff, " message here");

I think if is work ok------- if is doesnt work.. contact with scripters !!!!!!!
^Oh, God...

Anyways, I'm not really sure what you want but here.
pawn Код:
stock _print(string[])
{
    SendClientMessageToAll(0xffffff,string);
    print(string);
}
I think you can't call it "print".


Re: recreate a function - Ash. - 23.04.2011

It would be possible with hooking, take a look at ******'s hooking library (yes, he made one)

I could create the function, but i would have to rename it, as i have never touched hooking before (As my gamemode just forwards everything to other scripts, and so if i include something, i just forward it from the original callback)


Quote:
Originally Posted by xRyder
Посмотреть сообщение
I think you can't call it "print".
You can, you need to hook the original


Re: recreate a function - legodude - 23.04.2011

the hooking library is for callbacks only i think (as from what i read..)


Re: recreate a function - Vince - 23.04.2011

How about:

pawn Код:
#define print( _print(



Re: recreate a function - legodude - 23.04.2011

do i need to include _ too when i call the function?