PDA

View Full Version : NPCs connects but they dont spawn


Saize
19/01/2015, 10:06 AM
Hey guys,

Ive a little problem over here, I wanted to test some shit with NPCs but they just dont spawn ;(

Ive replaced the names, and coords in the gl_npcs fs and my rcon console always tells me that there are incomming connections.

But when I try to teleport to them Im getting teleportet to the "0,0,0,-Coordinates"

I already ******d it but yet I didnt couldnt find out what Im doing wrong :(

Code in the GM:

public OnPlayerRequestClass(playerid, classid)
{
if(IsPlayerNPC(playerid)) return SpawnPlayer(playerid);

SetPlayerInterior(playerid,3);
SetPlayerPos(playerid, 513.0422,-17.3889,1001.5653);
SetPlayerCameraPos(playerid, 513.0743,-10.5657,1001.5653);
SetPlayerCameraLookAt(playerid, 513.0422,-17.3889,1001.5653);
SetPlayerFacingAngle(playerid, 352.0760);

TextDrawShowForPlayer(playerid, Textdraw0);
return 1;
}

Code in the NPC-File:

public OnNPCSpawn()
{
SendChat("hi there!");
NextPlayback();
}

ATGOggy
19/01/2015, 10:11 AM
Add this in you gamemode and try:
public OnPlayerSpawn(playerid)
{
if(IsPlayerNPC(playerid)) return 1;
}

Saize
19/01/2015, 10:13 AM
Add this in you gamemode and try:
public OnPlayerSpawn(playerid)
{
if(IsPlayerNPC(playerid)) return 1;
}

Didnt changed anything :(


BTW: I dont even know why you think the error could be in OnPlayerSpawn, the NPC doesnt spawn thats my problem :(

Saize
19/01/2015, 12:34 PM
I even tried it like this but yet i couldnt found out whats wrong....


public OnPlayerConnect(playerid)
{
if(IsPlayerNPC(playerid)) return SetPlayerPos(playerid,1615.0560,-1526.9115,13.6229) && SetPlayerInterior(playerid,0);
SetPlayerColor(playerid,0x00FF96FF);
GivePlayerMoney(playerid,420420);
return 1;
}