SA-MP Forums Archive
NPCs connects but they dont spawn - 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: NPCs connects but they dont spawn (/showthread.php?tid=558825)



NPCs connect but they dont spawn - Saize - 19.01.2015

Hey guys,

Iґve a little problem over here, I wanted to test some shit with NPCґs but they just dont spawn ;(

Iґve 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 Iґm getting teleportet to the "0,0,0,-Coordinates"

I already ******d it but yet I didnt couldnt find out what Iґm doing wrong

Code in the GM:

PHP код:
public OnPlayerRequestClass(playeridclassid)
{
    if(
IsPlayerNPC(playerid)) return SpawnPlayer(playerid);
    
SetPlayerInterior(playerid,3);
    
SetPlayerPos(playerid513.0422,-17.3889,1001.5653);
    
SetPlayerCameraPos(playerid513.0743,-10.5657,1001.5653);
    
SetPlayerCameraLookAt(playerid513.0422,-17.3889,1001.5653);
    
SetPlayerFacingAngle(playerid352.0760);
    
    
TextDrawShowForPlayer(playeridTextdraw0);
    return 
1;

Code in the NPC-File:

PHP код:
public OnNPCSpawn()
{
    
SendChat("hi there!");
    
NextPlayback();




Re: NPCs connects but they dont spawn - ATGOggy - 19.01.2015

Add this in you gamemode and try:
PHP код:
public OnPlayerSpawn(playerid)
{
    if(
IsPlayerNPC(playerid)) return 1;




AW: Re: NPCs connects but they dont spawn - Saize - 19.01.2015

Quote:
Originally Posted by ATGOggy
Посмотреть сообщение
Add this in you gamemode and try:
PHP код:
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


AW: NPCs connects but they dont spawn - Saize - 19.01.2015

I even tried it like this but yet i couldnt found out whats wrong....


PHP код:
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;