AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   + 10 each time you click (https://forums.alliedmods.net/showthread.php?t=94856)

TitANious 06-16-2009 10:18

+ 10 each time you click
 
I got this code which should work.
PHP Code:

        case 1:
        {
            if ( 
get_user_points id ) >= get_pcvar_num pCvarHPoints ) )
            {
                
HasHealth1id ] = true
                set_user_points 
idget_user_points id ) - get_pcvar_num pCvarHPoints ) )
                
set_user_health idget_user_health id ) + get_pcvar_num pCvarHealth ) )
                
client_print idprint_chat"%s You got %d health more"PREFIXget_pcvar_num pCvarHealth ) )
            }
            else
            {
                
client_print idprint_chat"%s You don't have enough points"PREFIX )
            }
            if ( 
HasHealth1id ] = true )
            {
                
set_user_points idget_user_points id ) - get_pcvar_num pCvarHPoints ) )
                
set_user_health idget_user_health id ) + get_pcvar_num pCvarHealth ) + 10 )
                
HasHealth2id ] = true
            
}
            else
            {
                
client_print idprint_chat"%s Not enough points"PREFIX )
            } 

But is there an easyier way?

zacky 06-16-2009 14:35

Re: + 10 each time you click
 
I don't know how you are doing this plugin, but you should check if player has HasHealth1 before the code if he can afford it.

TitANious 06-16-2009 14:57

Re: + 10 each time you click
 
I have done. But when i do this method i'll have to do ALOT of useless code. :(


All times are GMT -4. The time now is 13:58.

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