SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 09/08/2012, 04:32 PM   #1
[EnErGyS]KING
Big Clucker
 
[EnErGyS]KING's Avatar
 
Join Date: Jun 2009
Location: Lithuanian.
Posts: 136
Reputation: 9
Default NPC bot spam chat OnPlayerText

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)
[EnErGyS]KING is offline   Reply With Quote
Old 10/08/2012, 08:34 AM   #2
[EnErGyS]KING
Big Clucker
 
[EnErGyS]KING's Avatar
 
Join Date: Jun 2009
Location: Lithuanian.
Posts: 136
Reputation: 9
Default Re: NPC bot spam chat OnPlayerText

So none can't help ?
[EnErGyS]KING is offline   Reply With Quote
Old 10/08/2012, 08:44 AM   #3
Dawnz
Big Clucker
 
Join Date: Jun 2012
Location: Los Angeles, CA
Posts: 65
Reputation: 13
Default Re: NPC bot spam chat OnPlayerText

Try this.
pawn Code:
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);
}
Dawnz is offline   Reply With Quote
Old 10/08/2012, 09:12 AM   #4
[EnErGyS]KING
Big Clucker
 
[EnErGyS]KING's Avatar
 
Join Date: Jun 2009
Location: Lithuanian.
Posts: 136
Reputation: 9
Default Re: NPC bot spam chat OnPlayerText

Now i have error
pawn Code:
error 017: undefined symbol "SendClientMessage"
[EnErGyS]KING is offline   Reply With Quote
Old 10/08/2012, 09:14 AM   #5
Dawnz
Big Clucker
 
Join Date: Jun 2012
Location: Los Angeles, CA
Posts: 65
Reputation: 13
Default Re: NPC bot spam chat OnPlayerText

Did you add a defined color to the line or not?
Dawnz is offline   Reply With Quote
Old 10/08/2012, 09:20 AM   #6
[EnErGyS]KING
Big Clucker
 
[EnErGyS]KING's Avatar
 
Join Date: Jun 2009
Location: Lithuanian.
Posts: 136
Reputation: 9
Default Re: NPC bot spam chat OnPlayerText

Quote:
Originally Posted by Dawnz View Post
Did you add a defined color to the line or not?
Yes.
pawn Code:
0xffff66
[EnErGyS]KING is offline   Reply With Quote
Old 10/08/2012, 09:29 AM   #7
lamarr007
Huge Clucker
 
lamarr007's Avatar
 
Join Date: Aug 2011
Location: Czech Republic
Posts: 238
Reputation: 19
Default Re: NPC bot spam chat OnPlayerText

Did you include a_samp?
pawn Code:
//on top your script
#include <a_samp>
__________________
I have cool Stunt/Mods/Freeroam server with CZ/EN translate.. If you want it, PM me..
lamarr007 is offline   Reply With Quote
Old 10/08/2012, 09:36 AM   #8
[EnErGyS]KING
Big Clucker
 
[EnErGyS]KING's Avatar
 
Join Date: Jun 2009
Location: Lithuanian.
Posts: 136
Reputation: 9
Default Re: NPC bot spam chat OnPlayerText

Deleted

Last edited by [EnErGyS]KING; 10/08/2012 at 11:37 AM.
[EnErGyS]KING is offline   Reply With Quote
Old 10/08/2012, 10:32 AM   #9
[jS]Thomas
Guest
 
Posts: n/a
Default Re: NPC bot spam chat OnPlayerText

You still need a_samp for sendclientmessage, so if you don't have that, add it.
  Reply With Quote
Old 10/08/2012, 10:56 AM   #10
[EnErGyS]KING
Big Clucker
 
[EnErGyS]KING's Avatar
 
Join Date: Jun 2009
Location: Lithuanian.
Posts: 136
Reputation: 9
Default Re: NPC bot spam chat OnPlayerText

Thx for help i fixed.
[EnErGyS]KING is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[Tutorial] Random colors on OnPlayerText (CHAT) blackwave Tutorials 12 18/07/2014 12:41 PM
StopAudioStreamForPlayer - CHAT SPAM - TEXT DRAW aNdReSk Scripting Help 2 06/04/2012 01:33 AM
[HELP] /chat animation onplayertext Shellegg Scripting Help 0 07/01/2012 07:39 PM
[FilterScript] Spam Prevention System (Anti Spam) Luka P. Filterscripts 9 14/09/2011 01:56 PM


All times are GMT. The time now is 02:08 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.