Raised This Month: $75 Target: $400
 18% 

get player weapons before round end?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
ambn
Veteran Member
Join Date: Feb 2015
Location: Fun servers
Old 03-02-2017 , 07:03   get player weapons before round end?
Reply With Quote #1

hello, as the topic says i want to know if anyone can help me making this out?
i want to get players weapon before cs_pre_restart with their ammos and give them back on round_start after an amout of seconds.
is it possible?
__________________
ambn is offline
sdz
Senior Member
Join Date: Feb 2012
Location: United States
Old 03-02-2017 , 09:16   Re: get player weapons before round end?
Reply With Quote #2

  • Make char/string array of clients and store their weapons: char g_sWeapons[MAXPLAYERS + 1][32];
  • Loop through all clients and store weapons in that variable: for(int i = 1; i <= MaxClients; i++)
  • Do whatever you want with that information
__________________
lol
sdz is offline
ambn
Veteran Member
Join Date: Feb 2015
Location: Fun servers
Old 03-02-2017 , 09:45   Re: get player weapons before round end?
Reply With Quote #3

Hmm , well nice job! i have some sort of same idea but yours look better than mine
i'll try that and if i could handle it . i'll share it and if i didn't i'll ask again
__________________
ambn is offline
Mitchell
~lick~
Join Date: Mar 2010
Old 03-02-2017 , 09:51   Re: get player weapons before round end?
Reply With Quote #4

What exactly are you trying to accomplish with this? Seems a little risky with removing player's weapons on round_prestart.
Edit: if you are wanted to prevent weapon shooting or something you could always look at: https://forums.alliedmods.net/showthread.php?p=2493284
__________________

Last edited by Mitchell; 03-02-2017 at 09:56.
Mitchell is offline
ambn
Veteran Member
Join Date: Feb 2015
Location: Fun servers
Old 03-02-2017 , 10:49   Re: get player weapons before round end?
Reply With Quote #5

no actully i have a fix provided with the current arms fix for csgo to apply the fix i remove all players weapons and gave them knife on round start so i want this to store their weapons and give it back to them to use it in this: https://forums.alliedmods.net/showthread.php?p=2494839
__________________
ambn is offline
ambn
Veteran Member
Join Date: Feb 2015
Location: Fun servers
Old 03-02-2017 , 14:21   Re: get player weapons before round end?
Reply With Quote #6

Can any one tell me what's wrong with it or any better way?
Spoiler
__________________

Last edited by ambn; 03-02-2017 at 14:21.
ambn is offline
OSWO
Senior Member
Join Date: Jul 2015
Location: United Kingdom, London
Old 03-02-2017 , 22:22   Re: get player weapons before round end?
Reply With Quote #7

PlayerItems[MAXPLAYERS+1][4]
__________________
SourceTimer | WeaponSkins++ | BasePlugins++ https://github.com/OSCAR-WOS

Last edited by OSWO; 03-02-2017 at 22:22.
OSWO is offline
Chaosxk
Veteran Member
Join Date: Aug 2010
Location: Westeros
Old 03-03-2017 , 03:10   Re: get player weapons before round end?
Reply With Quote #8

Also if(IsClientInGame(client) && IsPlayerAlive(client)) before your 2nd iteration, otherwise your iterating five times when you only need to do once.

and int slot = 1;
__________________
Chaosxk is offline
c00lio
Junior Member
Join Date: Feb 2017
Old 03-03-2017 , 05:13   Re: get player weapons before round end?
Reply With Quote #9

Do what ChaosX and OSWO suggested also change for loops to for(int slot = 1; slot <= 4; slot++) since you don't check for or use the value 0
c00lio is offline
OSWO
Senior Member
Join Date: Jul 2015
Location: United Kingdom, London
Old 03-03-2017 , 05:16   Re: get player weapons before round end?
Reply With Quote #10

Slot 0 = Primary, why do you exactly not want to check the Primary Slot?
__________________
SourceTimer | WeaponSkins++ | BasePlugins++ https://github.com/OSCAR-WOS
OSWO is offline
Reply


Thread Tools
Display Modes

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 23:45.


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