AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   cs_get_user_model (https://forums.alliedmods.net/showthread.php?t=11749)

Cheap_Suit 03-27-2005 19:21

cs_get_user_model
 
ok i need help getting what model is the player is using
so far i got this

Code:

public check(id) {

        new usermodel[31]
        cs_get_user_model(id, usermodel,32)

        if(containi(usermodel, "terror")) {
       
        client_print( id, print_chat, "Terror Model" )
       
        }else{
       
        client_print( id, print_chat, "Non Terror Model" )
       
        }

        return PLUGIN_HANDLED       
}

only says Non Terror Model... any help would be greatly appreciated thank you :roll:

v3x 03-27-2005 19:38

You did select the "terror" player from the 4, right?

Cheap_Suit 03-27-2005 19:51

my bad.... god this cz skins messing me up :shock: :shock:

thank very much

v3x 03-27-2005 20:37

LOL, we all make little mistakes like this once in a while. :D

Cheap_Suit 03-27-2005 20:57

Code:

public check(id) {

        new usermodel[31]
        cs_get_user_model(id, usermodel,32)

        if(containi(usermodel, "TERROR")) {

                client_print( id, print_chat, "Terror" )

                }else{

                if(containi(usermodel, "LEET")) {

                        client_print( id, print_chat, "Leet" )

                        }else{

                        if(containi(usermodel, "ARCTIC")) {

                                client_print( id, print_chat, "arctic" )

                                }else{

                                if(containi(usermodel, "GUERILLA")) {

                                        client_print( id, print_chat, "guerilla" )
                                }
                        }
                }
        }
        return PLUGIN_HANDLED
}

seem only works with leet, every thing else is terror :cry:

v3x 03-27-2005 20:58

Maybe it's cAsE-sEnSiTiVe..

Edit: Try this..
Code:
public check(id) {     new usermodel[33]     cs_get_user_model(id, usermodel,32)     usermodel[32] = strtolower(usermodel)     if(containi(usermodel, "terror")) {         client_print( id, print_chat, "Terror" )     }     else if(containi(usermodel, "leet")) {         client_print( id, print_chat, "Leet" )     }     else if(containi(usermodel, "arctic")) {         client_print( id, print_chat, "arctic" )     }     else if(containi(usermodel, "guerilla")) {         client_print( id, print_chat, "guerilla" )     }     else {         client_print( id, print_chat, "Not a terrorist")     }     return PLUGIN_HANDLED }

Cheap_Suit 03-27-2005 21:13

same problem :oops:

v3x 03-27-2005 21:18

Try it again (updated)..

Cheap_Suit 03-27-2005 21:20

even worst every model is terror

v3x 03-27-2005 21:25

Try a switch() statement.


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

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