Quote:
Originally Posted by Drixevel
Code:
for (int i = 1; i <= MaxClients; i++)
{
if (!IsClientInGame(i) || !IsPlayerAlive(i))
continue;
GivePlayerItem(i, "katana");
GivePlayerItem(i, "rifle_ak47");
}
Assuming those entity names are correct, this should give those items to all players that can accept them.
|
The compilation went well.
But this doesn't work in game.
Code:
#include <sdktools>
GivePlayerItem(i, "katana");
GivePlayerItem(i, "weapon_ak47");
And these code works well.
Code:
int iCmdFlags = GetCommandFlags("give");
SetCommandFlags("give", iCmdFlags & ~FCVAR_CHEAT);
FakeClientCommand(playerindex, "give katana");
FakeClientCommand(playerindex, "give rifle_ak47");
SetCommandFlags("give", iCmdFlags);
I wonder if "GivePlayerItem" doesn't work in l4d2?