AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Help! Im nwbie (https://forums.alliedmods.net/showthread.php?t=100567)

Mxnn 08-15-2009 19:09

Help! Im nwbie
 
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? :D
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 :D..

Thanks! My greets

Zapdos1 08-15-2009 19:09

Re: Help! Im nwbie
 
[ES] postea los errores

Mxnn 08-15-2009 19:43

Re: Help! Im nwbie
 
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 :)!

Zapdos1 08-15-2009 19:45

Re: Help! Im nwbie
 
[ES] xD, a mi tambien me pasaba lo mismo con un plugin
apreta CTRL + I y listo
luego compila y avizas

Mxnn 08-15-2009 19:56

Re: Help! Im nwbie
 
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.. :/

Zapdos1 08-15-2009 20:00

Re: Help! Im nwbie
 
[ES] >.<, escribelo en español que no te entendi nada de nada XDDD
postea aquí tu problema Others

fysiks 08-15-2009 23:09

Re: Help! Im nwbie
 
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 (Post 901682)
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.

Zapdos1 08-15-2009 23:15

Re: Help! Im nwbie
 
sorry, i said him to post on Others

Mxnn 08-15-2009 23:55

Re: Help! Im nwbie
 
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 :P
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))

fysiks 08-15-2009 23:57

Re: Help! Im nwbie
 
No, it's not php. It's pawn. Start with what I posted and go from there.


All times are GMT -4. The time now is 15:04.

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