Npc spawn at LV Stairs!
#1

Help ?



PHP код:
#include <a_npc>
main(){}
public 
OnNPCSpawn()
{
    
SetMyPos(-199.0519,2659.8696,62.8614);


It doesn't need any records since it just stand there...


My GM:
PHP код:
public OnFilterScriptInit()
{
    print(
"Hotdog 0.1a loaded by Berkan Succesfully!");
    
ConnectNPC("Hotdog""Hotdog");
    
CreatePickup(1240,1,195.8012,2659.9373,62.8400,0);
    
Create3DTextLabel("/buyfood"RED195.8012,2659.9373,62.84005.000);
    return 
1;
}
public 
OnPlayerRequestClass(playeridclassid)
{
    if(!
IsPlayerNPC(playerid))
    {
        
    }    
    return 
1;
}
public 
OnPlayerConnect(playerid)
{
    if(!
IsPlayerNPC(playerid))
    {
        
    }    
    return 
1;
}
public 
OnPlayerSpawn(playerid)
{
            if(
IsPlayerNPC(playerid))
        {
            new 
npcname[24];
            
GetPlayerName(playeridnpcnamesizeof(npcname));
            if(!
strcmp(npcname"Hotdog"true))
            {
                
SetPlayerSkin(playerid168);
            }
            return 
1;
        }
            return 
1;

Probleeeeeeeeem?
Reply
#2

The NPC callbacks usually don't work in NPC scripts for unknown reasons. Just make it in your gamemode.
Reply
#3

But in my gamemode there is already one.. I'm making FS's for each NPC.
Reply
#4

You can set NPC pos in OnPlayerSpawn
pawn Код:
public OnPlayerSpawn(playerid)
{
    if(IsPlayerNPC(playerid))
    {
        new npcname[24];
        GetPlayerName(playerid, npcname, sizeof(npcname));
        if(!strcmp(npcname, "Hotdog", true))
        {
            SetPlayerSkin(playerid, 168);
            SetPlayerPos(playerid,xxx,xxx,xxx);
        }
    }
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)