Raised This Month: $ Target: $400
 0% 

xmas editing


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
heroeskiller
Senior Member
Join Date: Mar 2007
Old 11-30-2007 , 10:07   xmas editing
Reply With Quote #1

Hello,
iam editing that XMas plugin for shmod
Code:
     {
     new randomXP = random_num(100, 1000);
     server_cmd("amx_shaddxp", pToucher, randomXP);
     server_exec();
     client_print(pToucher, print_chat, "[presentsSpawner] %L", pToucher, "You got XP:", randomXP);
     }
But i get always a error, when ppl are trying to pickup a present:
Usage: amx_shaddxp <nick | @team | @ALL | #userid> <xp> - Adds XP to Players
heroeskiller is offline
purple_pixie
Veteran Member
Join Date: Jun 2007
Location: Winchester, England
Old 11-30-2007 , 10:12   Re: xmas editing
Reply With Quote #2

1) What error?

2) parameter 2 of amx_shaddxp should be a string.
You need to replace:
Code:
     server_cmd("amx_shaddxp", pToucher, randomXP);
With:
Code:
     new target[12] ;      target[0]='#'      num_to_str(get_user_userid(pToucher),target[1],sizeof target-2)      server_cmd("amx_shaddxp", target, randomXP);
purple_pixie is offline
heroeskiller
Senior Member
Join Date: Mar 2007
Old 11-30-2007 , 10:28   Re: xmas editing
Reply With Quote #3

the message doesnt accept "randomXP" :/
It could be also the error why it still doenst work with giving xp
heroeskiller is offline
purple_pixie
Veteran Member
Join Date: Jun 2007
Location: Winchester, England
Old 11-30-2007 , 10:32   Re: xmas editing
Reply With Quote #4

Alrighty ... we'll make that a string too.

Code:
{     new randomXP = random_num(100, 1000);     new target[12],xp[5] ;     target[0]='#'     num_to_str(get_user_userid(pToucher),target[1],sizeof target-2)     num_to_str(randomXP,xp,sizeof xp-1);     server_cmd("amx_shaddxp", target, xp);     server_exec();     client_print(pToucher, print_chat, "[presentsSpawner] %L", pToucher, "You got XP: %i", randomXP); }

Or you mean the "client_print" message?
That was missing a "%i"
purple_pixie is offline
heroeskiller
Senior Member
Join Date: Mar 2007
Old 11-30-2007 , 10:38   Re: xmas editing
Reply With Quote #5

still doesnt work :/
heroeskiller is offline
purple_pixie
Veteran Member
Join Date: Jun 2007
Location: Winchester, England
Old 11-30-2007 , 10:43   Re: xmas editing
Reply With Quote #6

1) Is "debug" enabled for the plugin
(should be listed as "pluginname.amxx debug" in plugins.ini)

2) What is logged in the console when you pick up the present?
purple_pixie is offline
heroeskiller
Senior Member
Join Date: Mar 2007
Old 11-30-2007 , 10:48   Re: xmas editing
Reply With Quote #7

Yes its enabled

But it only says:
Usage: amx_shaddxp <nick | @team | @ALL | #userid> <xp> - Adds XP to Players
heroeskiller is offline
purple_pixie
Veteran Member
Join Date: Jun 2007
Location: Winchester, England
Old 11-30-2007 , 10:53   Re: xmas editing
Reply With Quote #8

Ah.

My bad ... you need it like this:

Code:
     {      new randomXP = random_num(100, 1000);      server_cmd("amx_shaddxp %s%i %i", {'#',0},pToucher, randomXP);      server_exec();      client_print(pToucher, print_chat, "[presentsSpawner] %L", pToucher, "You got XP:", randomXP);      }
purple_pixie is offline
heroeskiller
Senior Member
Join Date: Mar 2007
Old 11-30-2007 , 10:57   Re: xmas editing
Reply With Quote #9

Now it says: Client with that name or userid not found ^^
heroeskiller is offline
purple_pixie
Veteran Member
Join Date: Jun 2007
Location: Winchester, England
Old 11-30-2007 , 11:01   Re: xmas editing
Reply With Quote #10

Instead of "server_cmd" (or aswell as) put "log_amx" (with the same arguments) and tell me what that logs.
purple_pixie 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 11:11.


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