[Tutorial] [TUTORIAL] How to fix the bug in the function SendChat and SendCommand
#1

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);
Reply
#2

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

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

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

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

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


Forum Jump:


Users browsing this thread: 1 Guest(s)