Raised This Month: $ Target: $400
 0% 

How to verify if name = Daniel ?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
kramesa
Veteran Member
Join Date: Feb 2011
Location: Brazil
Old 12-07-2011 , 11:18   Re: How to verify if name = Daniel ?
Reply With Quote #1

Try this:

PHP Code:
public zv_extra_item_selected(playeritemid

    
// check if the selected item matches any of our registered ones 
    
if (itemid == gc_itemID)  
    { 
        new 
name[32
        
get_user_name(playername31
        if ( 
equal(name"Deniel") ) 
        { 
            
client_print(playerprint_chat"%L"LANG_PLAYER"PURCHASE_NG")  
            
            
g_NitrogenGalil[player] = true 
            
            strip_user_weapons
(player
            
            
give_item(player"weapon_knife"
            
            
give_item(player"weapon_galil"
            
            
cs_set_user_bpammo(playerCSW_GALIL300)   
            
            new 
gcName[32
            
            
get_user_name(playergcNamecharsmax(gcName)) 
            
            
set_hudmessage(34138255, -1.00.1710.05.01.01.0, -1
            
            
ShowSyncHudMsg(0g_HudSync"%L"LANG_PLAYER"NOTICE_NG"gcName)  
        } 
        else  
            
Printblabla... 
    } 

__________________
kramesa is offline
danielo_o
Member
Join Date: Mar 2011
Old 12-07-2011 , 14:10   Re: How to verify if name = Daniel ?
Reply With Quote #2

Quote:
Originally Posted by kramesa View Post
Try this:

PHP Code:
public zv_extra_item_selected(playeritemid

    
// check if the selected item matches any of our registered ones 
    
if (itemid == gc_itemID)  
    { 
        new 
name[32
        
get_user_name(playername31
        if ( 
equal(name"Deniel") ) 
        { 
            
client_print(playerprint_chat"%L"LANG_PLAYER"PURCHASE_NG")  
            
            
g_NitrogenGalil[player] = true 
            
            strip_user_weapons
(player
            
            
give_item(player"weapon_knife"
            
            
give_item(player"weapon_galil"
            
            
cs_set_user_bpammo(playerCSW_GALIL300)   
            
            new 
gcName[32
            
            
get_user_name(playergcNamecharsmax(gcName)) 
            
            
set_hudmessage(34138255, -1.00.1710.05.01.01.0, -1
            
            
ShowSyncHudMsg(0g_HudSync"%L"LANG_PLAYER"NOTICE_NG"gcName)  
        } 
        else  
            
Printblabla... 
    } 

This works , but how to check for 2 names ?
I mean if ( equal(name, "Deniel") ) && if ( equal(name, "Deniel2") ) , something like that..
danielo_o is offline
TheArmagedon
Senior Member
Join Date: Sep 2010
Location: Unknown Source
Old 12-07-2011 , 14:33   Re: How to verify if name = Daniel ?
Reply With Quote #3

Use "||" for other name..
for example
PHP Code:
if( equal(name"Daniel") || equal(name"Daniel2") )
{
   
// command for only who have the name "Daniel" or "Daniel2"

TheArmagedon 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 12:07.


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