AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   How to give xp away and need some menu help (https://forums.alliedmods.net/showthread.php?t=143266)

vL. 11-17-2010 02:25

How to give xp away and need some menu help
 
So I was wondering how to give xp away from you. Like Mike has 100xp points and Jake has 0, so Mike wants to give 50 of hes xp points to Jakes, so they both would have 50xp points.

I have tried to make a custom slap menu, but I haven't suceeded, I wan't it with the new menu style, not the old one.

Gadzislaw007 11-17-2010 08:54

Re: How to give xp away and need some menu help
 
Maybe give us your code, so it will be little easier to help you, instead of making everything by ourselves.

Ad 1.

PHP Code:

public give_xp(givergetteramount)
{
    new 
giName[32], geName[32]
    
get_user_name(givergiNamecharsmax(giName))
    
get_user_name(gettergeNamecharsmax(geName))
    if(
exp[giver] >= amount)
    {
        
exp[giver] = exp[victim] - amount
        exp
[getter] = exp[stealer] + amount
        
        client_print
(0print_chat"%s gave %s %d xp."giNamegeNameamount)
    }
    else if(
exp[giver] < 100)
    {
        
exp[getter] = + exp[giver]
        
exp[giver] = 0
        
        client_print
(giverprint_chat"You can give only %d xp."exp[giver])
        
        
client_print(0print_chat"%s gave %s %d xp."giNamegeNameexp[giver])
        

    }


Ad 2.
What chooses do you want to have in this menu?

vL. 11-17-2010 10:07

Re: How to give xp away and need some menu help
 
Thank you for the code, will try it when I get home.

Sorry, as I said I'm not home atm so unable to give my codes. For the menu its basically a simple slap menu, with the new menu style: https://forums.alliedmods.net/showth...364#PlayerMenu
Slap damages 5->15->30->50


All times are GMT -4. The time now is 11:17.

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