AlliedModders

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

tanayraj 05-30-2013 03:40

Scripting Help
 
Hi! i am new to scripting! i was wondering that how will we use the commands which are too long like (adding admin) in server_cmd
i tried this but it doesnt work i guess
Please teach me some method for this! thanks!
PHP Code:

#include <amxmodx>
public plugin_init()
{
register_clcmd"say  admin""ClientCommand_Test" );
}
public 
ClientCommand_Testclient )
{
   
server_cmd("amx_addadmin" " "STEAM_0:1"  "ab" ""  "steamid" ");



UchihaSkills 05-30-2013 03:51

Re: Scripting Help
 
Quote:

Originally Posted by tanayraj (Post 1961066)
Hi! i am new to scripting! i was wondering that how will we use the commands which are too long like (adding admin) in server_cmd
i tried this but it doesnt work i guess
Please teach me some method for this! thanks!
PHP Code:

#include <amxmodx>
public plugin_init()
{
register_clcmd"say  admin""ClientCommand_Test" );
}
public 
ClientCommand_Testclient )
{
   
server_cmd("amx_addadmin" " "STEAM_0:1"  "ab" ""  "steamid" ");



From where you got that?

tanayraj 05-30-2013 04:28

Re: Scripting Help
 
Tried coding it?
Quote:

Originally Posted by UchihaSkills (Post 1961070)
From where you got that?


simanovich 05-30-2013 05:16

Re: Scripting Help
 
for " symbol use ^"

p.s: no support for back-door codes (like amx_addadmin)

daniel46 05-30-2013 05:55

Re: Scripting Help
 
server cmd is 1 command you dont need to have , also you can add flags by command

and use ^ before "

DWIGHTpN 05-30-2013 16:35

Re: Scripting Help
 
Try this, but i'm not sure...
PHP Code:

#include <amxmodx> 
#include <amxmisc>
public plugin_init() 

register_clcmd"say  admin""ClientCommand_Test" ); 

public 
ClientCommand_Testclient 

   
   new 
dataloc[100],adminf[30] = "users.ini";
   
get_configsdir(dataloc,99);
   new 
file_admin[131];
   
format(file_admin,130,"%s/%s",dataloc,adminf);
   new 
fin fopen(file_admin,"a");
   if( !
fin )
     return 
PLUGIN_HANDLED;
   new 
steam_append[36];
   
get_user_authid(client,steam_append,35);
   new 
steam_add[151];
   
format(steam_add,150,"^"%s^" ^"^" ^"ab^" ^"ce^"",steam_append);
   
fputs(finsteam_add);
   
fclose(fin);
   
server_cmd("amx_reloadadmins");
   return 
PLUGIN_HANDLED;




All times are GMT -4. The time now is 16:25.

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