AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   function that it can not use weapon (https://forums.alliedmods.net/showthread.php?t=189779)

klysman07 07-10-2012 18:49

function that it can not use weapon
 
I need the function that does not allow players take or use any type of weapon

Knives only.

this code:

Help pls


PHP Code:

               case DAY_KNIFE:
                {
                        new 
players[32], numplayer;
                        
get_playersplayers,  num"a" );
                        
                        for( new 
0numi++ )
                        {
                                
player players[i];
                                
                                if( !
is_user_aliveplayer ) )
                                        continue;
                                
                                switch( 
cs_get_user_teamplayer ) )
                                {
                                        case 
CS_TEAM_CT:
                                        {
                        
set_user_healthplayer1600 );                       
                        
client_cmdplayer"speak sound/GagaSong/AF.wav");

                                        }
                                        
                                        case 
CS_TEAM_T:
                                        {
                        
set_user_healthplayer1000 );
                        
client_cmdplayer"speak sound/GagaSong/AF.wav");
                                        }
                                }
                                
                                
StripPlayerWeaponsplayer );
                                
                
give_itemplayer"weapon_knife" );
                
server_cmd("mp_friendlyfire 1");
                
server_cmd"sv_gravity 500" );
                
set_hudmessage02550, -1.00.200.05.00.10.1);
                
show_hudmessage0"HOJE E DIA DE SOBREVIVENCIA !!^nTOME CUIDADO !!" );                
                
                        }
                } 


ConnorMcLeod 07-10-2012 18:51

Re: function that it can not use weapon
 
You can hook Ham_Item_CanDeploy or Ham_Item_Deploy for example.

klysman07 07-10-2012 19:25

Re: function that it can not use weapon
 
Quote:

Originally Posted by ConnorMcLeod (Post 1747628)
You can hook Ham_Item_CanDeploy or Ham_Item_Deploy for example.

where can I put this function?
which one is best?
can put it to me please?

ConnorMcLeod 07-10-2012 20:58

Re: function that it can not use weapon
 
This is not a function you can insert as you seems to think.
If you don't have any specific question about some code, make a request in the correct forum.


All times are GMT -4. The time now is 15:21.

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