AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Run time error 10 cs_set_user_money (https://forums.alliedmods.net/showthread.php?t=84574)

kevin14144 01-28-2009 11:03

Run time error 10 cs_set_user_money
 
1 Attachment(s)
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.

Owyn 01-28-2009 11:04

Re: Run time error 10 cs_set_user_money
 
enable debug first

SnoW 01-28-2009 11:12

Re: Run time error 10 cs_set_user_money
 
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")
  }
 }
}


kevin14144 01-28-2009 11:14

Re: Run time error 10 cs_set_user_money
 
Quote:

Originally Posted by .Owyn. (Post 751634)
enable debug first

It mean to write in plugins.in ?

EX: asddebug.amxx ?

YamiKaitou 01-28-2009 11:15

Re: Run time error 10 cs_set_user_money
 
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 (Post 751644)
It mean to write in plugins.in ?

EX: asddebug.amxx ?

Quote:

Originally Posted by kevin14144 (Post 751633)
L 01/29/2009 - 00:01:40: [AMXX] To enable debug mode, add "debug" after the plugin name in plugins.ini (without quotes)


SnoW 01-28-2009 11:16

Re: Run time error 10 cs_set_user_money
 
Code:

yourplugin.amxx debug
Quote:

Originally Posted by YamiKaitou (Post 751647)
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. :mrgreen:
Edited code ya.

kevin14144 01-28-2009 11:17

Re: Run time error 10 cs_set_user_money
 
Quote:

Originally Posted by SnoW (Post 751643)
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 01-28-2009 11:21

Re: Run time error 10 cs_set_user_money
 
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)

YamiKaitou 01-28-2009 11:25

Re: Run time error 10 cs_set_user_money
 
Use the updated code?

kevin14144 01-28-2009 11:28

Re: Run time error 10 cs_set_user_money
 
Quote:

Originally Posted by YamiKaitou (Post 751655)
Use the updated code?

What it is ?


All times are GMT -4. The time now is 01:45.

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