AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Add Armor (https://forums.alliedmods.net/showthread.php?t=224414)

Ardonicek 08-24-2013 07:04

Add Armor
 
Hello, i have this:

Code:

if(Level[id] == 10)
    {
        cs_set_user_armor( id, 5, CS_ARMOR_VESTHELM )
    }

It sets armor to 5 every round, but i need to add +5 armor every round with maximum of 100 armor.

Thanks.

Black Rose 08-24-2013 07:13

Re: Add Armor
 
cs_get_user_armor()+5

Ardonicek 08-24-2013 07:20

Re: Add Armor
 
Doesn't work.

Error: Number of arguments does not match definition on line 567

simanovich 08-24-2013 08:00

Re: Add Armor
 
PHP Code:

cs_set_user_armor(id, (cs_get_user_armor(id) + 5), CS_ARMOR_VESTHELM); 


Black Rose 08-24-2013 08:11

Re: Add Armor
 
It was an example, you were supposed to look up the function.

Ardonicek 08-24-2013 08:13

Re: Add Armor
 
Quote:

Originally Posted by simanovich (Post 2020603)
PHP Code:

cs_set_user_armor(id, (cs_get_user_armor(id) + 5), CS_ARMOR_VESTHELM); 


Doesn't work too, same error, idk why.

Black Rose 08-24-2013 08:16

Re: Add Armor
 
If you look the function up you will find your answer pretty fast.

Winchester90 08-24-2013 08:45

Re: Add Armor
 
Add the include fun

Ardonicek 08-24-2013 09:14

Re: Add Armor
 
#include <amxmodx>
#include <amxmisc>
#include <nvault>
#include <colorchat>
#include <cstrike>
#include <fun>
#include <hamsandwich>
#include <engine>


My includes are okay.

Black Rose 08-24-2013 09:55

Re: Add Armor
 
If you still haven't figured it out...
Code:
new CsArmorType:armortype; cs_set_user_armor(id, cs_get_user_armor(id, armortype) + 5, armortype);


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

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