AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Error in logs (https://forums.alliedmods.net/showthread.php?t=84923)

sb123 02-03-2009 00:05

Error in logs
 
I use this plugins error
L 02/03/2009 - 13:00:29: [AMXX] Displaying debug trace (plugin "loadingsong.amxx")
L 02/03/2009 - 13:00:29: [AMXX] Run time error 4: index out of bounds
L 02/03/2009 - 13:00:29: [AMXX] [0] loadingsong.sma::song (line 64)
L 02/03/2009 - 13:00:30: [AMXX] Displaying debug trace (plugin "loadingsong.amxx")
L 02/03/2009 - 13:00:30: [AMXX] Run time error 4: index out of bounds
L 02/03/2009 - 13:00:30: [AMXX] [0] loadingsong.sma::song (line 64)
L 02/03/2009 - 13:00:33: [AMXX] Displaying debug trace (plugin "loadingsong.amxx")
L 02/03/2009 - 13:00:33: [AMXX] Run time error 4: index out of bounds
L 02/03/2009 - 13:00:33: [AMXX] [0] loadingsong.sma::song (line 64)
L 02/03/2009 - 13:00:34: [AMXX] Displaying debug trace (plugin "loadingsong.amxx")
L 02/03/2009 - 13:00:34: [AMXX] Run time error 4: index out of bounds
L 02/03/2009 - 13:00:34: [AMXX] [0] loadingsong.sma::song (line 75)
L 02/03/2009 - 13:00:36: [AMXX] Displaying debug trace (plugin "loadingsong.amxx")
L 02/03/2009 - 13:00:36: [AMXX] Run time error 4: index out of bounds
L 02/03/2009 - 13:00:36: [AMXX] [0] loadingsong.sma::song (line 75)
L 02/03/2009 - 13:00:38: [AMXX] Displaying debug trace (plugin "loadingsong.amxx")
L 02/03/2009 - 13:00:38: [AMXX] Run time error 4: index out of bounds
L 02/03/2009 - 13:00:38: [AMXX] [0] loadingsong.sma::song (line 75)

code:

PHP Code:

//Loading Music Also In Spectator Mode
//by Torch
//MP3 ONLY
//Copy MP3 file to sound/misc/loading.mp3
//Music will still play after the player has joined server until he chooses a team.
//Music will start playing again if the person goes back to spectator mode
//(not DEAD spectator, only Team Select>Spectator)
#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#define Maxsounds 1
new bool:playing[32]
new 
soundlist[Maxsounds][] = {"moonlight_shadow"}
public 
plugin_init() { 
 
register_plugin("Loading Song","1.0","Torch")
 
register_event"ResetHUD""song","b" )
 
register_event("TextMsg","song","b","2&#Spec_Mode")
 return 
PLUGIN_CONTINUE 
}
public 
plugin_precache() {
 
precache_sound("misc/moonlight_shadow.mp3")
 return 
PLUGIN_CONTINUE 
}
public 
client_connect(id) {
 
play_song(id)
 return 
PLUGIN_CONTINUE

public 
play_song(id) {
 new 
i
 i 
random_num(0,Maxsounds-1)
 
client_cmd(id,"mp3 loop sound/misc/%s.mp3",soundlist[i])
 return 
PLUGIN_HANDLED

public 
play_song_task(params[],id) {
 new 
player params[0]
 new 
i
 i 
random_num(0,Maxsounds-1)
 
client_cmd(player,"mp3 loop sound/misc/%s.mp3",soundlist[i])
 return 
PLUGIN_HANDLED
}
public 
song() {
 new 
CsTeams:team 
 
 
for(new id 1id <= 32id++)
 {
  if(!
is_user_connected(id))
  {
   continue
  }
  
  
team cs_get_user_team(id)
  
  if ((
team==CS_TEAM_SPECTATOR)||(team==CS_TEAM_UNASSIGNED))
  {
   if (
playing[id]==false)
   {
    new 
params[1]
    
params[0]=id
    set_task
(0.1,"play_song_task",0,params,1,"a",1)
    
playing[id]=true
   
}
  }
  else
  {
   
client_cmd(id,"mp3 stop")
   
playing[id]=false
  

 }
 return 
PLUGIN_CONTINUE



Exolent[jNr] 02-03-2009 14:31

Re: Error in logs
 
PHP Code:

new bool:playing[32

:arrow:
PHP Code:

new bool:playing[33


sb123 02-04-2009 01:12

Re: Error in logs
 
Thank you very much for the answer
thx Exolent[jNr]


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

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