AlliedModders

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

M E R T 01-21-2019 15:18

HELP
 
[en]
Hello guys, i want help.
i want to add 250 hp for T how to add?
"sorry, my english is very bad."

[tr]
Her el başlangıcında T'ye 250 hp nasıl verebilirim?
Aşağıdaki koda nasıl ekleyebilirim?

#include < amxmodx >
#include < cstrike >
#include < fun >
#include < hamsandwich >

public plugin_init( )
{
register_plugin( "DeathrunMod", "v1.2", "makar" )

RegisterHam( Ham_Spawn, "player", "Spawn", true );

}

public Spawn( id )
{
if( is_user_alive( id ) && cs_get_user_team( id ) == CS_TEAM_T)
{
strip_user_weapons( id )
give_item( id, "weapon_knife" )
give_item( id, "item_kevlar" )
give_item( id, "weapon_hegrenade" )
give_item( id, "weapon_smokegrenade" )
give_item( id, "weapon_glock18" )
give_item( id, "weapon_glock18" )
give_item( id, "weapon_glock18" )
give_item( id, "weapon_mp5navy" )
give_item( id, "weapon_mp5navy" )
give_item( id, "weapon_mp5navy" )
}
}

eat1k 01-21-2019 15:48

Re: HELP
 
Why do you use give_item too often? Just use rg_set_user_bpammo (ReAPI) / cs_set_user_bpammo (cstrike).
Regarding the topic, you can use one of these:
PHP Code:

set_user_health(id250);
fm_set_user_health(id250);
set_pev(idpev_health250.0);
set_entvar(idvar_health250.0); 


M E R T 01-21-2019 15:57

Re: HELP
 
Hello i don't know edit. do you edit my code? thanks

E1_531G 01-21-2019 16:16

Re: HELP
 
Quote:

Originally Posted by M E R T (Post 2635836)
Hello i don't know edit. do you edit my code? thanks

When, you know, POST IN THE RIGHT SECTION!

M E R T 01-21-2019 16:20

Re: HELP
 
hello please help me do you edit my code? thanks

M E R T 01-21-2019 16:36

Re: HELP
 
hello not working.

public Spawn( id )
{
if( is_user_alive( id ) && cs_get_user_team( id ) == CS_TEAM_T)
{
strip_user_weapons( id )
set_user_health(id, 250)
give_item( id, "weapon_knife" )
give_item( id, "item_kevlar" )
give_item( id, "weapon_hegrenade" )
give_item( id, "weapon_smokegrenade" )
give_item( id, "weapon_glock18" )
give_item( id, "weapon_glock18" )
give_item( id, "weapon_glock18" )
give_item( id, "weapon_mp5navy" )
give_item( id, "weapon_mp5navy" )
give_item( id, "weapon_mp5navy" )
}
}

E1_531G 01-21-2019 17:10

Re: HELP
 
Well, you try, it's good.

So, you have #include fun and set_user_health(id, 250). It must work.
If it doesn't work, this means that another plugin changes player health.
Put this plugin on the last line in plugins.ini.

M E R T 01-21-2019 17:23

Re: HELP
 
Hello please edit my code...
this code is not working because my server is crash
how to fix?

#include < amxmodx >
#include < cstrike >
#include < fun >
#include < hamsandwich >

public plugin_init( )
{
register_plugin( "DeathrunMod", "v1.2", "makar" )

RegisterHam( Ham_Spawn, "player", "Spawn", true );

}

public Spawn( id )
{
if( is_user_alive( id ) && cs_get_user_team( id ) == CS_TEAM_T)
{
strip_user_weapons( id )
set_user_health(id, 250)

give_item( id, "weapon_knife" )
give_item( id, "item_kevlar" )
give_item( id, "weapon_hegrenade" )
give_item( id, "weapon_smokegrenade" )
give_item( id, "weapon_glock18" )
give_item( id, "weapon_glock18" )
give_item( id, "weapon_glock18" )
give_item( id, "weapon_mp5navy" )
give_item( id, "weapon_mp5navy" )
give_item( id, "weapon_mp5navy" )
}
}

OciXCrom 01-21-2019 17:57

Re: HELP
 
The server can't crash because of that code. Why are you giving the same weapon multiple times? Why is your thread named HELP?

M E R T 01-21-2019 18:00

Re: HELP
 
Ocix do you understand me??
i don't know edit.. This code i am find ....
i tell your help me.. how to fix? okay????


All times are GMT -4. The time now is 07:32.

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