AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting (https://forums.alliedmods.net/forumdisplay.php?f=107)
-   -   DropPlayerItem (https://forums.alliedmods.net/showthread.php?t=89028)

Xaphan 04-01-2009 04:55

DropPlayerItem
 
DropPlayerItem doesn't exist?

Any other way to drop weapon without using any of the below commands?
FakeClientCommand/FakeClientCommandEx or RemovePlayerItem

I would like to drop.

PHP Code:

new g_PrimaryWeapon = -1;
#define CS_SLOT_PRIMARY 0

g_PrimaryWeapon GetPlayerWeaponSlot(clientCS_SLOT_PRIMARY);

if (
g_PrimaryWeapon != -1)
{
    
decl StringPrimaryWeapon_Name[64];
    
GetEdictClassname(g_PrimaryWeaponPrimaryWeapon_Namesizeof(PrimaryWeapon_Name));
    
//RemovePlayerItem(client, g_PrimaryWeapon);
    //FakeClientCommand(client, "drop g_PrimaryWeapon");
    //FakeClientCommandEx(client, "drop g_PrimaryWeapon");

    
DropPlayerItem(clientg_PrimaryWeapon);

    return 
true;



SAMURAI16 04-01-2009 10:17

Re: DropPlayerItem
 
command is only only "drop". Get client's weapon, check if weapon is what you want and then FakeClientCommandEx(client,"drop");

There is another way, using a signature. Take a look at Liam's plugin : http://forums.alliedmods.net/showthread.php?p=611885

Xaphan 04-01-2009 12:14

Re: DropPlayerItem
 
Thanks for the info SAMURAI16
Using a signature (Liam's way) worked perfect.
I knew DropPlayerItem would be too easy... ;)


All times are GMT -4. The time now is 21:48.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.