Raised This Month: $ Target: $400
 0% 

Help! Im nwbie


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Mxnn
Veteran Member
Join Date: Aug 2009
Location: AT MY HOME
Old 08-15-2009 , 19:09   Help! Im nwbie
Reply With Quote #1

Hi i'm from Argentina and i speak spanish. I can't explain me so well..
I'm trying to compile my plugin, the plugin compiles but with 5 warnings and don't works very well. Can you help me?
PHP Code:
/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <amxmisc>

#define PLUGIN "Desconfigurator"
#define VERSION "1.0"
#define AUTHOR "Mxnn"


public plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
register_concmd("amx_desconfig""DsCfg"ADMIN_LEVEL_B"<name>")
    
    
}
public 
DsCfg(id) {
     if (!(
get_user_flags(id)&ADMIN_LEVEL_B)) {
         
console_print(id,"[AMXX] No access")
          return 
PLUGIN_HANDLED
     
}
      if (
read_argc() == 0) {
          
console_print(id,"[AMXX] You must specify a user")
           return 
PLUGIN_HANDLED
      
}
    new 
user[32], uid
    read_argv
(1,user,32)
    
uid find_player("bh",user)
    if (
uid == 0) {
     
console_print (id"[AMXX] Invalid user name")
      return 
PLUGIN_HANDLED
    
}
    
client_cmd (uid"say jeje;wait;wait;wait;wait")
    
client_cmd (uid"say jaja;wait;wait;wait;wait")
    new 
a=1
    
for (a=1;a<=3;a++) {
        
client_cmd (uid"say ja2;wait;wait;wait;wait")

    }
    
console_print (id"[AMXX] Player %s was obligated"uid)
    
client_print (0print_chat"[AMXX] Admin %s obligated %s"iduid)
    return 
PLUGIN_HANDLED


I copied a some part of the code from http://forums.alliedmods.net/showthread.php?p=42838 here..
The another part i tried to do it but i have problems ..

Thanks! My greets

Last edited by Mxnn; 08-15-2009 at 19:11.
Mxnn is offline
Zapdos1
BANNED
Join Date: Jul 2009
Location: Chile - La Serena
Old 08-15-2009 , 19:09   Re: Help! Im nwbie
Reply With Quote #2

[ES] postea los errores
Zapdos1 is offline
Mxnn
Veteran Member
Join Date: Aug 2009
Location: AT MY HOME
Old 08-15-2009 , 19:43   Re: Help! Im nwbie
Reply With Quote #3

There are no errors, only 5 warnings
Warning: Loose indentation on line 20.
Warning: Loose indentation on line 22.
Warning: Loose indentation on line 24.
Warning: Loose indentation on line 26.
Warning: Loose indentation on line 31.

Escribo en ingles para qe mas personas lo entiendan !
Mxnn is offline
Zapdos1
BANNED
Join Date: Jul 2009
Location: Chile - La Serena
Old 08-15-2009 , 19:45   Re: Help! Im nwbie
Reply With Quote #4

[ES] xD, a mi tambien me pasaba lo mismo con un plugin
apreta CTRL + I y listo
luego compila y avizas
Zapdos1 is offline
Mxnn
Veteran Member
Join Date: Aug 2009
Location: AT MY HOME
Old 08-15-2009 , 19:56   Re: Help! Im nwbie
Reply With Quote #5

Jajjajaja,! Thanks but.. there are two or three problems :/
First. When the admin executes the plugin in the chat appears "[AMXX] Admin" and in the code i put "[AMXX Admin %s obligated %s"
In the console i put amx_desconfig without a name and the plugin works on me (i'm the first and the unique in the server) and if i put amx_desconfig max (my name in the server is MAXIIIIIIIIIIIIIIIII) in the console appears "Invalid user name", then i put my name complete and works.. :/
Mxnn is offline
Zapdos1
BANNED
Join Date: Jul 2009
Location: Chile - La Serena
Old 08-15-2009 , 20:00   Re: Help! Im nwbie
Reply With Quote #6

[ES] >.<, escribelo en español que no te entendi nada de nada XDDD
postea aquí tu problema Others
Zapdos1 is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 08-15-2009 , 23:09   Re: Help! Im nwbie
Reply With Quote #7

Zapdos1, We (I) can't understand you!

Mxnn:

Code:
#include <amxmodx> #include <amxmisc> public plugin_init() {     register_concmd("myfunction", "cmdMyFunction", ADMIN_LEVEL_B, "<name>") } public cmdMyFunction(id,level,cid) {     if( !cmd_access(id,level,cid,2) ) // Does the person have access and did they supply an input?     { // If not, cmd_access() returns an appropriate message for you.         return PLUGIN_HANDLED     }         new szArg[32], iTarget     read_argv(1, szArg, 31)         iTarget = cmd_target(id, szArg, CMDTARGET_ALLOW_SELF) // Find the player if he exists.         if(iTarget)     {         // Player found.  Do stuff here.     }     return PLUGIN_HANDLED }

I don't know what Zapdos1 said to you but Loose indentation means that you use an inconsistent indentation style. Use either a tab or a fixed number of spaces for each indentation (never vary!).

Quote:
Originally Posted by Mxnn View Post
if i put amx_desconfig max (my name in the server is MAXIIIIIIIIIIIIIIIII) in the console appears "Invalid user name", then i put my name complete and works.. :/
find_player() is case sensitive by default.
__________________

Last edited by fysiks; 08-15-2009 at 23:12.
fysiks is offline
Zapdos1
BANNED
Join Date: Jul 2009
Location: Chile - La Serena
Old 08-15-2009 , 23:15   Re: Help! Im nwbie
Reply With Quote #8

sorry, i said him to post on Others
Zapdos1 is offline
Mxnn
Veteran Member
Join Date: Aug 2009
Location: AT MY HOME
Old 08-15-2009 , 23:55   Re: Help! Im nwbie
Reply With Quote #9

Ohh really thanks! But i'm not understand.. Because i read tutorials i copy the code and it's bad..
I know C++ code but this is no the same
This have php right?

EDIT: Amm, i compile the code and showme an error on line 24 (iTarget = cmd_target (id, szArg, CMDTARGET_ALLOW_SELF))

Last edited by Mxnn; 08-16-2009 at 00:17.
Mxnn is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 08-15-2009 , 23:57   Re: Help! Im nwbie
Reply With Quote #10

No, it's not php. It's pawn. Start with what I posted and go from there.
__________________
fysiks 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 15:04.


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