Raised This Month: $ Target: $400
 0% 

Run time error 10 cs_set_user_money


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
kevin14144
Member
Join Date: Jul 2007
Old 01-28-2009 , 11:03   Run time error 10 cs_set_user_money
Reply With Quote #1

why it show at my sv ?


L 01/29/2009 - 00:01:40: [CSTRIKE] Player out of range (0)
L 01/29/2009 - 00:01:40: [AMXX] Run time error 10 (plugin "asd.amxx") (native "cs_set_user_money") - debug not enabled!
L 01/29/2009 - 00:01:40: [AMXX] To enable debug mode, add "debug" after the plugin name in plugins.ini (without quotes).


I don't know .

Show my sma

It no problem.
Attached Files
File Type: sma Get Plugin or Get Source (asd.sma - 838 views - 932 Bytes)
kevin14144 is offline
Owyn
Veteran Member
Join Date: Nov 2007
Old 01-28-2009 , 11:04   Re: Run time error 10 cs_set_user_money
Reply With Quote #2

enable debug first
Owyn is offline
Send a message via ICQ to Owyn
SnoW
Veteran Member
Join Date: Oct 2008
Location: Finland WisdomNuggets: 8
Old 01-28-2009 , 11:12   Re: Run time error 10 cs_set_user_money
Reply With Quote #3

You can't pass player's id to roundstart event, it's global, so just loop them:
Code:
/* Plugin generated by AMXX-Studio */
#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <fun>
#define PLUGIN "New Plug-In"
#define VERSION "1.0"
#define AUTHOR "kevin14144"
#define DEBUG
new max_players;
public plugin_init() 
{
        register_plugin(PLUGIN, VERSION, AUTHOR)
        register_logevent("GiveAwp", 2, "1=Round_Start")
        max_players = get_maxplayers();
}
 
public GiveAwp()
{
 for(new player = 1; player <= max_players; player++)
 {
   if(is_user_alive(player))
   {       
  cs_set_user_money(player,0)
  strip_user_weapons (player)
  give_item(player, "weapon_hegrenade")
  give_item(player, "weapon_knife")
  give_item(player, "weapon_awp")
  give_item(player, "ammo_338magnum")
  give_item(player, "ammo_338magnum")
  give_item(player, "ammo_338magnum")
  give_item(player, "item_kevlar")
  give_item(player, "item_assaultsuit")
  give_item(player, "item_thighpack")
  }
 }
}

Last edited by SnoW; 01-28-2009 at 11:18.
SnoW is offline
Send a message via MSN to SnoW
kevin14144
Member
Join Date: Jul 2007
Old 01-28-2009 , 11:17   Re: Run time error 10 cs_set_user_money
Reply With Quote #4

Quote:
Originally Posted by SnoW View Post
You can't pass player's id to roundstart event, it's global, so just loop them:
Code:
/* Plugin generated by AMXX-Studio */
#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <fun>
#define PLUGIN "New Plug-In"
#define VERSION "1.0"
#define AUTHOR "kevin14144"
#define DEBUG
new max_players;
public plugin_init() 
{
        register_plugin(PLUGIN, VERSION, AUTHOR)
        register_logevent("GiveAwp", 2, "1=Round_Start")
        max_players = get_maxplayers();
}
 
public GiveAwp()
{
 for(new player = 1; player <= max_players; player++)
 {
  cs_set_user_money(player,0)
  strip_user_weapons (player)
  give_item(player, "weapon_hegrenade")
  give_item(player, "weapon_knife")
  give_item(player, "weapon_awp")
  give_item(player, "ammo_338magnum")
  give_item(player, "ammo_338magnum")
  give_item(player, "ammo_338magnum")
  give_item(player, "item_kevlar")
  give_item(player, "item_assaultsuit")
  give_item(player, "item_thighpack")
 }
}
No use .

It also show Run time error 10 (plugin "asd.amxx") (native "cs_set_user_money") - debug not enabled!
kevin14144 is offline
kevin14144
Member
Join Date: Jul 2007
Old 01-28-2009 , 11:21   Re: Run time error 10 cs_set_user_money
Reply With Quote #5

This it after debug.


L 01/29/2009 - 00:20:03: [CSTRIKE] Invalid player 1
L 01/29/2009 - 00:20:03: [AMXX] Displaying debug trace (plugin "asd.amxx")
L 01/29/2009 - 00:20:03: [AMXX] Run time error 10: native error (native "cs_set_user_money")
L 01/29/2009 - 00:20:03: [AMXX] [0] asd.sma::GiveAwp (line 22)
kevin14144 is offline
kevin14144
Member
Join Date: Jul 2007
Old 01-28-2009 , 11:14   Re: Run time error 10 cs_set_user_money
Reply With Quote #6

Quote:
Originally Posted by .Owyn. View Post
enable debug first
It mean to write in plugins.in ?

EX: asddebug.amxx ?
kevin14144 is offline
YamiKaitou
Has a lovely bunch of coconuts
Join Date: Apr 2006
Location: Texas
Old 01-28-2009 , 11:15   Re: Run time error 10 cs_set_user_money
Reply With Quote #7

You need to check and see if the player exists in the server Snow, otherwise you will get 11 run time errors for each non-existing client

Quote:
Originally Posted by kevin14144 View Post
It mean to write in plugins.in ?

EX: asddebug.amxx ?
Quote:
Originally Posted by kevin14144 View Post
L 01/29/2009 - 00:01:40: [AMXX] To enable debug mode, add "debug" after the plugin name in plugins.ini (without quotes)
__________________
ProjectYami Laboratories

I do not browse the forums regularly anymore. If you need me for anything (asking questions or anything else), then PM me (be descriptive in your PM, message containing only a link to a thread will be ignored).
YamiKaitou is offline
SnoW
Veteran Member
Join Date: Oct 2008
Location: Finland WisdomNuggets: 8
Old 01-28-2009 , 11:16   Re: Run time error 10 cs_set_user_money
Reply With Quote #8

Code:
yourplugin.amxx debug
Quote:
Originally Posted by YamiKaitou View Post
You need to check and see if the player exists in the server Snow, otherwise you will get 11 run time errors for each non-existing client
My bad, just looped players, didn't even look what it does to them or anything.
Edited code ya.

Last edited by SnoW; 01-28-2009 at 11:19.
SnoW is offline
Send a message via MSN to SnoW
YamiKaitou
Has a lovely bunch of coconuts
Join Date: Apr 2006
Location: Texas
Old 01-28-2009 , 11:25   Re: Run time error 10 cs_set_user_money
Reply With Quote #9

Use the updated code?
__________________
ProjectYami Laboratories

I do not browse the forums regularly anymore. If you need me for anything (asking questions or anything else), then PM me (be descriptive in your PM, message containing only a link to a thread will be ignored).
YamiKaitou is offline
kevin14144
Member
Join Date: Jul 2007
Old 01-28-2009 , 11:28   Re: Run time error 10 cs_set_user_money
Reply With Quote #10

Quote:
Originally Posted by YamiKaitou View Post
Use the updated code?
What it is ?
kevin14144 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 01:45.


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