Raised This Month: $ Target: $400
 0% 

2 things


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
daniel46
Senior Member
Join Date: Dec 2011
Old 09-08-2012 , 10:04   2 things
Reply With Quote #1

i have 3 questions

1 i have a shop with points and i want that if player that didnt was in the server will get x points i mean if he is not in the nvault

2 i build this code

PHP Code:
new armor get_user_armor(victim);
    new 
health get_user_health(victim);
    new 
szName[32];
    
get_user_name(victim,szName,31)

    if(
armor && cs_get_user_team(attacker) == CS_TEAM_T && DayActive)
    {
        
set_hudmessage(255000.010.2906.012.0)
        
show_hudmessage(attacker"Name: %s^nHealth: %d^nArmor: %d"szNamehealtharmor)
    }
    else if(
cs_get_user_team(attacker) == CS_TEAM_T && DayActive)
    {
        
set_hudmessage(255000.010.2906.012.0)
        
show_hudmessage(attacker"Name: %s^nHealth: %d"szNamehealth)
    }

its with ham take dmg and there is 1 thing i dont know how to do when i hit hemm its shows hes health but not the health with the -health i hited hemm how can i cout it to?

3 i have an jailbreak lr and i want if there is 1 terror and only 1 ct left and the terror won the duel so it will do alot of rings to hemm


thaks for who ever helps

Last edited by daniel46; 09-08-2012 at 10:09.
daniel46 is offline
jimaway
Heeeere's Jimmy!
Join Date: Jan 2009
Location: Estonia
Old 09-08-2012 , 11:00   Re: 2 things
Reply With Quote #2

if takedamage hook is pre:
get_user_health(victim) - damage
if takedamage hook is post:
get_user_health(victim)

dint really understand this:
Quote:
3 i have an jailbreak lr and i want if there is 1 terror and only 1 ct left and the terror won the duel so it will do alot of rings to hemm
but maybe this is what you want:
Code:
#define TE_BEAMCYLINDER             21       // Cylinder that expands to max radius over lifetime
// write_byte(TE_BEAMCYLINDER)
// write_coord(position.x)
// write_coord(position.y)
// write_coord(position.z)
// write_coord(axis.x)
// write_coord(axis.y)
// write_coord(axis.z) 
// write_short(sprite index) 
// write_byte(starting frame) 
// write_byte(frame rate in 0.1's) 
// write_byte(life in 0.1's) 
// write_byte(line width in 0.1's) 
// write_byte(noise amplitude in 0.01's) 
// write_byte(red)
// write_byte(green)
// write_byte(blue)
// write_byte(brightness)
// write_byte(scroll speed in 0.1's)

Last edited by jimaway; 09-08-2012 at 11:09.
jimaway is offline
daniel46
Senior Member
Join Date: Dec 2011
Old 09-08-2012 , 11:46   Re: 2 things
Reply With Quote #3

1
i have a jailbreak points shop and i want if the user wasnt in the server yet and dont have points so he will get x points as i choose

2
could you give example?

3
i want if its the terror only the terror won and killed all the cts so he will get does rings because rings i know how to do
daniel46 is offline
Liverwiz
Veteran Member
Join Date: Feb 2010
Location: Maryland
Old 09-08-2012 , 13:39   Re: 2 things
Reply With Quote #4

Quote:
Originally Posted by daniel46 View Post
1
i have a jailbreak points shop and i want if the user wasnt in the server yet and dont have points so he will get x points as i choose
Here is a snippet of code from one of my plugins. Exactly what you're looking for. Hope this sends you on your way.

PHP Code:
    if(!nvault_lookup(g_vaultHandlesz_vaultKeydatacharsmax(data), timestamp))
    {
        
frags 0
        nvault_set
(g_vaultHandlesz_vaultKey"0")
        if(
get_pcvar_num(log_pcvar) == 1)
            
log_to_file(nVaultLogFile"[BKF] User %s (%s) is a new client and has been added to the vault."namesz_vaultKey)
    } 
__________________
What an elegant solution to a problem that doesn't need solving....
Liverwiz is offline
daniel46
Senior Member
Join Date: Dec 2011
Old 09-08-2012 , 14:57   Re: 2 things
Reply With Quote #5

thanks but what i write in data?

Last edited by daniel46; 09-08-2012 at 15:11.
daniel46 is offline
ColdWar
Member
Join Date: Aug 2012
Old 09-08-2012 , 15:07   Re: 2 things
Reply With Quote #6

Quote:
Originally Posted by Liverwiz View Post
Here is a snippet of code from one of my plugins. Exactly what you're looking for. Hope this sends you on your way.

PHP Code:
    if(!nvault_lookup(g_vaultHandlesz_vaultKeydatacharsmax(data), timestamp))
    {
        
frags 0
        nvault_set
(g_vaultHandlesz_vaultKey"0")
        if(
get_pcvar_num(log_pcvar) == 1)
            
log_to_file(nVaultLogFile"[BKF] User %s (%s) is a new client and has been added to the vault."namesz_vaultKey)
    } 

What to write ? I need more explanation
ColdWar is offline
Liverwiz
Veteran Member
Join Date: Feb 2010
Location: Maryland
Old 09-08-2012 , 16:01   Re: 2 things
Reply With Quote #7

Quote:
Originally Posted by daniel46 View Post
thanks but what i write in data?
data is just a variable that would normally return the data that is stored in the vault.
This is what nvault.inc has to say.
Quote:
/* Looks up a vault value for full information
* Returns 0 if the entry is not found
*/
native nvault_lookup(vault, const key[], value[], maxlen, &timestamp);

What's to explain?

If there is no vault information, you set it to what you want.
__________________
What an elegant solution to a problem that doesn't need solving....

Last edited by Liverwiz; 09-08-2012 at 16:11.
Liverwiz is offline
daniel46
Senior Member
Join Date: Dec 2011
Old 09-09-2012 , 07:55   Re: 2 things
Reply With Quote #8

Ok thanks and what about the 2 other things could you help me?
daniel46 is offline
Liverwiz
Veteran Member
Join Date: Feb 2010
Location: Maryland
Old 09-09-2012 , 08:45   Re: 2 things
Reply With Quote #9

Quote:
Originally Posted by daniel46 View Post
2 i build this code

PHP Code:
new armor get_user_armor(victim);
    new 
health get_user_health(victim);
    new 
szName[32];
    
get_user_name(victim,szName,31)

    if(
armor && cs_get_user_team(attacker) == CS_TEAM_T && DayActive)
    {
        
set_hudmessage(255000.010.2906.012.0)
        
show_hudmessage(attacker"Name: %s^nHealth: %d^nArmor: %d"szNamehealtharmor)
    }
    else if(
cs_get_user_team(attacker) == CS_TEAM_T && DayActive)
    {
        
set_hudmessage(255000.010.2906.012.0)
        
show_hudmessage(attacker"Name: %s^nHealth: %d"szNamehealth)
    }

its with ham take dmg and there is 1 thing i dont know how to do when i hit hemm its shows hes health but not the health with the -health i hited hemm how can i cout it to?
hook it as post
Code:
RegisterHam(Ham_TakeDamage, "player", "doneGotShotAfter", 1)
__________________
What an elegant solution to a problem that doesn't need solving....
Liverwiz is offline
ColdWar
Member
Join Date: Aug 2012
Old 09-09-2012 , 09:19   Re: 2 things
Reply With Quote #10

Quote:
Originally Posted by Liverwiz View Post
data is just a variable that would normally return the data that is stored in the vault.
This is what nvault.inc has to say.



What's to explain?

If there is no vault information, you set it to what you want.
Look, i use it on a shop.. When a player loses all his dollars/cash it returns 0 just az same.. so it works but if player retrys when he had 0 dollars before he still get it as like first time.. is there another ways?
ColdWar 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 08:13.


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