Raised This Month: $ Target: $400
 0% 

some noob-questions


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
simple_user
Member
Join Date: Apr 2012
Location: Latvia, the cube
Old 05-04-2012 , 08:29   Re: some noob-questions
Reply With Quote #1

I found it in ut_killstreak_adv plugin. This looked unusual to me, so I was wondering.
Here's the context:

PHP Code:
public client_death(killer,victim,weapon,hitplace,TK)
{
    if(!
killer || !victim)
        return;
    
    static 
kname[32], vname[32];
    
get_user_name(killer,kname,31);
    
get_user_name(victim,vname,31);
    
    if(
hitplace == HIT_HEAD && get_pcvar_num(hsenable) == )
    {
        
set_hudmessage(00255, -1.00.3006.06.0);
        
show_hudmessage(0hsmessages[random(sizeof hsmessages)], knamevname);
        
client_cmd(0,"spk %s",hslist[random(sizeof hslist)]);
    }
    
    if(
weapon == CSW_KNIFE && get_pcvar_num(knifeenable) == )
    {
        
set_hudmessage(2550255, -1.00.3006.06.0);
        
show_hudmessage(0knmessages[random(sizeof knmessages)], knamevname);
        
client_cmd(0,"spk %s",knlist[random(sizeof knlist)]);   
    } 

Last edited by simple_user; 05-04-2012 at 08:31.
simple_user is offline
Send a message via Skype™ to simple_user
claudiuhks
Yam Inside®™℠
Join Date: Jan 2010
Location: Living Randomly
Old 05-04-2012 , 08:54   Re: some noob-questions
Reply With Quote #2

Operator ! means is not
Operator != means is not equal with
Operator == means is equal with

PHP Code:
static i;
0;

if( !
) { /* do this */ // i is 0

static c];
c] = '';

if( !
c] ) { /* do this */ // c[ 0 ] is ''

"";

if( !
c] ) { /* do this */ // c[ 0 ] is '' 

Quote:
Originally Posted by rak View Post
PHP Code:
if (!killer || !victim// ! in front of id ? 

PHP Code:
if (killer <= || victim <= 0
Please edit.
__________________

Last edited by claudiuhks; 05-04-2012 at 09:11.
claudiuhks is offline
Send a message via MSN to claudiuhks Send a message via Yahoo to claudiuhks Send a message via Skype™ to claudiuhks
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 00:25.


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