SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Filterscripts > Includes

Reply
 
Thread Tools Display Modes
Old 04/09/2009, 04:45 AM   #1
Whiteagle
Big Clucker
 
Join Date: Mar 2008
Posts: 73
Reputation: 2
Default [INC] NPC-Bridge (GM to NPC Communication)

Code:
  NNNNNNNN    NNNNNNNNPPPPPPPPPPPPPPPPP      CCCCCCCCCCCCC
  N:::::::N    N::::::NP::::::::::::::::P    CCC::::::::::::C
  N::::::::N   N::::::NP::::::PPPPPP:::::P  CC:::::::::::::::C
  N:::::::::N   N::::::NPP:::::P   P:::::P C:::::CCCCCCCC::::C
  N::::::::::N  N::::::N P::::P   P:::::P C:::::C    CCCCCC
  N:::::::::::N  N::::::N P::::P   P:::::PC:::::C       
  N:::::::N::::N N::::::N P::::PPPPPP:::::P C:::::C       
  N::::::N N::::N N::::::N P:::::::::::::PP C:::::C       
  N::::::N N::::N:::::::N P::::PPPPPPPPP  C:::::C       
  N::::::N  N:::::::::::N P::::P      C:::::C       
  N::::::N  N::::::::::N P::::P      C:::::C       
  N::::::N   N:::::::::N P::::P       C:::::C    CCCCCC
  N::::::N   N::::::::NPP::::::PP      C:::::CCCCCCCC::::C
  N::::::N    N:::::::NP::::::::P       CC:::::::::::::::C
  N::::::N    N::::::NP::::::::P        CCC::::::::::::C
  NNNNNNNN     NNNNNNNPPPPPPPPPP         CCCCCCCCCCCCC
Code:
88888888ba  88888888ba  88 88888888ba,   ,ad8888ba,  88888888888 
88   "8b 88   "8b 88 88   `"8b  d8"'  `"8b 88      
88   ,8P 88   ,8P 88 88    `8b d8'      88      
88aaaaaa8P' 88aaaaaa8P' 88 88     88 88       88aaaaa   
88""""""8b, 88""""88'  88 88     88 88   88888 88"""""   
88   `8b 88  `8b  88 88     8P Y8,    88 88      
88   a8P 88   `8b  88 88   .a8P  Y8a.  .a88 88      
88888888P"  88   `8b 88 88888888Y"'   `"Y88888P"  88888888888
So this is my first public release of anything Pawno related.

This is a communication Bridge between any GameMode and NPC.

Installation

ON YOUR GAMEMODE:
After your includes:
Code:
#define SECRETCODE "!:S3cr3tC0d3:!" // Insert your secret code here, this allow communication to the NPC's, make it safe since it can be used in chat or anyone can control any bot!!!!, Consider it as a rcon password!
#define TOTALCHARS 14 // Total chars of the Secret word, sorry cant use sizeof :(
#include <npc_bridge> // Our include.
ON YOUR NPC:
After your includes:
Code:
#define SECRETCODE "!:S3cr3tC0d3:!" // Insert your secret code here, this allow communication to the NPC's, make it safe since it can be used in chat or anyone can control any bot!!!!, Consider it as a rcon password!
#define TOTALCHARS 14 // Total chars of the Secret word, sorry cant use sizeof :(
#include <npc_bridge> // Our include.
In the end of your script:
Code:
public OnClientMessage(color, text[])
{
	ClientMessageBridge(text); // Call the function needed.
}

Usage:
Run a command trough your gamemod:
Code:
NPCMessage(<NPC ID>, "<SYNTAX>", "<COMMAND HERE>");
Examples & Current available commands:
Code:
NPCMessage(NPCIdHere, "This is a sample SendChat", "SendChat"); // SendChat("This is a sample SendChat")
NPCMessage(NPCIdHere, "/mycommand", "SendCommand"); // SendCommand("/mycommand")
NPCMessage(NPCIdHere, "2 square", "StartRecordingPlayback"); // StartRecordingPlayback(2,"square");
NPCMessage(NPCIdHere, "StopRecordingPlayback", "StopRecordingPlayback"); // StopRecordingPlayback();
NPCMessage(NPCIdHere, "PauseRecordingPlayback", "PauseRecordingPlayback"); // PauseRecordingPlayback();
NPCMessage(NPCIdHere, "ResumeRecordingPlayback", "ResumeRecordingPlayback"); // ResumeRecordingPlayback();
Commands & Syntax:
Code:
[COMMAND] - [SYNTAX]
SendChat - Message
SendCommand - /Command
StartRecordingPlayback - <Recording Type ID>[space]<Recording Name>
StopRecordingPlayback - None
PauseRecordingPlayback - None
ResumeRecordingPlayback - None
Thanks to:
> Kye & The SA:MP Dev team (Not only for the new great version but also for the nice examples that i was able to modify)
> Backwardsman97 for this
> Zezombia, because he release "made"/"inspired" me to release this

Download it Here

PS: Please report any bugs!

Changelog:
0.1: Released
0.1.1: Removed some forgotten debug functions
Whiteagle is offline   Reply With Quote
Old 04/09/2009, 05:18 AM   #2
Wanted1900
Big Clucker
 
Join Date: Feb 2009
Posts: 50
Reputation: 0
Default Re: [INC] NPC-Bridge (GM to NPC Communication)

Looks nice, but your download link is not working.
Wanted1900 is offline   Reply With Quote
Old 04/09/2009, 05:28 AM   #3
Whiteagle
Big Clucker
 
Join Date: Mar 2008
Posts: 73
Reputation: 2
Default Re: [INC] NPC-Bridge (GM to NPC Communication)

Quote:
Originally Posted by Wanted1900
Looks nice, but your download link is not working.
Sorry about that,

There was an error during the upload, fixed
Whiteagle is offline   Reply With Quote
Old 04/09/2009, 05:36 AM   #4
Wanted1900
Big Clucker
 
Join Date: Feb 2009
Posts: 50
Reputation: 0
Default Re: [INC] NPC-Bridge (GM to NPC Communication)

Quote:
Originally Posted by Whiteagle
Quote:
Originally Posted by Wanted1900
Looks nice, but your download link is not working.
Sorry about that,

There was an error during the upload, fixed
Thank you.
Wanted1900 is offline   Reply With Quote
Old 04/09/2009, 11:27 AM   #5
Whiteagle
Big Clucker
 
Join Date: Mar 2008
Posts: 73
Reputation: 2
Default Re: [INC] NPC-Bridge (GM to NPC Communication)

Quote:
Originally Posted by Wanted1900
Quote:
Originally Posted by Whiteagle
Quote:
Originally Posted by Wanted1900
Looks nice, but your download link is not working.
Sorry about that,

There was an error during the upload, fixed
Thank you.
You're welcome, please report any bugs that you find
Whiteagle is offline   Reply With Quote
Old 12/02/2010, 02:54 AM   #6
Ricop522
High-roller
 
Ricop522's Avatar
 
Join Date: Feb 2010
Location: ES
Posts: 2,697
Reputation: 148
Default Re: [INC] NPC-Bridge (GM to NPC Communication)

Cool
__________________
"Any fool can write code that a
computer can understand. Good
programmers write code that
humans can understand."

Sistemas de Informação, IFES
Ricop522 is offline   Reply With Quote
Old 12/02/2010, 02:58 AM   #7
BlackFoX
Huge Clucker
 
Join Date: Dec 2007
Posts: 260
Reputation: 10
Default Re: [INC] NPC-Bridge (GM to NPC Communication)

But it is Wrong Section i think
BlackFoX is offline   Reply With Quote
Old 12/02/2010, 03:04 AM   #8
Whiteagle
Big Clucker
 
Join Date: Mar 2008
Posts: 73
Reputation: 2
Default Re: [INC] NPC-Bridge (GM to NPC Communication)

Oh this is old :P

This is here since the pre-beta for developers, when SA:MP 0.3 was still a dream for us mortals.

This was in fact posted over the 0.3 stuff but with the changes this got lost here

Going to report to get moved to FS & Inc's.

Thanks guys
Whiteagle is offline   Reply With Quote
Old 01/03/2010, 11:28 AM   #9
cyber_punk
Gangsta
 
Join Date: Feb 2008
Location: Det. Mi. USA.....
Posts: 588
Reputation: 9
Default Re: [INC] NPC-Bridge (GM to NPC Communication)

Seems like the easiest system around for NPC communication but I can't get it to work when using YSI, more specifically (I believe) its foreach that is causing the problems. I am running some tests now to see if I can't figure out exactly why.

[Edit] Out I figured out the problem, it has to do with the way foreach determines if something is a bot (SendChat) and since this include uses that it broke foreach. Since I am not using this feature (I only want it for the playback features) I was able to comment those sections out and everything is compiling fine now.
__________________
cyber_punk 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
In-Game Voice Communication Charles General 79 19/05/2011 03:17 PM
MOVED: [INC] NPC-Bridge (GM to NPC Communication) JaTochNietDan Help Archive 0 12/02/2010 10:04 AM
Communication between Filterscript and GameMode Oxside Help Archive 10 02/01/2010 08:04 PM
[INC] Zezombia's Simple Communication Bot Sync System Zezombia Help Archive 11 04/09/2009 09:57 AM
communication in general chat odyvan Help Archive 7 05/04/2009 12:55 AM


All times are GMT. The time now is 06:54 PM.


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