Raised This Month: $ Target: $400
 0% 

Check if player droped scout/weapon name


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
bazhenov93
Veteran Member
Join Date: Oct 2010
Old 04-16-2012 , 12:41   Check if player droped scout/weapon name
Reply With Quote #1

Ok so I have this, but I need a check if the scout was droped, because the "Due to usage of weapon with..." is always when you drop and type /scout again._.

PHP Code:
public cmdScout(id)
{
    if(! 
is_user_alive(id) && is_user_connected(id))
    {
        
ColorChat(idBLUE,"You must be alive to use this function")
        return 
PLUGIN_HANDLED
    
}
    
    if(
user_has_weapon(idCSW_SCOUT))
    {
        
ColorChat(idBLUE"You already have a Scout")
        return 
PLUGIN_HANDLED
    
}
    
    if (
timer_started[id])
    {
        
cs_set_weapon_ammo(give_item(id"weapon_scout"), 0)
        
ColorChat(idBLUE"Due to usage of weapon with speed +250, you aren't able to get into Pro15 list")
        return 
PLUGIN_HANDLED
    
}
    
    if((
get_user_flags(id) & VIP ))
    {
        
cs_set_weapon_ammo(give_item(id"weapon_scout"), 90)
    }
    else
    {
        
cs_set_weapon_ammo(give_item(id"weapon_scout"), 0)
    }
    return 
PLUGIN_HANDLED

bazhenov93 is offline
rak
Veteran Member
Join Date: Oct 2011
Location: banned country
Old 04-16-2012 , 12:48   Re: Check if player droped scout/weapon name
Reply With Quote #2

you don't understand nothing no?; i give you the answer in spanish forum;


Quote:
Originally Posted by rak View Post
register_clcmd("drop", "cmdDrop")
you need this.. and check if have scout.. very simple
__________________

www.amxmodx-es.com

Steam: Luchokoldo
rak is offline
Send a message via MSN to rak Send a message via Skype™ to rak
bazhenov93
Veteran Member
Join Date: Oct 2010
Old 04-16-2012 , 12:53   Re: Check if player droped scout/weapon name
Reply With Quote #3

Quote:
Originally Posted by rak View Post
you don't understand nothing no?; i give you the answer in spanish forum;



you need this.. and check if have scout.. very simple
using that way, the player can drop anything and will have that msg.

PHP Code:
new drop_id;


public 
plugin_init( ) {
    
register_concmd"drop""cmd_drop" );
    
register_touch"weaponbox""worldspawn""Fwd_Weapon_Touch" );
    
}

public 
cmd_drop(id) {
    if( !
is_user_alive(id) || !is_user_alive(id) ) {
        return;
    }
    
    new 
name35 ];
    
get_user_name(idname34 );
    
drop_id id;
}

public 
Fwd_Weapon_Touch(weaponworld) {
    
dropedf( );
}

public 
droped( ) {
    new 
name35 ];
    
get_user_name(drop_idname34 );
    
    
client_print0print_chat"A gun has been dropped by %s"name );
    

How to add only scout here
bazhenov93 is offline
kramesa
Veteran Member
Join Date: Feb 2011
Location: Brazil
Old 04-16-2012 , 13:00   Re: Check if player droped scout/weapon name
Reply With Quote #4

This?

Code:
#include <amxmodx> #include <amxmisc> new bool:ClientDropedScout[33]; public plugin_init()     register_clcmd("drop", "CmdDrop"); public CmdDrop(id) {     if(is_user_alive(id)) {         new Weapon;         Weapon = get_user_weapon(id, _, _);                 if(Weapon == CSW_SCOUT) {             ClientDropedScout[id] = true;                         // Your code here.         }     } }
__________________

Last edited by kramesa; 04-16-2012 at 13:01.
kramesa is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 04-16-2012 , 13:01   Re: Check if player droped scout/weapon name
Reply With Quote #5

Why not just removed dropped weapons?
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
rak
Veteran Member
Join Date: Oct 2011
Location: banned country
Old 04-16-2012 , 21:41   Re: Check if player droped scout/weapon name
Reply With Quote #6

Quote:
Originally Posted by Exolent[jNr] View Post
Why not just removed dropped weapons?
not is more simple do this? xD

PHP Code:
public cmdScout(id)
{
    if(! 
is_user_alive(id) && is_user_connected(id))
    {
        
ColorChat(idBLUE,"You must be alive to use this function")
        return 
PLUGIN_HANDLED
    
}
    
    if(
user_has_weapon(idCSW_SCOUT))
    {
        
ColorChat(idBLUE"You already have a Scout")
        return 
PLUGIN_HANDLED
    
}
    
    if((
get_user_flags(id) & VIP ))
    {
        
cs_set_weapon_ammo(give_item(id"weapon_scout"), 90)
    }
    else
    {
        
cs_set_weapon_ammo(give_item(id"weapon_scout"), 0)
    }
    
    if (
timer_started[id])
    {
        
ColorChat(idBLUE"Due to usage of weapon with speed +250, you aren't able to get into Pro15 list")
        return 
PLUGIN_HANDLED
    
}
    return 
PLUGIN_HANDLED

__________________

www.amxmodx-es.com

Steam: Luchokoldo
rak is offline
Send a message via MSN to rak Send a message via Skype™ to rak
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 04-16-2012 , 22:48   Re: Check if player droped scout/weapon name
Reply With Quote #7

Quote:
Originally Posted by rak View Post
not is more simple do this? xD
He wants that if you have a scout, drop it, and type /scout that you will not get a new scout?
Or something like that because you can just spam scout entities.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
rak
Veteran Member
Join Date: Oct 2011
Location: banned country
Old 04-16-2012 , 23:53   Re: Check if player droped scout/weapon name
Reply With Quote #8

Quote:
Originally Posted by Exolent[jNr] View Post
He wants that if you have a scout, drop it, and type /scout that you will not get a new scout?
Or something like that because you can just spam scout entities.
she's problem is( i suppouse ) don't give she the scout for vips when she drop his scout and write /scout.. sorry.. i know.. my english xD
__________________

www.amxmodx-es.com

Steam: Luchokoldo

Last edited by rak; 04-16-2012 at 23:54.
rak is offline
Send a message via MSN to rak Send a message via Skype™ to rak
bazhenov93
Veteran Member
Join Date: Oct 2010
Old 04-17-2012 , 11:35   Re: Check if player droped scout/weapon name
Reply With Quote #9

my problem is if (timer_started[id])

if you type scout, you get it.. you can get it every time, but every time you get a scout during a map time (kreedz) you got that message "Due to usage of weapon with speed +250, you ar....." I want this message only for 1 time..

and sorry for english too
bazhenov93 is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 04-17-2012 , 13:00   Re: Check if player droped scout/weapon name
Reply With Quote #10

Add another variable
PHP Code:
new bool:shown_scout_message[33];

// when timer starts
shown_scout_message[id] = false;

// when player gets scout
if(timer_started[id]) {
    if(!
shown_scout_message[id]) {
        
client_print(idprint_chat"yada yada");
        
shown_scout_message[id] = true;
    }

__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] 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 07:43.


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