|
Good Little Panda
|
09-07-2013
, 05:52
Re: [CSGO] GivePlayerItem weapon_c4
|
#4
|
Try using the 1.5 snapshot branch instead; 1.6 still has experimental changes. And I'll just leave this here, I was bored.
Spoiler
PHP Code:
public Action:CS_OnCSWeaponDrop(client, weapon) { if(!IsValidEdict(weapon) || !IsClientInGame(client) || !IsPlayerAlive(client)) return Plugin_Continue;
decl String:sWeapon[32]; GetEdictClassname(weapon, sWeapon, sizeof(sWeapon)); if(!StrEqual(sWeapon, "weapon_c4")) return Plugin_Continue; new Handle:hPack = INVALID_HANDLE; CreateDataTimer(0.1, Timer_DropBomb, hPack); WritePackCell(hPack, GetClientUserId(client)); WritePackCell(hPack, EntIndexToEntRef(weapon));
return Plugin_Continue; }
public Action:Timer_DropBomb(Handle:timer, Handle:pack) { ResetPack(pack); new client = GetClientOfUserId(ReadPackCell(pack)); new entity = EntRefToEntIndex(ReadPackCell(pack)); if(entity != INVALID_ENT_REFERENCE) AcceptEntityInput(entity, "Kill"); if(client && IsPlayerAlive(client) && GetPlayerWeaponSlot(client, CS_SLOT_C4) == -1) GivePlayerItem(client, "weapon_c4"); }
__________________
|
|
|
|