Raised This Month: $ Target: $400
 0% 

Fixing errors


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
mazmaajinsh
Senior Member
Join Date: Apr 2005
Location: Latvia
Old 02-15-2009 , 08:28   Fixing errors
Reply With Quote #1

Hello. Could somene say to me, whats wrong with this part of the code?
Code:
public checkpoint(id) {     if(get_pcvar_num(kz_checkpoints) == 1) {         if(is_user_alive(id)) {                         if(entity_get_int(id,EV_INT_flags)&FL_ONGROUND) {                     for(new i=MAX_CPS-1;i>0;i--) {                 checkpoints[id-1][i][0] = checkpoints[id-1][i-1][0]                 checkpoints[id-1][i][1] = checkpoints[id-1][i-1][1]                 checkpoints[id-1][i][2] = checkpoints[id-1][i-1][2]             }             new Float:origin[3]             entity_get_vector(id,EV_VEC_origin,origin)             checkpoints[id-1][0][0] = origin[0]             checkpoints[id-1][0][1] = origin[1]             checkpoints[id-1][0][2] = origin[2]                         if(checkpointnum[id-1] > 0) {                 //client_print(id,print_chat,"[TJ] Checkpoint no. %d created, distance to the previous one: %dm",checkpointnum[id-1]+1,floatround(get_distance_f(checkpoints[id-1][1],origin) / 20,floatround_round))                 set_hudmessage(id, 138, 232, 0.03, 0.5, 0, 6.0, 3.0)                 show_hudmessage(id, "Checkpoint nr. %d created",checkpointnum[id-1]+1)                 } else {                 set_hudmessage(id, 138, 232, 0.03, 0.5, 0, 6.0, 3.0)                 show_hudmessage(id, "Checkpoint nr. 1 created")             }             checkpointnum[id-1]++             } else {             set_hudmessage(id, 138, 232, 0.03, 0.5, 0, 6.0, 3.0)             show_hudmessage(id, "You must be alive")         }         } else {         set_hudmessage(id, 138, 232, 0.03, 0.5, 0, 6.0, 3.0)         show_hudmessage(id, "Checkpoints are disabled")     }         return PLUGIN_HANDLED }

It gives a lot of loose identitation and undefined symbol in the other parts or the plugin, but if i remove this part, it doesnt.
__________________
Ahujena
mazmaajinsh is offline
Starsailor
horrible hahah
Join Date: Aug 2008
Location: Buenos Aires
Old 02-15-2009 , 09:58   Re: Fixing errors
Reply With Quote #2

for loose indentation use ctrl + i
__________________
Find my plugins here..

Ex - Spanish Moderator.
Starsailor is offline
xPaw
Retired AMX Mod X Moderator
Join Date: Jul 2008
Old 02-15-2009 , 11:14   Re: Fixing errors
Reply With Quote #3

PHP Code:
public checkpointid ) {
    if(
get_pcvar_num(kz_checkpoints) == 1) {
        if(
is_user_alive(id)) {
            if(
entity_get_int(id,EV_INT_flags) & FL_ONGROUND) {    
                for(new 
i=MAX_CPS-1;i>0;i--) {
                    
checkpoints[id-1][i][0] = checkpoints[id-1][i-1][0]
                    
checkpoints[id-1][i][1] = checkpoints[id-1][i-1][1]
                    
checkpoints[id-1][i][2] = checkpoints[id-1][i-1][2]
                }

                new 
Float:origin[3]
                
entity_get_vector(id,EV_VEC_origin,origin)
                
checkpoints[id-1][0][0] = origin[0]
                
checkpoints[id-1][0][1] = origin[1]
                
checkpoints[id-1][0][2] = origin[2]
            
                if(
checkpointnum[id-1] > 0) {
                    
//client_print(id,print_chat,"[TJ] Checkpoint no. %d created, distance to the previous one: %dm",checkpointnum[id-1]+1,floatround(get_distance_f(checkpoints[id-1][1],origin) / 20,floatround_round))
                    
set_hudmessage(id1382320.030.506.03.0)
                    
show_hudmessage(id"Checkpoint nr. %d created",checkpointnum[id-1]+1)
                } else {
                    
set_hudmessage(id1382320.030.506.03.0)
                    
show_hudmessage(id"Checkpoint nr. 1 created")
                }
                
checkpointnum[id-1]++
        } else {
            
set_hudmessage(id1382320.030.506.03.0)
            
show_hudmessage(id"You must be alive")
        }
    } else {
        
set_hudmessage(id1382320.030.506.03.0)
        
show_hudmessage(id"Checkpoints are disabled")
    }

    return 
PLUGIN_HANDLED;

...
__________________
xPaw is offline
mazmaajinsh
Senior Member
Join Date: Apr 2005
Location: Latvia
Old 02-15-2009 , 11:26   Re: Fixing errors
Reply With Quote #4

Thanks for helping guys
__________________
Ahujena
mazmaajinsh 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 16:58.


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