AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting (https://forums.alliedmods.net/forumdisplay.php?f=107)
-   -   get player weapons before round end? (https://forums.alliedmods.net/showthread.php?t=294569)

ambn 03-02-2017 07:03

get player weapons before round end?
 
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?

sdz 03-02-2017 09:16

Re: get player weapons before round end?
 
  • 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

ambn 03-02-2017 09:45

Re: get player weapons before round end?
 
Hmm , well nice job! i have some sort of same idea but yours look better than mine :D
i'll try that and if i could handle it . i'll share it and if i didn't i'll ask again :D

Mitchell 03-02-2017 09:51

Re: get player weapons before round end?
 
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

ambn 03-02-2017 10:49

Re: get player weapons before round end?
 
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 03-02-2017 14:21

Re: get player weapons before round end?
 
Can any one tell me what's wrong with it or any better way?
Spoiler

OSWO 03-02-2017 22:22

Re: get player weapons before round end?
 
PlayerItems[MAXPLAYERS+1][4]

Chaosxk 03-03-2017 03:10

Re: get player weapons before round end?
 
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;

c00lio 03-03-2017 05:13

Re: get player weapons before round end?
 
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

OSWO 03-03-2017 05:16

Re: get player weapons before round end?
 
Slot 0 = Primary, why do you exactly not want to check the Primary Slot?


All times are GMT -4. The time now is 02:06.

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