#1

I Need help!

My NPC sometimes just standing in the spawn point, but after some server restarts NPC starting work ...


Please help!
Reply
#2

Show us your script, otherwise we can't help you.
Reply
#3

PHP код:
public OnPlayerSpawn(playerid)
{
     if(
IsPlayerNPC(playerid)) //Checks if the player that just spawned is an NPC.
    
{
        new 
npcname[MAX_PLAYER_NAME];
        
GetPlayerName(playeridnpcnamesizeof(npcname)); //Getting the NPC's name.
        
if(!strcmp(npcname"Bussi"true)) //Checking if the NPC's name is Arnold Moore
        
{
            
SetPlayerSkin(playerid240);
            
PutPlayerInVehicle(playeridMyFirstNPCVehicle0);
        }
    
/*    if(!strcmp(npcname, "puudub_Puudub", true)) //Checking if the NPC's name is Albert Moore
        {
            SetPlayerSkin(playerid, 47);
        }*/

        
return 1;
    }
    else
    {
        
SetPlayerSkillLevel(playerid,WEAPONSKILL_PISTOL,998);
        
SetPlayerSkillLevel(playerid,WEAPONSKILL_PISTOL_SILENCED,999);
        
SetPlayerSkillLevel(playerid,WEAPONSKILL_DESERT_EAGLE,999);
        
SetPlayerSkillLevel(playerid,WEAPONSKILL_SHOTGUN,999);
        
SetPlayerSkillLevel(playerid,WEAPONSKILL_SAWNOFF_SHOTGUN,998);
        
SetPlayerSkillLevel(playerid,WEAPONSKILL_SPAS12_SHOTGUN,999);
        
SetPlayerSkillLevel(playerid,WEAPONSKILL_MICRO_UZI,998);
        
SetPlayerSkillLevel(playerid,WEAPONSKILL_MP5,999);
        
SetPlayerSkillLevel(playerid,WEAPONSKILL_AK47,999);
        
SetPlayerSkillLevel(playerid,WEAPONSKILL_M4,999);
        
SetPlayerSkillLevel(playerid,WEAPONSKILL_SNIPERRIFLE,999);
        
InitLockDoors(playerid);
        
STDPlayer[playerid] = 0;
        
gTeam[playerid] = PlayerInfo[playerid][pTeam]; //Set the Team
        
if (gTeam[playerid] == 4//medic / criminal reset team
        
{
            
gTeam[playerid] = 3;
        }
        if(
gPlayerLogged[playerid] == 0)
        {
            if(!
IsPlayerNPC(playerid))
            {
                
SendClientMessage(playeridCOLOR_LIGHTRED"** This server requires a Login BEFORE spawn (Kicked) **");
                
KickPlayer[playerid] = 1;
            }
        }
        if(
gTeam[playerid] == 11 && PlayerInfo[playerid][pLeader] < 1)
        {
            
MedicBill[playerid] = 0;
            new 
rand random(sizeof(CIV));
            
SendClientMessage(playeridCOLOR_LIGHTRED"You are not an Approved Leader, you are now a Civilian !");
            
PlayerInfo[playerid][pTeam] = 3;
            
gTeam[playerid] = 3;
            
SetSpawnInfo(playeridgTeam[playerid], CIV[rand],-2615.1384,2259.3462,8.1983,0,0,0,0,0,0,0);
            
PlayerInfo[playerid][pModel] = CIV[rand];
            
SpawnPlayer(playerid);
        }
        if(
gTeam[playerid] == 5)
        {
            if(
PlayerInfo[playerid][pMember] < 1)
            {
                
MedicBill[playerid] = 0;
                new 
rand random(sizeof(CIV));
                
SendClientMessage(playeridCOLOR_LIGHTRED"You are not a Family Member, you are now a Civilian !");
                
PlayerInfo[playerid][pTeam] = 3;
                
gTeam[playerid] = 3;
                
SetSpawnInfo(playeridgTeam[playerid], CIV[rand],-2615.1384,2259.3462,8.1983,358.8067,0,0,0,0,0,0);
                
PlayerInfo[playerid][pModel] = CIV[rand];
                
SpawnPlayer(playerid);
            }
        }
        if(
gTeam[playerid] == 10)
        {
            if(
PlayerInfo[playerid][pMember] != 8)
            {
                
MedicBill[playerid] = 0;
                new 
rand random(sizeof(CIV));
                
SendClientMessage(playeridCOLOR_LIGHTRED"You are not a Member of this Agency, you are now a Civilian !");
                
PlayerInfo[playerid][pTeam] = 3;
                
gTeam[playerid] = 3;
                
SetSpawnInfo(playeridgTeam[playerid], CIV[rand],-2615.1384,2259.3462,8.1983,358.8067,0,0,0,0,0,0);
                
PlayerInfo[playerid][pModel] = CIV[rand];
                
SpawnPlayer(playerid);
            }
        }
        if(
gTeam[playerid] == && PlayerInfo[playerid][pMember] > 3)
        {
            
MedicBill[playerid] = 0;
            new 
rand random(sizeof(CIV));
            
SendClientMessage(playeridCOLOR_LIGHTRED"You haven't applied for being an Officer / FBI / National Guard, you are now a Civilian !");
            
PlayerInfo[playerid][pTeam] = 3;
            
gTeam[playerid] = 3;
            
SetSpawnInfo(playeridgTeam[playerid], CIV[rand],-2615.1384,2259.3462,8.1983,358.8067,0,0,0,0,0,0);
            
PlayerInfo[playerid][pModel] = CIV[rand];
            
SpawnPlayer(playerid);
        }
        if(
gTeam[playerid] == 3)
        {
            if(
PlayerInfo[playerid][pMember] > || PlayerInfo[playerid][pLeader] > 0)
            {
                
SendClientMessage(playeridCOLOR_LIGHTRED"You are part of a Family/Force, you've been forced to the right Class + Char !");
                
MedicBill[playerid] = 0;
                new 
model PlayerInfo[playerid][pChar];
                if(
PlayerInfo[playerid][pMember] == 0) { SetSpawnInfo(playerid2model,-2615.1384,2259.3462,8.1983,358.8067,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 2gTeam[playerid] = 2PlayerInfo[playerid][pModel] = model; }
                else if(
PlayerInfo[playerid][pMember] == 1) { SetSpawnInfo(playerid2model,-2615.1384,2259.3462,8.1983,358.8067,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 2gTeam[playerid] = 2PlayerInfo[playerid][pModel] = model; }
                else if(
PlayerInfo[playerid][pMember] == 2) { SetSpawnInfo(playerid2model,-2615.1384,2259.3462,8.1983,358.8067,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 2gTeam[playerid] = 2PlayerInfo[playerid][pModel] = model; }
                else if(
PlayerInfo[playerid][pMember] == 3) { SetSpawnInfo(playerid2model,-2615.1384,2259.3462,8.1983,358.8067,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 2gTeam[playerid] = 2PlayerInfo[playerid][pModel] = model; }
                else if(
PlayerInfo[playerid][pMember] == 4) { SetSpawnInfo(playerid1model,-2615.1384,2259.3462,8.1983,358.8067,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 1gTeam[playerid] = 1PlayerInfo[playerid][pModel] = model; }
                else if(
PlayerInfo[playerid][pMember] == 5) { SetSpawnInfo(playerid5model,-2615.1384,2259.3462,8.1983,358.8067,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 5gTeam[playerid] = 5PlayerInfo[playerid][pModel] = model; }
                else if(
PlayerInfo[playerid][pMember] == 6) { SetSpawnInfo(playerid5model,-2615.1384,2259.3462,8.1983,358.8067,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 5gTeam[playerid] = 5PlayerInfo[playerid][pModel] = model; }
                else if(
PlayerInfo[playerid][pMember] == 7) { SetSpawnInfo(playerid11model,-2615.1384,2259.3462,8.1983,358.8067,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 11gTeam[playerid] = 11PlayerInfo[playerid][pModel] = model; }
                else if(
PlayerInfo[playerid][pMember] == 8) { SetSpawnInfo(playerid10model,-2615.1384,2259.3462,8.1983,358.8067,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 10gTeam[playerid] = 10PlayerInfo[playerid][pModel] = model; }
                else if(
PlayerInfo[playerid][pMember] == 9) { SetSpawnInfo(playerid12model,-2615.1384,2259.3462,8.1983,358.8067,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 12gTeam[playerid] = 12PlayerInfo[playerid][pModel] = model; }
                else if(
PlayerInfo[playerid][pMember] == 10) { SetSpawnInfo(playerid12model,-2615.1384,2259.3462,8.1983,358.8067,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 12gTeam[playerid] = 12PlayerInfo[playerid][pModel] = model; }
                else if(
PlayerInfo[playerid][pMember] == 11) { SetSpawnInfo(playerid12model,-2615.1384,2259.3462,8.1983,358.8067,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 12gTeam[playerid] = 12PlayerInfo[playerid][pModel] = model; }
                else if(
PlayerInfo[playerid][pMember] == 14) { SetSpawnInfo(playerid5model,-2615.1384,2259.3462,8.1983,358.8067,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 5gTeam[playerid] = 5PlayerInfo[playerid][pModel] = model; }
                else if(
PlayerInfo[playerid][pMember] == 15) { SetSpawnInfo(playerid5model,-2615.1384,2259.3462,8.1983,358.8067,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 5gTeam[playerid] = 5PlayerInfo[playerid][pModel] = model; }
                else if(
PlayerInfo[playerid][pMember] == 16) { SetSpawnInfo(playerid5model,-2615.1384,2259.3462,8.1983,358.8067,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 5gTeam[playerid] = 5PlayerInfo[playerid][pModel] = model; }
                
SpawnPlayer(playerid);
            }
        }
        if(
PlayerInfo[playerid][pChar] > 0) { SetPlayerSkin(playeridPlayerInfo[playerid][pChar]); }
        else { 
SetPlayerSkin(playeridPlayerInfo[playerid][pModel]); }
        
SetPlayerWeapons(playerid);
        
SetPlayerSpawn(playerid);
        
SetPlayerToTeamColor(playerid);
        
PlayerFixRadio(playerid);
        
FirstSpawn[playerid] = 0;
        for(new 
0sizeof(Turfs); i++)
        {
            
GangZoneShowForPlayer(playeridiTurfInfo[i][zColor]);
            return 
1;
        }
        if(
MapIconsShown[playerid] != 1)
        {
            
MapIconsShown[playerid] = 1;
            for(new 
0sizeof(BizzInfo); i++)
            {
                
SetPlayerMapIcon(playerid,1,BizzInfo[i][bEntranceX],BizzInfo[i][bEntranceY],BizzInfo[i][bEntranceZ],36,COLOR_LIGHTRED);
            }
            for(new 
0sizeof(SBizzInfo); i++)
            {
                
SetPlayerMapIcon(playerid,20,SBizzInfo[i][sbEntranceX],SBizzInfo[i][sbEntranceY],SBizzInfo[i][sbEntranceZ],36,COLOR_LIGHTRED);
            }
        }
    }
    return 
1;

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)