AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   vesthelm at player spawn (https://forums.alliedmods.net/showthread.php?t=152965)

elplouk 03-17-2011 02:18

vesthelm at player spawn
 
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 !

ConnorMcLeod 03-17-2011 03:22

Re: vesthelm at player spawn
 
Check first if the player is alive.

elplouk 03-17-2011 14:13

Re: vesthelm at player spawn
 
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)
}
}


lgund 03-17-2011 14:58

Re: vesthelm at player spawn
 
i donīt know but try this in your plugin_init()

Code:

RegisterHam(Ham_Spawn, "player", "Player_Spawn", 1)

ConnorMcLeod 03-17-2011 15:29

Re: vesthelm at player spawn
 
http://forums.alliedmods.net/showthread.php?p=806660



Quote:

Originally Posted by lgund (Post 1434886)
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.


All times are GMT -4. The time now is 14:29.

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