SA-MP Forums Archive
Giving a bot a weapon? - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Giving a bot a weapon? (/showthread.php?tid=182553)



Giving a bot a weapon? - CrucixTM - 11.10.2010

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.


Re: Giving a bot a weapon? - Mauzen - 11.10.2010

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.


Re: Giving a bot a weapon? - CrucixTM - 11.10.2010

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.