SA-MP Forums Archive
NPC Name and players distance and reply - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: NPC Name and players distance and reply (/showthread.php?tid=233643)



NPC Name and players distance and reply - wheelman_WM - 02.03.2011

Код:
#include <a_samp>
/*
	This FS was created by Quincy_Gatlin, I was just bored and I
 	wanted to show how the NPC's worked, and just to show them off.
 	Edit this in any way you wish, basically they just either walk,
 	drive or fly around, if you can catch them sitting still you
 	can press "G" to get into the vehicle and ride around with them.
	You can't kill them I don't believe, but I heard you could with
	a spray can, who knows, give it a try.
	
	Credits:
	Quincy_Gatlin for creating and coding this FS.
	Kye and the SA:MP crew for developing SA:MP 0.3X and making it possible to have NPCs.
 	And anyone else who has contributed to SA:MP and the developing of NPCs.
*/

#define FILTERSCRIPT

#if defined FILTERSCRIPT

new PhoenixCar;
new DodoPlane;
forward GetClosestPlayer(p1);

public OnFilterScriptInit()
{
	print("\n--------------------------------------");
	print(" NPC Filterscript by Quincy Gatlin");
	print("Have fun editing and playing around with NPCs\n");
	print("--------------------------------------\n");

	ConnectNPC("Beach_Fella","Pier(Walking)");
	ConnectNPC("Phoenix_Driver","LS(Driving1)");
	ConnectNPC("LS_Flyer","Flyer");
	ConnectNPC("kick","kick");
	ConnectNPC("punch","punch");
	ConnectNPC("dildo","dildo");
	ConnectNPC("lolxd","lolxd");
	ConnectNPC("newname","newname");
	
	DodoPlane = CreateVehicle(593, 0, 0, 0, 0, -1, -1, 60000);
	PhoenixCar = CreateVehicle(603, 0,0,0,0, 0, 0, 60000);
	return 1;
}

public OnFilterScriptExit()
{
	return 1;
}

#else

#endif

public OnPlayerSpawn(playerid)
{
    if(IsPlayerNPC(playerid)) //Checks if the player that just spawned is an NPC.
    {
        new npcname[MAX_PLAYER_NAME];
        GetPlayerName(playerid, npcname, sizeof(npcname)); //Getting the NPC's name.
        if(!strcmp(npcname, "Beach_Fella", true)) //Checking if the NPC's name is Correct
        {
            SetPlayerSkin(playerid, 45);
        }
        if(!strcmp(npcname, "Phoenix_Driver", true)) //Checking if the NPC's name is Correct
        {
            PutPlayerInVehicle(playerid, PhoenixCar, 0); //Putting the NPC into the vehicle we created for it.
            AddVehicleComponent(GetPlayerVehicleID(playerid), 1010);
            AddVehicleComponent(GetPlayerVehicleID(playerid), 1087);
            AddVehicleComponent(GetPlayerVehicleID(playerid), 1079);
            SetPlayerSkin(playerid, 73);
        }
        if(!strcmp(npcname, "Punch", true)) //Checking if the NPC's name is Correct
        {
            SetPlayerSkin(playerid, 271);
        }
        if(!strcmp(npcname, "dildo", true)) //Checking if the NPC's name is Correct
        {
            SetPlayerSkin(playerid, 167);
        }
        if(!strcmp(npcname, "newname", true)) //Checking if the NPC's name is Correct
        {   PutPlayerInVehicle(playerid, PhoenixCar, 0); //Putting the NPC into the vehicle we created for it.
            AddVehicleComponent(GetPlayerVehicleID(playerid), 1010);
            AddVehicleComponent(GetPlayerVehicleID(playerid), 1087);
            AddVehicleComponent(GetPlayerVehicleID(playerid), 1079);
            SetPlayerSkin(playerid, 73);
            }
        if(!strcmp(npcname, "lolxd", true)) //Checking if the NPC's name is Correct
        {   PutPlayerInVehicle(playerid, PhoenixCar, 0); //Putting the NPC into the vehicle we created for it.
            AddVehicleComponent(GetPlayerVehicleID(playerid), 1010);
            AddVehicleComponent(GetPlayerVehicleID(playerid), 1087);
            AddVehicleComponent(GetPlayerVehicleID(playerid), 1079);
            SetPlayerSkin(playerid, 163);
            }
        if(!strcmp(npcname, "LS_Flyer", true)) //Checking if the NPC's name is Correct
        {
            PutPlayerInVehicle(playerid, DodoPlane, 0); //Putting the NPC into the vehicle we created for it.
            SetPlayerSkin(playerid, 53);
        }
        if(!strcmp(npcname, "OG_LOC", true)) //Checking if the NPC's name is Correct
        {
            SetPlayerSkin(playerid, 293);
            GivePlayerWeapon(playerid, 22, 9999);
        }

		return 1;
    }
	return 1;
}
Hey anyone help me for this please add this tutorial script to it : https://sampforum.blast.hk/showthread.php?tid=96030


Re: NPC Name and players distance and reply - Ironboy - 02.03.2011

you need to add that FS to your script?


Re: NPC Name and players distance and reply - wheelman_WM - 02.03.2011

yes bro


Re: NPC Name and players distance and reply - wheelman_WM - 02.03.2011

please anyone help


Re: NPC Name and players distance and reply - wheelman_WM - 02.03.2011

****** please help me on this


Re: NPC Name and players distance and reply - AK47317 - 02.03.2011

so whats the problem son?


Re: NPC Name and players distance and reply - wheelman_WM - 02.03.2011

lol
please add that tutorial to my script


Re: NPC Name and players distance and reply - Mean - 02.03.2011

How do we add it in your script, we aren't telepats we can't see your script, we only see the FS. What do you want us to do? Why don't you just use it as a FS, not in GM?


Re: NPC Name and players distance and reply - wheelman_WM - 02.03.2011

lol i copy my FS and pasted here in code