Raised This Month: $170 Target: $400
 42% 

[Solved] admin cmd problem


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
swapped
BANNED
Join Date: Mar 2014
Location: OrpheuRegisterHook
Old 04-17-2014 , 09:36   [Solved] admin cmd problem
Reply With Quote #1

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 !

Last edited by swapped; 04-17-2014 at 10:10.
swapped is offline
YamiKaitou
Has a lovely bunch of coconuts
Join Date: Apr 2006
Location: Texas
Old 04-17-2014 , 09:39   Re: admin cmd problem
Reply With Quote #2

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

Code:
if(!cmd_access(id,level,cid,2))
__________________
ProjectYami Laboratories

I do not browse the forums regularly anymore. If you need me for anything (intervening in a thread, asking questions or anything else), then PM me (be descriptive in your PM, message containing only a link to a thread will be ignored).
YamiKaitou is offline
swapped
BANNED
Join Date: Mar 2014
Location: OrpheuRegisterHook
Old 04-17-2014 , 10:00   Re: admin cmd problem
Reply With Quote #3

Quote:
Originally Posted by YamiKaitou View Post
Code:
if(!cmd_access(id,level,cid,3))

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


I will by back with answer.

Edit: Working perfect , you are amazing yami <3

Last edited by swapped; 04-17-2014 at 10:10.
swapped is offline
Spawner30
BANNED
Join Date: Dec 2013
Location: I Don't Know Yet
Old 04-17-2014 , 10:17   Re: [Solved] admin cmd problem
Reply With Quote #4

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"...

Last edited by Spawner30; 04-17-2014 at 10:50.
Spawner30 is offline
Send a message via Skype™ to Spawner30
swapped
BANNED
Join Date: Mar 2014
Location: OrpheuRegisterHook
Old 04-17-2014 , 10:22   Re: [Solved] admin cmd problem
Reply With Quote #5

Quote:
Originally Posted by Spawner30 View Post
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)) 
swapped 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 19:35.


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