SA-MP Forums Archive
[Tutorial] [TUTORIAL] How to fix the bug in the function SendChat and SendCommand - 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: Tutorials (https://sampforum.blast.hk/forumdisplay.php?fid=70)
+---- Thread: [Tutorial] [TUTORIAL] How to fix the bug in the function SendChat and SendCommand (/showthread.php?tid=425019)



[TUTORIAL] How to fix the bug in the function SendChat and SendCommand - Ergastolo - 24.03.2013

Hi,
Today I'll explain how fixare bugs SendChat and SendCommand.
First you need to change the include "a_npc"
Find "native SendChat" and "native SendCommand" and delete them.
Add to your gamemode or include this code:
Код:
stock SendChat(color,name[],message[])
{
    new msg[657];
    format(msg, sizeof(msg),"%s: {"#BIANCO2"}%s",name,message);
    SendClientMessageToAll(color,msg);
    return true;
}
And
Код:
stock SendCommand(command[])
{
    for(new i=0; i<MAX_PLAYERS; i++)
    CallRemoteFunction("OnPlayerCommandText", "is", i, command);
    return true;
}
To use these functions you have to do it this way
SendChat:
Код:
SendChat(COLOR,NAME,MESSAGE);
SendCommand:
Код:
SendCommand(/COMMAND);



Re: [TUTORIAL] How to fix the bug in the function SendChat and SendCommand - Misiur - 24.03.2013

Oh man.
1. Fiddling with a_samp.inc isn't a good idea
2. There aren't SendChat and SendCommand in 0.3x includes


Re: [TUTORIAL] How to fix the bug in the function SendChat and SendCommand - Ergastolo - 24.03.2013

I'm sorry,
I did not know that in samp 0.3x this function had been eliminated


Re: [TUTORIAL] How to fix the bug in the function SendChat and SendCommand - Misiur - 24.03.2013

Mea culpa, those functions are present - but they are in a_npc.inc


Re: [TUTORIAL] How to fix the bug in the function SendChat and SendCommand - Ergastolo - 24.03.2013

However, is identical as in the new version of these functions are bugged


Re: [TUTORIAL] How to fix the bug in the function SendChat and SendCommand - Kirollos - 03.05.2013

its not bugged. its used for NPCs to send commands o.o