Raised This Month: $ Target: $400
 0% 

vesthelm at player spawn


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
elplouk
Member
Join Date: Aug 2009
Location: France
Old 03-17-2011 , 02:18   vesthelm at player spawn
Reply With Quote #1

Hi guys !

I need help with a plugin that gives players kevlar+helmet everytime they spawn on my deathmatch server. This plugin gives error messages like :

L 03/15/2011 - 19:24:02: [CSTRIKE] Invalid player 4
L 03/15/2011 - 19:24:02: [AMXX] Run time error 10 (plugin "kevlar.amxx") (native
"cs_set_user_armor") - debug not enabled!
L 03/15/2011 - 19:24:02: [AMXX] To enable debug mode, add "debug" after the plug
in name in plugins.ini (without quotes).


Maybe, this bug could be fixed ? Here's the code :
Code:
#include <amxmodx>
#include <hamsandwich>
#include <cstrike>
#include <fun>

public plugin_init() 
{
    register_plugin("Drop Kevlar", "1.0", "unknown")
    RegisterHam(Ham_Spawn, "player", "ham_PlayerSpawn_Post", 1)
}

public ham_PlayerSpawn_Post(id)
{
cs_set_user_armor(id, 100, CS_ARMOR_VESTHELM)
}
Thanks !
elplouk is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 03-17-2011 , 03:22   Re: vesthelm at player spawn
Reply With Quote #2

Check first if the player is alive.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
elplouk
Member
Join Date: Aug 2009
Location: France
Old 03-17-2011 , 14:13   Re: vesthelm at player spawn
Reply With Quote #3

Is this one better ?

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

new dm_kevlar

public plugin_init() 
{
register_plugin("Drop kevlar", "1.0", "unknown")
RegisterHam(Ham_Spawn, "player", "Ham_Spawn_Post", true)

dm_kevlar = register_cvar("dm_kevlar_val", "100")
}

public Ham_Spawn_Post(id)
{
if( is_user_alive(id) )
{
new kevlar = get_pcvar_num(dm_kevlar)
cs_set_user_armor(id, kevlar, CS_ARMOR_VESTHELM)
}
}
elplouk is offline
lgund
Senior Member
Join Date: Jul 2009
Location: Berlin
Old 03-17-2011 , 14:58   Re: vesthelm at player spawn
Reply With Quote #4

i donīt know but try this in your plugin_init()

Code:
RegisterHam(Ham_Spawn, "player", "Player_Spawn", 1)
__________________
You need help on Coding ?? Look on my Homepage: http://First-Coder.de/
You want FUN in Counter-Strike ;) ?? Look on my Community:
http://deathmanns.first-coder.de/
lgund is offline
Send a message via MSN to lgund Send a message via Skype™ to lgund
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 03-17-2011 , 15:29   Re: vesthelm at player spawn
Reply With Quote #5

http://forums.alliedmods.net/showthread.php?p=806660



Quote:
Originally Posted by lgund View Post
i donīt know but try this in your plugin_init()

Code:
RegisterHam(Ham_Spawn, "player", "Player_Spawn", 1)
It is the same, true == 1 and false == 0.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod 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 14:29.


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