AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Detect OldModel and NewModel (https://forums.alliedmods.net/showthread.php?t=126525)

shinoda 05-10-2010 10:58

Detect OldModel and NewModel
 
for example:

PHP Code:

public client_infochanged(id) {
     new 
sOldName[32], sNewName[32]

     
get_user_name(idsOldName31)
     
get_user_info(idsNewName31)
     
     if(!
equali(sOldNamesNewName)) {
     
// My Code
     
}


but with models
PHP Code:

if(!equali(sOldModelsNewModel) {
     
// My Code
     


Not for cs

Exolent[jNr] 05-10-2010 18:06

Re: Detect OldModel and NewModel
 
Code:
#include < amxmodx > #include < fakemeta > const MAX_PLAYERS = 32; new g_szCurrentModel[ MAX_PLAYERS + 1 ][ 32 ]; public plugin_init( ) {     register_forward( FM_SetKeyValue, "FwdSetKeyValuePre" ); } public client_disconnect( iPlayer ) {     g_szCurrentModel[ iPlayer ][ 0 ] = 0; } public FwdSetKeyValuePre( iPlayer, szKey[ ], szValue[ ] ) {     if( equal( szKey, "model" ) )     {         // player's model is being set a value                 if( !equal( szValue, g_szCurrentModel[ iPlayer ] ) )         {             // current model is different                         // save new model             copy( g_szCurrentModel[ iPlayer ], charsmax( g_szCurrentModel[ ] ), szValue );         }     } }


All times are GMT -4. The time now is 03:40.

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