Giving a bot a weapon?
#1

How do I give a bot a weapon/make him hold one?

This is my code, and no weapon shows up in-game:

pawn Код:
public OnPlayerSpawn(playerid)
{
    if(IsPlayerNPC(playerid))
    {
        new botname[128];
        GetPlayerName(playerid,botname,sizeof(botname));
        if(!strcmp(botname, "Sergeant_Wyatt", false))
        {
            SetPlayerSkin(playerid, 287);
            GivePlayerWeapon(playerid, 31, 500);
            SetPlayerArmedWeapon(playerid, 31);
            NPCNameLabel[playerid] = Create3DTextLabel("Sergeant Wyatt", COLOR_FAKEWHITE, 0.0, 0.0, 0.0, 15.0, 0, 1);
            Attach3DTextLabelToPlayer(NPCNameLabel[playerid], playerid, 0.0, 0.0, 0.0);
            return 1;
        }
Help is appreciated.
Reply
#2

AFAIK you can only give bots weapons on record, meaning the weapon the bot holds is also recorded (=the weapon the recording player holds) and cant be changed on playback.
Reply
#3

Quote:
Originally Posted by Mauzen
Посмотреть сообщение
AFAIK you can only give bots weapons on record, meaning the weapon the bot holds is also recorded (=the weapon the recording player holds) and cant be changed on playback.
Awh, crap. Thanks.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)