Raised This Month: $32 Target: $400
 8% 

longest player who take model


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
tepegoz
Senior Member
Join Date: Apr 2019
Old 04-05-2020 , 06:14   longest player who take model
Reply With Quote #1

In the plugin I sent, there are 2 say command: /model and /nomodel . When type /model, players take model and when type /nomodel, players reset its models.
What I want is the determination of 1 person from each team that takes the model for the longest time among the players who take the model.
When the player takes the model, his / her time will start and when he leaves the model, the time will be paused and when he takes the model again, the time will continue from where he left off. (Time will not be visible)
When I type say /showtimes, all times will stop and name of the player who takes the model for the longest time, will be written in the motd list as name, duration, team and map-name and will appear the motd.
Maximum 1 person from each team will be determined in 1 map. So it's the best of the T team and the best of the Ct team. When the type say /showtimes ,only 10 people will appear. Thank you.
PHP Code:
/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <cstrike>
#include <engine>
#include <fakemeta>
#include <fun>
#include <amxmisc>


#define PLUGIN "New Plug-In"
#define VERSION "1.0"
#define AUTHOR "author"


new bool:user_is_model[33
public 
plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
register_clcmd("say /model","cmdmodel"
    
register_clcmd("say_team /model","cmdmodel"
    
    
register_clcmd("say /nomodel","cmdnomodel"
    
register_clcmd("say_team /nomodel","cmdnomodel"

}
public 
plugin_precache()
{
    
precache_model("models/player/model1/model1.mdl")
    
precache_model("models/player/model2/model2.mdl")
}
public 
cmdmodel(id

    
        if(
is_user_alive(id))
        {
            new 
userteam get_user_team(id
            if(!
user_is_model[id]) 
            {
                
                if(
userteam == 2
                { 
                    
                          
user_is_model[id] = true 
                        
                          cs_set_user_model
(id"model1")
                        
                } 
                else if(
userteam == 1
                { 
                          
user_is_model[id] = true 
                          cs_set_user_model
(id"model2")        
                    
                }    
                
            
        }
        }
        return 
PLUGIN_HANDLED
}

public 
cmdnomodel(id
{     

    if(
user_is_model[id]) 
    {
        new 
CsTeams:userteam cs_get_user_team(id
        new 
name[33
        
get_user_name(idname,3)
        
        if(
userteam == CS_TEAM_CT
        { 
            
            
user_is_model[id] = false     
            
            
            
            cs_reset_user_model
(id)
            
        } 
        else if(
userteam == CS_TEAM_T
        { 
            
            
user_is_model[id] = false 
            
            
            cs_reset_user_model
(id)
            
        } 
    } 
    } 

Last edited by tepegoz; 04-05-2020 at 06:14.
tepegoz is offline
Old 04-08-2020, 07:34
tepegoz
This message has been deleted by HamletEagle. Reason: Do not bump.
tepegoz
Senior Member
Join Date: Apr 2019
Old 04-15-2020 , 11:03   Re: longest player who take model
Reply With Quote #2

Can you help me?

Last edited by tepegoz; 04-15-2020 at 11:03.
tepegoz is offline
tepegoz
Senior Member
Join Date: Apr 2019
Old 05-06-2020 , 07:07   Re: longest player who take model
Reply With Quote #3

Can you help me?
tepegoz 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 21:51.


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