Help: NPC join and leave
#4

Quote:
Originally Posted by bookknp
Посмотреть сообщение
i have put this, is it right??

PHP код:
public OnPlayerConnect(playerid)
{
    if (
IsPlayerNPC(playerid)) {
    
playertarget[playerid] = Create3DTextLabel(" "0xFFFFFFFF30.040.050.0100.001);
    
Attach3DTextLabelToPlayer(playertarget[playerid], playerid0.00.00.2);}
return 
1;
}
public 
OnPlayerDisconnect(playeridreason)
{
    if (
IsPlayerNPC(playerid))
    {
        
        new 
npcname[MAX_PLAYER_NAME];
        
GetPlayerName(playeridnpcnamesizeof(npcname));
         if(!
strcmp(npcname"Officerino"true))// Your npc name here
        
{
                    
CreateRNPCPolice ("Officerino"rpid[random(2)]);
                    new 
rp2 ConnectRNPC("Officerino");
                    
AddRPOLWaypoint (rp22029.421354.3410.5);
                    
AddRPOLWaypoint (rp22033.551286.2110.5);
                    
AddRPOLWaypoint (rp22029.421354.3410.5);
                    
AddRPOLWaypoint (rp22033.551286.2110.5);
                    
SetTimerEx ("Route2"5000"i"playerid);
                
        }
        else if(!
strcmp(npcname"NPC"true))// Your npc name here
        
{
                    
CreateRNPCPolice ("NPC"rpid[random(2)]);
                    new 
pol2 ConnectRNPC("NPC");
                    
AddRPOLWaypoint (pol22029.421354.3410.5);
                    
AddRPOLWaypoint (pol22033.551286.2110.5);
                    
AddRPOLWaypoint (pol22029.421354.3410.5);
                    
AddRPOLWaypoint (pol22033.551286.2110.5);
                    
SetTimerEx ("Route3"5000"i"playerid);
        }
    }
    
return 
1;

I search in other gamemodes, add return 0 at OnplayerConnect but i try it and npc dont join, Someone can help me??

PHP код:
public OnPlayerConnect(playerid

    if (
IsPlayerNPC(playerid)) { 
    
playertarget[playerid] = Create3DTextLabel(" "0xFFFFFFFF30.040.050.0100.001); 
    
Attach3DTextLabelToPlayer(playertarget[playerid], playerid0.00.00.2);
    return 
0;}  //<------------- Here
return 1

Reply


Messages In This Thread
Help: NPC join and leave - by bookknp - 16.08.2018, 09:39
Re: Help: NPC join and leave - by Osamakurdi - 16.08.2018, 09:42
Re: Help: NPC join and leave - by bookknp - 16.08.2018, 09:47
Re: Help: NPC join and leave - by bookknp - 19.08.2018, 05:00

Forum Jump:


Users browsing this thread: 2 Guest(s)