11.10.2010, 12:08
How do I give a bot a weapon/make him hold one?
This is my code, and no weapon shows up in-game:
Help is appreciated.
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;
}