Raised This Month: $ Target: $400
 0% 

read kill??


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Arje
Senior Member
Join Date: Apr 2020
Location: Córdoba, Argentina
Old 06-07-2020 , 21:26   Re: read kill??
Reply With Quote #1

Quote:
Originally Posted by supertrio17 View Post
This should do it
thanks for your time! At first it didn't work, so I did this and now it does exactly what I wanted

PHP Code:
public ev_death()
{
    new 
Attacker read_data(1);
    new 
Victim read_data(2);
    new 
Team_attacker get_user_team(Attacker);
    new 
Team_victim get_user_team(Victim);
    
    if(
Team_attacker != Team_victim)
    {
    
g_has_kill[read_data(1)] = 1;
    if (
get_pcvar_num(death))
        {    
        new 
id read_data(2) + 200;
        
set_task(3.0"player_spawner"id);
        
set_task(3.2"player_spawner"id);    
        }
    }

so thanks again for the help!
Arje is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 06-08-2020 , 20:09   Re: read kill??
Reply With Quote #2

Why are you doing this?
PHP Code:
set_task(3.0"player_spawner"id);
set_task(3.2"player_spawner"id); 
__________________
Bugsy is offline
Arje
Senior Member
Join Date: Apr 2020
Location: Córdoba, Argentina
Old 06-08-2020 , 20:33   Re: read kill??
Reply With Quote #3

Quote:
Originally Posted by Bugsy View Post
Why are you doing this?
PHP Code:
set_task(3.0"player_spawner"id);
set_task(3.2"player_spawner"id); 

That is part of the original code of the Paintball Mod, personally I am very beginner in script so I am only trying to correct some known "errors" of the same plugin
Arje is offline
supertrio17
Senior Member
Join Date: May 2020
Location: Serbia
Old 06-08-2020 , 22:40   Re: read kill??
Reply With Quote #4

Well than my approach would still work, so there was no need to change it. I guess guy who made it need to have a little delay between functions.

Personally I used this approach when player dies to get his team, and it needs to have 3 second delay, because I need to detect player changing teams.
__________________
Contact! || Discord:
Mr_Boopsy_#2066
supertrio17 is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 06-08-2020 , 23:03   Re: read kill??
Reply With Quote #5

But why call the same function 0.2 seconds apart. Try removing the second one and see what happens.
PHP Code:
public player_spawner(id)
    if (
is_user_connected(id 200))
        if (
get_user_team(id 200) == || get_user_team(id 200) == 2)
            
dllfunc(DLLFunc_Spawnid 200); 
__________________
Bugsy 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 17:06.


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