Raised This Month: $ Target: $400
 0% 

save extra items weapon in next round


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
strahh
Junior Member
Join Date: Mar 2022
Old 03-10-2022 , 07:09   save extra items weapon in next round
Reply With Quote #1

Hello everyone, there is an extra aitem frost m4a1, the problem is that at the beginning of a new round, only the model remains, the gun itself becomes default, please help to make sure that the purchased weapon always remains, even if another player picks it up in another round

It is also interesting to find out which function or string is responsible for ensuring that the main weapon is the same and when buying extra items weapon, the current weapon is thrown out if it main


I tried to remove Remove Entity(id) and changed true/false, but I understand too little about this
Quote:
public zp_user_humanized_post(id)
{
g_bHasFrostM4A1[id] = false
g_iDmg[id] = 0
RemoveEntity(id)
}

public event_round_start()
{
for (new i = 1; i <= g_iMaxPlayers; i++)
{
g_bHasFrostM4A1 = false
g_bIsFrozen = false
g_iDmg = 0

if(is_user_alive(i))
{
Remove_Rendering(i)
}
}
}
Attached Files
File Type: sma Get Plugin or Get Source (zp_frost_m4a11.sma - 104 views - 15.8 KB)

Last edited by strahh; 03-10-2022 at 07:10.
strahh is offline
zXCaptainXz
Member
Join Date: May 2017
Old 03-10-2022 , 12:49   Re: save extra items weapon in next round
Reply With Quote #2

If you change false to true, then everyone will have the M4, instead you should just remove the whole "false" line. Try this please:

Code:
public zp_user_humanized_post(id)
{
g_iDmg[id] = 0
}

public event_round_start()
{
for (new i = 1; i <= g_iMaxPlayers; i++)
{
g_bIsFrozen[i]= false
g_iDmg[i] = 0

if(is_user_alive(i))
{
Remove_Rendering(i)
}
}
}

Last edited by zXCaptainXz; 03-10-2022 at 17:42. Reason: Fixed
zXCaptainXz is offline
strahh
Junior Member
Join Date: Mar 2022
Old 03-10-2022 , 14:15   Re: save extra items weapon in next round
Reply With Quote #3

Quote:
Originally Posted by zXCaptainXz View Post
If you change false to true, then everyone will have the M4, instead you should just remove the whole "false" line. Try this please:

Code:
public zp_user_humanized_post(id)
{
g_iDmg[id] = 0
}

public event_round_start()
{
for (new i = 1; i <= g_iMaxPlayers; i++)
{
g_bIsFrozen = false
g_iDmg = 0

if(is_user_alive(i))
{
Remove_Rendering(i)
}
}
}
indicates an error on these lines

(154 -- 155) : error 033: array must be indexed (variable "g_bIsFrozen")
(155 -- 157) : error 033: array must be indexed (variable "g_iDmg")

Last edited by strahh; 03-10-2022 at 14:17.
strahh is offline
zXCaptainXz
Member
Join Date: May 2017
Old 03-10-2022 , 17:43   Re: save extra items weapon in next round
Reply With Quote #4

Quote:
Originally Posted by strahh View Post
indicates an error on these lines

(154 -- 155) : error 033: array must be indexed (variable "g_bIsFrozen")
(155 -- 157) : error 033: array must be indexed (variable "g_iDmg")
Sorry I copied the code as you provided it, didn’t bother to test, it should be correct now in the post above.
zXCaptainXz is offline
strahh
Junior Member
Join Date: Mar 2022
Old 03-11-2022 , 05:54   Re: save extra items weapon in next round
Reply With Quote #5

Quote:
Originally Posted by zXCaptainXz View Post
Sorry I copied the code as you provided it, didn’t bother to test, it should be correct now in the post above.
Yes, it works thanks

If it's not difficult, tell how to make only one main weapon
strahh is offline
zXCaptainXz
Member
Join Date: May 2017
Old 03-11-2022 , 06:07   Re: save extra items weapon in next round
Reply With Quote #6

Quote:
Originally Posted by strahh View Post
Yes, it works thanks

If it's not difficult, tell how to make only one main weapon
Like when you buy a primary weapon, your current primary weapon is dropped so that you always have one weapon? If you have some coding knowledge, it's probably done by hooking Ham_Item_AddToPlayer

Last edited by zXCaptainXz; 03-11-2022 at 06:10.
zXCaptainXz 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 11:37.


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