NPC bot spam chat OnPlayerText
#1

if (strfind(text, "sveiki") != -1)
{
new string[80], name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
format(string, sizeof(string), "Sveikas %s! Jeigu reikia pagalbos kreipkis б adminus arba /help", name);
SendChat(string);
}

This is code. When i go to server and write "sveiki" Bot is spam 4 messages:First him message is With name another without)
Reply
#2

So none can't help ?
Reply
#3

Try this.
pawn Код:
if (strfind(text, "sveiki") != -1)
{
    new string[80], name[MAX_PLAYER_NAME];
    GetPlayerName(playerid, name, sizeof(name));
    format(string, sizeof(string), "Sveikas %s! Jeigu reikia pagalbos kreipkis б adminus arba /help", name);
    SendClientMessage(desired color here, string);
}
Reply
#4

Now i have error
pawn Код:
error 017: undefined symbol "SendClientMessage"
Reply
#5

Did you add a defined color to the line or not?
Reply
#6

Quote:
Originally Posted by Dawnz
Посмотреть сообщение
Did you add a defined color to the line or not?
Yes.
pawn Код:
0xffff66
Reply
#7

Did you include a_samp?
pawn Код:
//on top your script
#include <a_samp>
Reply
#8

Deleted
Reply
#9

You still need a_samp for sendclientmessage, so if you don't have that, add it.
Reply
#10

Quote:
Originally Posted by [EnErGyS]KING
Посмотреть сообщение
not filescript -_-
FAIL -_-"
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)