AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Getting player model (https://forums.alliedmods.net/showthread.php?t=64892)

hip_hop_x 12-26-2007 19:56

Getting player model
 
Code:

new model[32]
pev(id,pev_model, model, 31)
if(contain(model,"vegeta") != -1){
//my code
}

What's wrong, even if my player model is the vegeta one, the code doesn't detect it :(. Does pev_model returns the string id?

Arkshine 12-26-2007 20:34

Re: Getting player model
 
I believe that it's only for weapons. Not sure.

Anyway, here, cs_get_user_model() converted to FM, you can do something like:

Code:
    #include <amxmodx>     #include <fakemeta>         #define get_user_model(%1,%2,%3) engfunc( EngFunc_InfoKeyValue, engfunc( EngFunc_GetInfoKeyBuffer, %1 ), "model", %2, %3 )     public plugin_init()     {         // ...     }         my_function( id )     {         static sModel[32];         get_user_model( id, sModel, charsmax( sModel ) );                 log_amx( "id = %d | model = '%s'", id, sModel );     }

hip_hop_x 12-27-2007 07:15

Re: Getting player model
 
thanks allot mate, works now.


All times are GMT -4. The time now is 10:59.

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