AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   All models do not changes (https://forums.alliedmods.net/showthread.php?t=46037)

Fighterzaka 10-17-2006 05:16

All models do not changes
 
Look i found a scirpting and edit little bit only name not the code it works but when next round some change the model not all
and next round again one player they was changed is normal and so other some times only 2 they changes soemtimes 70% of the peoples

The code is here:


Code:
Code: #include <amxmodx> #include <amxmisc> #include <cstrike> public plugin_init() {         register_plugin("Simpsons EDIT", "1.1.1", "Fighter")         register_event("ResetHUD", "resetModel", "b")         return PLUGIN_CONTINUE } public plugin_precache() {         precache_model("models/player/ctfun/ctfun.mdl")         precache_model("models/player/tfun/tfun.mdl")         return PLUGIN_CONTINUE } public resetModel(id, level, cid) {                 new CsTeams:userTeam = cs_get_user_team(id)             if(is_user_alive(id)) {                 if (userTeam == CS_TEAM_T) {                         cs_set_user_model(id, "tfun")                 }                 else if(userTeam == CS_TEAM_CT) {                         cs_set_user_model(id, "ctfun")                 }                 else {                         cs_reset_user_model(id)                 }         }         return PLUGIN_CONTINUE }

PS. i have place the
right place the proplem is all playrs do not changes :S¨

Please say if i ask too much

Fighterzaka 10-17-2006 16:10

Re: All models do not changes
 
Hello?

Lord_Destros 10-17-2006 23:11

Re: All models do not changes
 
1. Fix your indenting (I'm surprised it doesn't give you loose indentation warnings)
2. Why do you use id, level, cid as parameters (should only have id).
3. You don't need so many return statements

EDIT: Weird, I just noticed I have the same plugin in my cstrike folder :shock:

Fighterzaka 10-18-2006 05:13

Re: All models do not changes
 
Ok but i have a proplem more i can't code
i find that code can u like .. help me?

Code it? EDIT it?

Code:
//// simpsons.sma // C:\Programmer\hlserver\cstrike\addons\amxmodx\scripting\simpsons.sma<22> : warning 217: loose indentation // Header size:                            348 bytes // Code size:                               604 bytes // Data size:                               400 bytes // Stach/heap size:                   16384 bytes; estimated max. usage=175 cells <700 bytes> // Total requirements:                17816 // // 1 Warning. // Done. // // Compilation Time 0,19 sec // ------------------------------------------------

Fighterzaka 10-18-2006 08:06

Re: All models do not changes
 
I know can u do this for me Make every 30 Secounds it load the plugin or something like that PS. choose one of this
Code:

#include <amxmodx>
#include <amxmisc>
#include <cstrike>


public plugin_init() {
        register_plugin("Simpsons EDIT", "1.1.1", "Fighter")
        register_event("ResetHUD", "resetModel", "b")
        return PLUGIN_CONTINUE
}

public plugin_precache() {
        precache_model("models/player/ctfun/ctfun.mdl")
        precache_model("models/player/tfun/tfun.mdl")

        return PLUGIN_CONTINUE
}

public resetModel(id, level, cid) {

                new CsTeams:userTeam = cs_get_user_team(id)
            if(is_dedicated_server(id)) {

                if (userTeam == CS_TEAM_T) {
                        cs_set_user_model(id, "tfun")
                }
                else if(userTeam == CS_TEAM_CT) {
                        cs_set_user_model(id, "ctfun")
                }
                else {
                        cs_reset_user_model(id)
                }
        }

        return PLUGIN_CONTINUE
}

Next

Code:

#include <amxmodx>
#include <amxmisc>
#include <cstrike>


public plugin_init() {
        register_plugin("Simpsons EDIT", "1.1.1", "Fighter")
        register_event("ResetHUD", "resetModel", "b")
        return PLUGIN_CONTINUE
}

public plugin_precache() {
        precache_model("models/player/ctfun/ctfun.mdl")
        precache_model("models/player/tfun/tfun.mdl")

        return PLUGIN_CONTINUE
}

public resetModel(id, level, cid) {

                new CsTeams:userTeam = cs_get_user_team(id)
            if(is_user_alive(id)) {

                if (userTeam == CS_TEAM_T) {
                        cs_set_user_model(id, "tfun")
                }
                else if(userTeam == CS_TEAM_CT) {
                        cs_set_user_model(id, "ctfun")
                }
                else {
                        cs_reset_user_model(id)
                }
        }

        return PLUGIN_CONTINUE
}


Fighterzaka 10-20-2006 15:48

Re: All models do not changes
 
Hello?

[ --<-@ ] Black Rose 10-20-2006 16:16

Re: All models do not changes
 
Quote:

Originally Posted by Fighterzaka (Post 392501)
is_dedicated_server(id)

wtf?
a client cannot be a dedicated server.

Did you even read what Lord_Destros wrote?
This will work...
Code:
#include <amxmodx> #include <cstrike> public plugin_init() {     register_plugin("Simpsons EDIT", "1.1.1", "Fighter")     register_event("ResetHUD", "resetModel", "b") } public plugin_precache() {     precache_model("models/player/ctfun/ctfun.mdl")     precache_model("models/player/tfun/tfun.mdl") } public resetModel(id) {         if ( ! is_user_connected(id) || ! is_user_alive(id) )         return PLUGIN_CONTINUE         new CsTeams:userTeam = cs_get_user_team(id)         if ( userTeam == CS_TEAM_T )         cs_set_user_model(id, "tfun")         else if ( userTeam == CS_TEAM_CT )         cs_set_user_model(id, "ctfun")     else         cs_reset_user_model(id)         return PLUGIN_CONTINUE }


All times are GMT -4. The time now is 04:51.

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