AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   How to save the weapons of a player and give them again in another round? (https://forums.alliedmods.net/showthread.php?t=89980)

alan_el_more 04-12-2009 16:27

How to save the weapons of a player and give them again in another round?
 
How to save the weapons of a player and give them again in another round?
thanks in advance :D

ConnorMcLeod 04-12-2009 16:28

Re: How to save the weapons of a player and give them again in another round?
 
Save them in a global var by using get_user_weapons.

Nextra 04-12-2009 16:30

Re: How to save the weapons of a player and give them again in another round?
 
Look into one of the WC3 Mods, the "Ankh" items could help.

Starsailor 04-12-2009 21:12

Re: How to save the weapons of a player and give them again in another round?
 
PHP Code:

new weapons[32],weapnum,weapid,weapname[32]

/*save weapons*/
get_user_weapons(id,weapons,weapnum)



/*Load weapons*/
for(new 0weapnumi++)
{
    
weapid weapons[i];
    
get_weaponname(weapid,weapname,31)
    
give_item(id,weapname)



alan_el_more 04-12-2009 22:29

Re: How to save the weapons of a player and give them again in another round?
 
Quote:

Originally Posted by Starsailor (Post 804179)
PHP Code:

new weapons[32],weapnum,weapid,weapname[32]

/*save weapons*/
get_user_weapons(id,weapons,weapnum)



/*Load weapons*/
for(new 0weapnumi++)
{
    
weapid weapons[i];
    
get_weaponname(weapid,weapname,31)
    
give_item(id,weapname)



thanks, i try it :D

ConnorMcLeod 04-13-2009 03:59

Re: How to save the weapons of a player and give them again in another round?
 
Quote:

Originally Posted by Starsailor (Post 804179)
PHP Code:

new weapons[32],weapnum,weapid,weapname[32]

/*save weapons*/
get_user_weapons(id,weapons,weapnum)



/*Load weapons*/
for(new 0weapnumi++)
{
    
get_weaponname(weapons[i],weapname,31)
    
give_item(id,weapname)



You can directly pass weapons[i] as it is used only 1 time.


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

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