Raised This Month: $51 Target: $400
 12% 

Solved How i can drop weapon and instantly switch to another slot?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
ayyyyyyylmao
Junior Member
Join Date: Apr 2018
Old 04-01-2018 , 04:26   How i can drop weapon and instantly switch to another slot?
Reply With Quote #1

Title says all.

Im trying : CS_DropWeapon(client, weapon, false, true); - to drop weapon
and
new weapons = GetPlayerWeaponSlot(client, i);
SetEntPropEnt(client, Prop_Send, "m_hActiveWeapon", weapons); - to switch.
But client drop weapon only if switchig weapons

Last edited by ayyyyyyylmao; 04-02-2018 at 05:43.
ayyyyyyylmao is offline
BraveFox
AlliedModders Donor
Join Date: May 2015
Location: Israel
Old 04-01-2018 , 06:24   Re: How i can drop weapon and instantly switch to another slot?
Reply With Quote #2

Try first to switch and then to drop.
__________________
Contact Me:
Steam: NoyB
Discord: Noy#9999
Taking Private Requests
BraveFox is offline
ayyyyyyylmao
Junior Member
Join Date: Apr 2018
Old 04-01-2018 , 07:00   Re: How i can drop weapon and instantly switch to another slot?
Reply With Quote #3

Quote:
Originally Posted by BraveFox View Post
Try first to switch and then to drop.
Same error.
Can u give code which works? Maybe im doing smth wrong
ayyyyyyylmao is offline
eyal282
Veteran Member
Join Date: Aug 2011
Old 04-01-2018 , 07:04   Re: How i can drop weapon and instantly switch to another slot?
Reply With Quote #4

Quote:
Originally Posted by ayyyyyyylmao View Post
Same error.
Can u give code which works? Maybe im doing smth wrong
You use i as a slot, what is i equal to?
__________________
I am available to make plugins for pay.

Discord: Eyal282#1334
eyal282 is offline
ayyyyyyylmao
Junior Member
Join Date: Apr 2018
Old 04-01-2018 , 07:54   Re: How i can drop weapon and instantly switch to another slot?
Reply With Quote #5

Quote:
Originally Posted by eyal282 View Post
You use i as a slot, what is i equal to?
for (new i = 1; i <= 5;i++)
ayyyyyyylmao is offline
xFlane
AlliedModders Donor
Join Date: Nov 2017
Location: Israel
Old 04-01-2018 , 09:43   Re: How i can drop weapon and instantly switch to another slot?
Reply With Quote #6

PHP Code:

int weapon 
GetPlayerWeaponSlot(clientCS_SLOT_PRIMARY);
CS_DropWeapon(clientweaponfalsetrue);
    
ClientCommand(client"slot%i", (CS_SLOT_KNIFE+1)); 
__________________
Taking private requests.

Last edited by xFlane; 04-01-2018 at 09:44.
xFlane is offline
OSWO
Senior Member
Join Date: Jul 2015
Location: United Kingdom, London
Old 04-01-2018 , 17:35   Re: How i can drop weapon and instantly switch to another slot?
Reply With Quote #7

With these events I'm pretty sure you cannot have multiple "delayed" methods within a single frame, you might encounter problems. Try to Set the active weapon in a RequestFrame function.
__________________
SourceTimer | WeaponSkins++ | BasePlugins++ https://github.com/OSCAR-WOS
OSWO is offline
ayyyyyyylmao
Junior Member
Join Date: Apr 2018
Old 04-02-2018 , 05:43   Re: How i can drop weapon and instantly switch to another slot?
Reply With Quote #8

Quote:
Originally Posted by xFlane View Post
PHP Code:
int weapon GetPlayerWeaponSlot(clientCS_SLOT_PRIMARY); 
new weapon*

Anyway thanks !
// solved
ayyyyyyylmao is offline
BraveFox
AlliedModders Donor
Join Date: May 2015
Location: Israel
Old 04-03-2018 , 12:23   Re: How i can drop weapon and instantly switch to another slot?
Reply With Quote #9

Quote:
Originally Posted by ayyyyyyylmao View Post
new weapon*

Anyway thanks !
// solved
new is the old syntax, int is the new.
__________________
Contact Me:
Steam: NoyB
Discord: Noy#9999
Taking Private Requests
BraveFox is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 18:53.


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