SA-MP Forums Archive
NPC joins and leaves the server - 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: NPC joins and leaves the server (/showthread.php?tid=554228)



NPC joins and leaves the server - bogushas - 02.01.2015

PHP код:
public OnPlayerRequestClass(playeridclassid

    if(
IsPlayerNPC(playerid)) 
    { 
        new 
npc_name[24]; 
        
GetPlayerName(playerid,npc_name,sizeof(npc_name)); 
        if(!
strcmp(npc_name,"Pablas",false)) SetSpawnInfo(playerid, -1,17, -1448.2899171494.7772226.099233,0.0, -1, -1, -1, -1, -1, -1); 
    }    
    return 
1

PHP код:
21:13:59] [npc:joinPablas has joined the server (0:127.0.0.1
[
21:14:00] [npc:partPablas has left the server (0:2



Re: NPC joins and leaves the server - Abagail - 02.01.2015

Show your ConnectNPC line. Is there a valid recording file with the rec. name you used?


Re: NPC joins and leaves the server - bogushas - 02.01.2015

PHP код:
loadNpc()
{
    
ConnectRNPC("Pablas");
    return 
1;

I need him just for standing in one place nothing more. So I think i didin't need a record.


Re: NPC joins and leaves the server - Neos07 - 02.01.2015

OnPlayerConnect: If(IsNPC(playerid)) return spawnplayer(playerid.....


Re: NPC joins and leaves the server - bogushas - 02.01.2015

Didin't worked.