18.03.2013, 20:53
Hello, i've tried a few things to get these NPCs working. I tried adding this: if(IsPlayerNPC(playerid)) return 1; it didn't work. Heres the script;
//NPC created by JustinB
//Do NOT remove the line Above this one
#define FILTERSCRIPT
#include <a_samp>
#if defined FILTERSCRIPT
new Super; //Global variable!
public OnFilterScriptInit()
{
print("Viper Filterscript");
ConnectNPC("Thief","HS");
Super = CreateVehicle(411, 0.0, 0.0, 5.0, 0.0, 3, 3, 5000);
return 1;
}
public OnFilterScriptExit()
{
return 1;
}
#else
#endif
public OnGameModeInit()
{
return 1;
}
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, "Thief", true)) //Checking if the NPC's name is MyFirstNPC
{
PutPlayerInVehicle(playerid, Super, 0); //Putting the NPC into the vehicle we created for it.
}
return 1;
}
return 1;
}
public OnPlayerDeath(playerid, killerid, reason)
{
return 1;
}
public OnVehicleSpawn(vehicleid)
{
return 1;
}
public OnVehicleDeath(vehicleid, killerid)
{
return 1;
}
public OnPlayerText(playerid, text[])
{
return 1;
}
What happens;
[22:10:26] Starter / Blank gamemode by L3th4l loaded!
[22:10:26] Number of vehicle models: 2
[22:10:26] Incoming connection: 127.0.0.1:51340
[22:10:26] Incoming connection: 127.0.0.1:51341
[22:10:26] [npc:join] Kriminal has joined the server (0:127.0.0.1)
[22:10:26] [npc:join] Thief has joined the server (1:127.0.0.1)
[22:10:41] [npc
art] Kriminal has left the server (0:0)
[22:10:41] [npc
art] Thief has left the server (1:0)
//NPC created by JustinB
//Do NOT remove the line Above this one
#define FILTERSCRIPT
#include <a_samp>
#if defined FILTERSCRIPT
new Super; //Global variable!
public OnFilterScriptInit()
{
print("Viper Filterscript");
ConnectNPC("Thief","HS");
Super = CreateVehicle(411, 0.0, 0.0, 5.0, 0.0, 3, 3, 5000);
return 1;
}
public OnFilterScriptExit()
{
return 1;
}
#else
#endif
public OnGameModeInit()
{
return 1;
}
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, "Thief", true)) //Checking if the NPC's name is MyFirstNPC
{
PutPlayerInVehicle(playerid, Super, 0); //Putting the NPC into the vehicle we created for it.
}
return 1;
}
return 1;
}
public OnPlayerDeath(playerid, killerid, reason)
{
return 1;
}
public OnVehicleSpawn(vehicleid)
{
return 1;
}
public OnVehicleDeath(vehicleid, killerid)
{
return 1;
}
public OnPlayerText(playerid, text[])
{
return 1;
}
What happens;
[22:10:26] Starter / Blank gamemode by L3th4l loaded!
[22:10:26] Number of vehicle models: 2
[22:10:26] Incoming connection: 127.0.0.1:51340
[22:10:26] Incoming connection: 127.0.0.1:51341
[22:10:26] [npc:join] Kriminal has joined the server (0:127.0.0.1)
[22:10:26] [npc:join] Thief has joined the server (1:127.0.0.1)
[22:10:41] [npc

[22:10:41] [npc
