Raised This Month: $ Target: $400
 0% 

Wath this error means?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
benamo6
Veteran Member
Join Date: Aug 2008
Location: NeverLand
Old 03-06-2010 , 11:54   Wath this error means?
Reply With Quote #1

Error: Declaration of a local variable must appear in a compound block on line 37
This is the code
PHP Code:
/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <amxmisc>
#include <engine>
#include <fun>
#include <cstrike>

#define PLUGIN "New Plug-In"
#define VERSION "1.0"
#define AUTHOR "author"
new HasPrize[33][2];

public 
plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
register_clcmd("say /drunk","drunk")
}
public 
client_putinserver(id)
{
    
HasPrize[id][0] = 0;
    
HasPrize[id][1] = 0;
}
public 
client_disconnect(id)
{
    
HasPrize[id][0] = 0;
    
HasPrize[id][1] = 0;
}
public 
drunk(id)
{
    new 
tid[1];
    
tid[0] = id;
    
set_task(0.5,"smokin_1",0,tid,1,"a",HasPrize[id][1]*2);
}
public 
smokin_1(id[])
{
    if( (
is_user_alive(id[0])))
        new 
vec[3], cmd[16];
        new 
a,by1,dfov,x1;
        
        
x1 random_num(-40,40);
        
y1 random_num(-40,40);
        
dcounter[id[0]] += 1;
        
get_user_origin(id[0],vec);
        
        
//Smoke    
        
message_beginMSG_BROADCAST,SVC_TEMPENTITY);
        
write_byte);
        
write_coord(vec[0]+x1);
        
write_coord(vec[1]+y1);
        
write_coord(vec[2]+30);
        
write_shortsprSmoke );
        
write_byte30 );
        
write_byte10 );
        
message_end();
        
        
dfov random_num(10,120);
        
format(cmd,15,"default_fov %d",dfov);        
        
client_cmd(id[0],cmd);
        
        if(
moved[id[0]] == 1)
        {
            
client_cmd(id[0],"-moveleft;-moveright;-forward;-back");
            
moved[id[0]] = 0;
        }
        
        
random_num(0,9);
        
        if(
== 1)
        {
            
emit_sound(id[0],CHAN_ITEM"misc/burp.wav"1.0ATTN_NORM0PITCH_NORM);
            
random_num(0,3);            
            
client_cmd(id[0],moves[a]);
            
moved[id[0]] = 1;
            new 
aimvec[3];
            new 
velocityvec[3];
            new 
length
            new 
speed 500;
            
get_user_origin(id[0],aimvec,2);
            
velocityvec[0]=aimvec[0]-vec[0];
            
velocityvec[1]=aimvec[1]-vec[1];
            
velocityvec[2]=aimvec[2]-vec[2];
            
length=sqrt(velocityvec[0]*velocityvec[0]+velocityvec[1]*velocityvec[1]+velocityvec[2]*velocityvec[2]);
            
velocityvec[0]=velocityvec[0]*speed/length;
            
velocityvec[1]=velocityvec[1]*speed/length;
            
velocityvec[2]=velocityvec[2]*speed/length;
            
            
// TE_MODEL from HL-SDK common/const.h 
            
message_begin(MSG_BROADCAST,SVC_TEMPENTITY);
            
write_byte(106);
            
write_coord(vec[0]);
            
write_coord(vec[1]);
            
write_coord(vec[2]+20);
            
write_coord(velocityvec[0]);
            
write_coord(velocityvec[1]);
            
write_coord(velocityvec[2]+100);
            
write_angle (0);
            if(
random(8) == 4)
                
write_short (mdlWbottle);
            else 
                
write_short (mdlWcan);
            
write_byte (2);
            
write_byte (255);
            
message_end();
        }
    }
    
    
    if(
moved[id[0]] == 1)
    {
        
client_cmd(id[0],"-moveleft;-moveright;-forward;-back");
        
        
client_cmd(id[0],"default_fov 90");
    }
    
    return 
PLUGIN_CONTINUE;

__________________
Please help me with this Thread
I am 70% addicted to Counterstrike. What about you?
Ill make any spanish translation of a plugin. Just ask for it
benamo6 is offline
Send a message via MSN to benamo6
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 03-06-2010 , 11:58   Re: Wath this error means?
Reply With Quote #2

Need one of these

Code:
public smokin_1(id[]) {     if( (is_user_alive(id[0])))     {         new vec[3], cmd[16];
__________________
Bugsy is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 03-06-2010 , 11:58   Re: Wath this error means?
Reply With Quote #3

PHP Code:
    if( (is_user_alive(id[0])))
    {
        new 
vec[3], cmd[16]; 
EDIT:

Bugsy
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] 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 08:47.


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