AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   [Solved] admin cmd problem (https://forums.alliedmods.net/showthread.php?t=238825)

swapped 04-17-2014 09:36

[Solved] admin cmd problem
 
So i register a new admin cmd, and i dont know why when i tipe this command is necesary two arguments but i register only one (the player)

This command is based to retrieve the player level,experience and show in ColorChat mesage

Source :

Code:
public cmd_xp_info(id,level,cid) {     if(!cmd_access(id,level,cid,3))         return PLUGIN_HANDLED;     new arg[33]     read_argv(1, arg, 32)     new target = cmd_target(id, arg, 7)     new player_name[35];     get_user_name(target, player_name, charsmax(player_name) - 1);             if(!target)     {         return;     }         ColorChat(0, TEAM_COLOR, "^1[ ^3%s^1 ] Jucatorul ^3%s^1 are level ^4%i^1 [ ^4%i^1 / ^4%i^1 ]",TAG,player_name,hnsxp_playerlevel[target], hnsxp_playerxp[target],levels[hnsxp_playerlevel[target]]); }

Edit : the problem is , is necesary to put the player name twice time

ex :

amx_showxp Andrew Andrew

i need only one time "amx_showxp Andrew" , i hope you understand my

Thanks !

YamiKaitou 04-17-2014 09:39

Re: admin cmd problem
 
Code:

if(!cmd_access(id,level,cid,3))
:arrow:
Code:

if(!cmd_access(id,level,cid,2))

swapped 04-17-2014 10:00

Re: admin cmd problem
 
Quote:

Originally Posted by YamiKaitou (Post 2125832)
Code:

if(!cmd_access(id,level,cid,3))
:arrow:
Code:

if(!cmd_access(id,level,cid,2))



I will by back with answer.

Edit: Working perfect , you are amazing yami <3

Spawner30 04-17-2014 10:17

Re: [Solved] admin cmd problem
 
PHP Code:

if(!cmd_access(id,level,cid,2)) 

Meaning The Argument Is Fix !


PHP Code:

if(!cmd_access(id,level,cid,3)) 

Argument Change Like amx_revive "Whatever" "100"/"50"...

swapped 04-17-2014 10:22

Re: [Solved] admin cmd problem
 
Quote:

Originally Posted by Spawner30 (Post 2125867)
PHP Code:

if(!cmd_access(id,level,cid,2

Meaning The Argument Is Fix !


PHP Code:

if(!cmd_access(id,level,cid,3

Argument Change Like amx_revive "Whatever" "100"/"50"...


Thanks for clarification but to late, also your code is wrong :
PHP Code:

if(!cmd_access(id,level,cid,3

=>
PHP Code:

if(!cmd_access(id,level,cid,3)) 



All times are GMT -4. The time now is 20:37.

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