put 3D Text Labels overhead to npc
#9

pawn Код:
new mesera;
new Text3D:BotLabel[MAX_PLAYERS];

public OnGameModeInit()
{
    ConnectNPC("Jenny_Laurent","mesera");
    mesera =    AddStaticVehicle(420,2044.8854,1473.2106,10.4494,181.3339,6,1); // van
    return 1;
}

public OnGameModeExit()
{
    return 1;
}

public OnPlayerRequestClass(playerid, classid)
{
    return 1;
}

public OnPlayerRequestSpawn(playerid)
{
    return 1;
}

public OnPlayerConnect(playerid)
{
    if(IsPlayerNPC(playerid))
    {
        new string[32], NPCName[MAX_PLAYER_NAME];

        GetPlayerName(playerid, NPCName, sizeof NPCName);
        format(string, sizeof string, "%s (%d)", NPCName, playerid);
        BotLabel[playerid] = Create3DTextLabel(string, COLOR_WHITE, 0, 0, 0, 40, 0, true);
        Attach3DTextLabelToPlayer(BotLabel[playerid], playerid, 0, 0, 0.4);
        SetPlayerColor(playerid, COLOR_WHITE);
    }
}

public OnPlayerDisconnect(playerid, reason)
{
    return 1;
}

public OnPlayerSpawn(playerid)
{
    if(IsPlayerNPC(playerid)) //Checks if the player is an NPC.
    {
        new npcname[MAX_PLAYER_NAME];
        GetPlayerName(playerid, npcname, sizeof(npcname)); //Gets the NPC's name
        if(!strcmp(npcname, "Jenny_Laurent", true)) //Checks if the NPC's name is Driver
        {
            PutPlayerInVehicle(playerid, mesera, 0); //Puts the NPC into the van.
        }
    }
    return 1;
}

public OnPlayerDeath(playerid, killerid, reason)
{
    return 1;
}

public OnVehicleSpawn(vehicleid)
{
    return 1;
}

public OnVehicleDeath(vehicleid, killerid)
{
    return 1;
}

public OnPlayerText(playerid, text[])
{
    return 1;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp("/mycommand", cmdtext, true, 10) == 0)
    {
        // Do something here
        return 1;
    }
    return 0;
}
Reply


Messages In This Thread
put 3D Text Labels overhead to npc - by NTVbeleza - 03.03.2014, 17:30
Re: put 3D Text Labels overhead to npc - by Nucky - 03.03.2014, 17:52
Re: put 3D Text Labels overhead to npc - by [..MonTaNa..] - 03.03.2014, 18:06
Re: put 3D Text Labels overhead to npc - by NTVbeleza - 03.03.2014, 18:39
Re: put 3D Text Labels overhead to npc - by Nurgle4 - 03.03.2014, 19:11
Re: put 3D Text Labels overhead to npc - by NTVbeleza - 03.03.2014, 19:32
Re: put 3D Text Labels overhead to npc - by [..MonTaNa..] - 03.03.2014, 21:29
Re: put 3D Text Labels overhead to npc - by NTVbeleza - 04.03.2014, 00:51
Re: put 3D Text Labels overhead to npc - by [..MonTaNa..] - 04.03.2014, 00:56
Re: put 3D Text Labels overhead to npc - by NTVbeleza - 04.03.2014, 01:07

Forum Jump:


Users browsing this thread: 1 Guest(s)