Raised This Month: $ Target: $400
 0% 

HELP|with plugin 2


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Mr_Boris
Junior Member
Join Date: Aug 2011
Old 09-21-2011 , 07:25   HELP|with plugin 2
Reply With Quote #1

i have in my JB mod Zombie Day :


PHP Code:
public ZombieDay(id)
{
    new 
iPlayers[32]
    
zombie_day true
    
new iNum
    
new id
 
    get_players
iPlayersiNum )
    
server_cmd("bh_enabled 0")
    for( new 
0iNumi++ )
    {
        
id iPlayers[i]
        if( !
is_user_aliveid ) )
        {
            continue;
        }
      
        
ColorChat(0RED"^4%s Today Is Zombie"PREFIX)
        
g_ZMCount ZMCount;
        
set_task1.0 "ZombieCount" "a" g_ZMCount );
        
jail_open()
  
        if (
cs_get_user_team(id) == CS_TEAM_CT)
        {
            
strip_user_weapons(id)
            
give_item(id"weapon_knife")
            
set_user_health(id30000)
            
cs_set_user_model(id,"zombie")
        }
        
        if (
cs_get_user_team(id) == CS_TEAM_T)
        {
               
            
strip_user_weapons(id)
            
give_item(id"weapon_m4a1")
            
give_item(id"weapon_ak47")
            
give_item(id"weapon_deagle")
            
cs_set_user_bpammo(idCSW_M4A19999)
            
cs_set_user_bpammo(idCSW_AK479999)
            
cs_set_user_bpammo(idCSW_DEAGLE9999)
            
set_user_health(id100)
        }
    }


i want in that day if CT player have weapon that not aknife tath will do to hem strip weapon and give a knife



Sorry for the bad English
Mr_Boris is offline
e12harry
Member
Join Date: Apr 2010
Old 09-21-2011 , 07:52   Re: HELP|with plugin 2
Reply With Quote #2

I don't know anything about Zombie Mod but:
1. You pass id as a parameter to a fuction:
PHP Code:
public ZombieDay(id
{ ... 
and than you create new variable with the same name:
PHP Code:
 new id 
You can not do that. My sugestion is to change
PHP Code:
public ZombieDay(id
to
PHP Code:
public ZombieDay(callingId
where callingId will be id of a player who uses the command

2. Also I don't get this:
PHP Code:
 ColorChat(0RED"^4%s Today Is Zombie"PREFIX
 
g_ZMCount ZMCount
 
set_task1.0 "ZombieCount" "a" g_ZMCount ); 
 
jail_open() 


this will be executed for each alive player :
if you have 10 alive players ColorChat will be printed 10 times to all players
you will have 10 tasks
you will call jail_open() 10 times.
g_ZMCount and ZMCount are always the same. You are not changing them inside the loop

Maybe it should be after the for loop?
e12harry is offline
Mr_Boris
Junior Member
Join Date: Aug 2011
Old 09-21-2011 , 08:13   Re: HELP|with plugin 2
Reply With Quote #3

can you just help me with my REQ?
Mr_Boris is offline
e12harry
Member
Join Date: Apr 2010
Old 09-21-2011 , 08:33   Re: HELP|with plugin 2
Reply With Quote #4

You could try this:
PHP Code:
public ZombieDay(callerId)
{
    new 
iPlayers[32]
    
zombie_day true
    
new iNum
    
new id
    
new CsTeams:team;
    
get_playersiPlayersiNum )
    
server_cmd("bh_enabled 0")
    for( new 
0iNumi++ )
    {
        
id iPlayers[i]
        if( !
is_user_aliveid ) )
        {
            continue;
        }
        
team cs_get_user_team(id);
        switch(
team)
        {
            case 
CS_TEAM_CT:
            {
                
strip_user_weapons(id)
                
give_item(id"weapon_knife")
                
set_user_health(id30000)
                
cs_set_user_model(id,"zombie")
            }
            case 
CS_TEAM_T:
            {
                
strip_user_weapons(id)
                
give_item(id"weapon_m4a1")
                
give_item(id"weapon_ak47")
                
give_item(id"weapon_deagle")
                
cs_set_user_bpammo(idCSW_M4A19999)
                
cs_set_user_bpammo(idCSW_AK479999)
                
cs_set_user_bpammo(idCSW_DEAGLE9999)
                
set_user_health(id100)
            }
        }
    }
    
ColorChat(0RED"^4%s Today Is Zombie"PREFIX)
    
g_ZMCount ZMCount;
    
set_task1.0 "ZombieCount" "a" g_ZMCount );
    
jail_open()

but still I don't know what is this:

PHP Code:
ColorChat(0RED"^4%s Today Is Zombie"PREFIX)
g_ZMCount ZMCount;
set_task1.0 "ZombieCount" "a" g_ZMCount );
jail_open() 
Tell me what you want to display with CororChat, what are g_ZMCount and ZMCount,
what do functions ZombieCount and jail_open do,
e12harry 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 03:15.


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