SA-MP Forums Archive
How do I talk between my GM script and NPC script? REP+ - 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)
+--- Thread: How do I talk between my GM script and NPC script? REP+ (/showthread.php?tid=570673)



How do I talk between my GM script and NPC script? REP+ - Darrenr - 12.04.2015

Hi,

So right now I've got my NPC script which runs the recordings for the NPC and I've got my GM script which the NPC runs from.

Within both scripts I have written something like this below, to see if the player is near the NPC when they type a cmd

Код:
public OnPlayerText(playerid, text[]){
	if(!strcmp(text, "-npc", true)){
	    new Float:x, Float:y, Float:z;
	    GetPlayerPos(0, x, y, z); // playerid 0 is npc for testing purposes
		//GetDistanceFromMeToPoint(x,y,z, distance);
		if(GetPlayerDistanceFromPoint(playerid, x, y, z) < 10){
When a player types -npc it changes the recording the NPC is playing (from NPC script) and it shows the player a textdraw (from GM script).... Now, this is where I am having trouble

I need to change the recording the NPC is playing when the player clicks on a selectable textdraw... So, how would I tell the NPC script to change the recording from OnPlayerSelectTextdraw (or w/e it is) in my GM script?

Thanks


Re: How do I talk between my GM script and NPC script? REP+ - FernandoLight - 12.04.2015

Hard work, I wish I could've helped you - Vinewood.


Re: How do I talk between my GM script and NPC script? REP+ - Darrenr - 13.04.2015

bump


Re: How do I talk between my GM script and NPC script? REP+ - Darrenr - 13.04.2015

bump


Re: How do I talk between my GM script and NPC script? REP+ - Darrenr - 14.04.2015

Solved with OnClientMessage