Raised This Month: $ Target: $400
 0% 

How can i transfer xp with a command?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Bilal Pro
Senior Member
Join Date: Mar 2012
Location: Holland
Old 04-28-2012 , 06:34   How can i transfer xp with a command?
Reply With Quote #1

Hello there,

I would like to know how i transfer xp from a command.

Example: xpmod_give_xp "Nickname/userid, ammount")
__________________
  • Point System with rank titles for sale [X] [100% private]
  • VIP Menu for sale [X] [100% private]
  • HnS shop more features for sale [X] [100% private]
Contact: Bilalzaandam1234, on steam if you are interested.
Bilal Pro is offline
BeeFighter
Member
Join Date: Feb 2012
Old 04-28-2012 , 07:41   Re: How can i transfer xp with a command?
Reply With Quote #2

look @ exolents XP mod he got it
__________________
www.Gstar-Gaming.net

Servers:
Jailbreak
HidenSeek
Knife
Deathrun
Public

Join us now: www.gstar-gaming.net
BeeFighter is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 04-28-2012 , 12:30   Re: How can i transfer xp with a command?
Reply With Quote #3

Simple:

Reduce user's xp by amount
Increase target user's xp by amount.
__________________
fysiks is offline
EpicMonkey
buttmonkey
Join Date: Feb 2012
Old 04-28-2012 , 12:43   Re: How can i transfer xp with a command?
Reply With Quote #4

Quote:
Originally Posted by fysiks View Post
Simple:

Reduce user's xp by amount
Increase target user's xp by amount.
could it be any simpler ...
EpicMonkey is offline
.Dare Devil.
Veteran Member
Join Date: Sep 2010
Old 04-28-2012 , 12:52   Re: How can i transfer xp with a command?
Reply With Quote #5

PHP Code:
public plugin_init ()
{
    
register_clcmd "xpmod_give_xp""transfer_xp")
}

public 
transfer_xp(id)
{  
    new 
name[32], xpamount[32], target
    
    read_argv
(1namecharsmax (name))
    
read_argv(2xpamountcharsmax (xpamount))
    
target cmd_target (idname3)
    
    if (!
target)
        return 
PLUGIN_HANDLED

    g_yourxpvariable
[target] = xpamount
    
return PLUGIN_HANDLED


Last edited by .Dare Devil.; 04-28-2012 at 12:52.
.Dare Devil. is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 04-28-2012 , 13:01   Re: How can i transfer xp with a command?
Reply With Quote #6

Quote:
Originally Posted by .Dare Devil. View Post
PHP Code:
public plugin_init ()
{
    
register_clcmd "xpmod_give_xp""transfer_xp")
}

public 
transfer_xp(id)
{  
    new 
name[32], xpamount[32], target
    
    read_argv
(1namecharsmax (name))
    
read_argv(2xpamountcharsmax (xpamount))
    
target cmd_target (idname3)
    
    if (!
target)
        return 
PLUGIN_HANDLED

    g_yourxpvariable
[target] = xpamount
    
return PLUGIN_HANDLED

That doesn't transfer xp. It just sets xp for the target. You need to check for number of arguments also.

Also, don't do it for him (especially when you do it wrong). This forum is called "Scripting Help" and not "Do This For Me Forum".
__________________

Last edited by fysiks; 04-28-2012 at 13:02.
fysiks is offline
.Dare Devil.
Veteran Member
Join Date: Sep 2010
Old 04-28-2012 , 14:13   Re: How can i transfer xp with a command?
Reply With Quote #7

Quote:
Originally Posted by fysiks View Post
That doesn't transfer xp. It just sets xp for the target. You need to check for number of arguments also.

Also, don't do it for him (especially when you do it wrong). This forum is called "Scripting Help" and not "Do This For Me Forum".
oh yeah, sorry.
i was on ohter world or something when i writed the code.

Did not readed the topic carefully.
anyway here it is!
PHP Code:
public plugin_init ()
{
    
register_clcmd "xpmod_give_xp""transfer_xp"// register that command 
}

public 
transfer_xp(id)
{  
    new 
name[32], xpamount[32], target
    
    read_argv
(1namecharsmax (name)) // get name from saytext arg " xpmod_give_xp [name] [] "
    
read_argv(2xpamountcharsmax (xpamount))  // get xpamount from saytext arg " xpmod_give_xp  [] [amount] "
    
target cmd_target (idname3// now get the target by the name what was in saytext arg
    
    
if (!target && g_yourxpvariable[id] > xpamount // check if there is a target and 
        
return PLUGIN_HANDLED    // check that transfer player have enough xp to sent it 

    
g_yourxpvariable[target] += xpamount // give xp to target
    
g_yourxpvariable[id] -= xpamount // take xp from transfer player
    
    
return PLUGIN_HANDLED

oh bytheway, and i explained what my code does this time, if you noticed.
It is very nice way to learn scripting, so i helped him with scripting.

Last edited by .Dare Devil.; 04-28-2012 at 14:13.
.Dare Devil. is offline
mottzi
Veteran Member
Join Date: May 2010
Location: Switzerland
Old 04-28-2012 , 14:50   Re: How can i transfer xp with a command?
Reply With Quote #8

Bilal Pro start brain.exe please.
__________________
Quote:
#define true ((rand() % 2)? true: false) //Happy debugging suckers
mottzi is offline
Send a message via MSN to mottzi
Bilal Pro
Senior Member
Join Date: Mar 2012
Location: Holland
Old 04-28-2012 , 15:13   Re: How can i transfer xp with a command?
Reply With Quote #9

Quote:
Originally Posted by mottzi View Post
Bilal Pro start brain.exe please.

Look at my join date, start eyes.exe please...
__________________
  • Point System with rank titles for sale [X] [100% private]
  • VIP Menu for sale [X] [100% private]
  • HnS shop more features for sale [X] [100% private]
Contact: Bilalzaandam1234, on steam if you are interested.

Last edited by Bilal Pro; 04-28-2012 at 15:13.
Bilal Pro is offline
.Dare Devil.
Veteran Member
Join Date: Sep 2010
Old 04-28-2012 , 15:19   Re: How can i transfer xp with a command?
Reply With Quote #10

Quote:
Originally Posted by mottzi View Post
Bilal Pro start brain.exe please.
Quote:
Originally Posted by Bilal Pro View Post
Look at my join date, start eyes.exe please...
wtf
.Dare Devil. 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 18:05.


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