Raised This Month: $ Target: $400
 0% 

Native error ?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
dreamedward
Senior Member
Join Date: Aug 2010
Location: ZombieWorld
Old 04-11-2011 , 07:43   Native error ?
Reply With Quote #1

Hey,guys. So I have this plugin here. It shows Win Messages to the team who has won. So it compiles, everything is perfect but when I start the server and the round has ended, it doesn't show the Win Message model and the console prints
"[FUN] Player out of range <0> [AMXX] Displaying debug trace <plugun "winmes.amxx"> [AMXX] Run time error 10:native error <native "strip_user_weapons">"
So can somebody help me please? Here is the code:
PHP Code:
#include <amxmodx>
#include <fakemeta>
#include <hamsandwich>
#include <fun>
new const ModelCT[] = "models/winCT.mdl"
new const ModelT[] = "models/winT.mdl"
new bool:TWin[33]
new 
bool:CtWin[33]
public 
plugin_init() {
 
// =================================================
 
register_plugin("Win Messages","1.0","MAD.XayC")
 
// =================================================
 
RegisterHam(Ham_Spawn"player""HAM_spawn"1)
 
// =================================================
 
register_event("SendAudio""ct_win""a""2&%!MRAD_ctwin"
 
register_event("SendAudio""t_win""a""2&%!MRAD_terwin"
 
// =================================================
 
register_event("CurWeapon""curweapon""be""1=1")
 
// =================================================
}
public 
plugin_precache() {
 
precache_model(ModelCT)
 
precache_model(ModelT)
}
public 
client_putinserver(id) {
 
TWin[id] = false
 CtWin
[id] = false
}
public 
HAM_spawn(id) {
 
TWin[id] = false
 CtWin
[id] = false

public 
t_win(id) {
 
strip_user_weapons(id)
 
give_item(id"weapon_knife")
 
CtWin[id] = false
 TWin
[id] = true
}
public 
ct_win(id) {
 
strip_user_weapons(id)
 
give_item(id"weapon_knife")
 
CtWin[id] = true
 TWin
[id] = false
}
public 
curweaponid ) {
 if(
TWin[id] == true)
  
set_pev(idpev_viewmodel2ModelT)
 if(
CtWin[id] == true)
  
set_pev(idpev_viewmodel2ModelCT)

Thanks in advance!
dreamedward is offline
schmurgel1983
Veteran Member
Join Date: Aug 2006
Location: Germany
Old 04-11-2011 , 08:31   Re: Native error ?
Reply With Quote #2

Quote:
Originally Posted by dreamedward View Post
PHP Code:
 register_event("SendAudio""ct_win""a""2&%!MRAD_ctwin"
 
register_event("SendAudio""t_win""a""2&%!MRAD_terwin"
u have register as global, so id is all time 0.

make sure to sent weapon_strip and give_item to all players (1-32)
use a for content

sample:
PHP Code:
new maxplayers get_maxplayers()
for (new 
id 1id <= maxplayersid++)
{
     
// code (but check if ID connected and alive)

__________________

Working on:
nothing
schmurgel1983 is offline
dreamedward
Senior Member
Join Date: Aug 2010
Location: ZombieWorld
Old 04-11-2011 , 10:07   Re: Native error ?
Reply With Quote #3

Added that. Now the models are showed but they dont dissapear after the new round has started they just stay. You can buy a weapon, shoot with it, but the model does not dissapear. Can anyone help about that ?

Last edited by dreamedward; 04-11-2011 at 10:35.
dreamedward is offline
Reply


Thread Tools
Display Modes

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 19:52.


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