AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   client_infochanged model! (https://forums.alliedmods.net/showthread.php?t=281587)

abdobiskra 04-15-2016 06:41

client_infochanged model!
 
Hi !
who can give me the better way to cheack players has changed models in consol using "model" cmd

i tryed that but it is not accurate!

PHP Code:

new new_model[33][32
new 
old_model[33][32

public 
client_infochanged(id
{  
    if(!
is_user_alive(id))
    
get_user_info(id,"model",old_model[id],31

    if(!
equali(new_model[id],old_model[id]))
    {
        
client_cmd(id,"drop");
        
client_print(id,print_chat,"==== Check Model !==== "
        return 
PLUGIN_HANDLED     
    
}
    
    return 
PLUGIN_HANDLED



abdobiskra 04-16-2016 14:52

Re: client_infochanged model!
 
Bump!

fysiks 04-16-2016 15:41

Re: client_infochanged model!
 
Perhaps you should read the rules.

Krtola 04-16-2016 17:17

Re: client_infochanged model!
 
Give me full code.

abdobiskra 04-17-2016 01:43

Re: client_infochanged model!
 
Quote:

Originally Posted by Krtola (Post 2411681)
Give me full code.


PHP Code:

/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <amxmisc>

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

new new_model[33][32
new 
old_model[33][32]

public 
plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
// Add your code here...
}
 

public 
client_infochanged(id
{  
    if(!
is_user_alive(id))
    
get_user_info(id,"model",old_model[id],31

    if(!
equali(new_model[id],old_model[id]))
    {
        
client_cmd(id,"drop");
        
client_print(id,print_chat,"==== Check Model !==== "
        return 
PLUGIN_HANDLED     
    
}
    
    return 
PLUGIN_HANDLED


this all !

siriusmd99 04-17-2016 04:07

Re: client_infochanged model!
 
Because you haven't used array new_model, you just check if it's not equal with old_mod, but new_model[id] has no value.

Krtola 04-17-2016 05:08

Re: client_infochanged model!
 
Try this:
PHP Code:

#include <amxmodx>
#include <fakemeta>

#define PLUGIN "Block Model Change"
#define VERSION "1.0"
#define AUTHOR "Krtola"

public plugin_init() 
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
register_forward(FM_ClientUserInfoChanged"client_infochanged")
}
 

public 
client_infochanged(id
{  
    new 
newmodel[32],oldmodel[32
    
get_user_info(id"name"newmodel,31
    
fm_get_user_model(id,oldmodel,31)

    
get_user_info(id,"model",oldmodel[id],31

    if(!
equali(newmodel[id],oldmodel[id]))
    {
        
client_cmd(id,"drop");
        
client_print(id,print_chat,"==== Check Model !==== "
        return 
PLUGIN_HANDLED     
    
}
    
    return 
PLUGIN_HANDLED
}

stock fm_get_user_model(playermodel[], len)
{
    
engfunc(EngFunc_InfoKeyValueengfunc(EngFunc_GetInfoKeyBufferplayer), "model"modellen)



abdobiskra 04-17-2016 07:06

Re: client_infochanged model!
 
Thank you so much guys !

Krtola

You Gold special Thx :D


All times are GMT -4. The time now is 18:33.

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