Raised This Month: $ Target: $400
 0% 

Change Server Hostage Models


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
M1dn1ghtT0ker
Junior Member
Join Date: Mar 2006
Location: Calgary, Alberta, Canada
Old 07-14-2006 , 19:33   Change Server Hostage Models
Reply With Quote #1

What I want to do is change the hostage models on my server, how do i do this?
__________________
M1dn1ghtT0ker is offline
Send a message via MSN to M1dn1ghtT0ker
Cheap_Suit
Veteran Member
Join Date: May 2004
Old 07-14-2006 , 20:22   Re: Change Server Hostage Models
Reply With Quote #2

SOmething like this

Code:
    new hostages = -1
    while((hostages = find_ent_by_class(hostages, "hostage_entity")))
    {
            entity_set_model(hostages, "XXXXX.mdl")
    }
__________________
HDD fried, failed to backup files. Sorry folks, just don't have free time anymore. This is goodbye.
Cheap_Suit is offline
M1dn1ghtT0ker
Junior Member
Join Date: Mar 2006
Location: Calgary, Alberta, Canada
Old 07-14-2006 , 22:51   Re: Change Server Hostage Models
Reply With Quote #3

Code:
#include <amxmodx> #include <amxmisc> #include <engine> #define PLUGIN "Hostages" #define VERSION "1.0" #define AUTHOR "Stan <teh_n00berer>" public plugin_init() {     register_plugin("Hostages", "1.0", "Stan <teh_n00berer>")     register_event("ResetHUD", "hostages", "a") } public plugin_precache() {     precache_model("models/vicious/hostage.mdl") } public hostages(id)     new hostages = -1     while((hostages = find_ent_by_class(hostages, "hostage_entity")))     {         entity_set_string(hostages, "models/vicious/hostage.mdl")     } }

kind of like that?
__________________
M1dn1ghtT0ker is offline
Send a message via MSN to M1dn1ghtT0ker
Cheap_Suit
Veteran Member
Join Date: May 2004
Old 07-15-2006 , 05:35   Re: Change Server Hostage Models
Reply With Quote #4

Do it in every new round. You dont need to change the model everytime someone spawns.
Code:
register_event("HLTV", "Event_NewRound", "a", "1=0", "2=0")


w00t another scrip0r from alberta!
__________________
HDD fried, failed to backup files. Sorry folks, just don't have free time anymore. This is goodbye.
Cheap_Suit is offline
k007
BANNED
Join Date: Mar 2006
Location: bacon?
Old 07-31-2006 , 21:29   Re: Change Server Hostage Models
Reply With Quote #5

Quote:
Originally Posted by Cheap_Suit

w00t another scrip0r from alberta!
lolz i'm from alberta too !
k007 is offline
Send a message via MSN to k007
M1dn1ghtT0ker
Junior Member
Join Date: Mar 2006
Location: Calgary, Alberta, Canada
Old 07-15-2006 , 08:23   Re: Change Server Hostage Models
Reply With Quote #6

Code:
#include <amxmodx> #include <amxmisc> #include <engine> #define PLUGIN "Hostages" #define VERSION "1.0" #define AUTHOR "Stan <teh_n00berer>" public plugin_init() {     register_plugin("Hostages", "1.0", "Stan <teh_n00berer>")     register_event("HLTV", "hostages", "a") } public plugin_precache() {     precache_model("models/vicious/hostage.mdl")     precache_model("models/vicious/scientist.mdl") } public hostages(id) {     new hostages = (-1)     while((hostages = find_ent_by_class(hostages, "hostage_entity")))     {         entity_set_model(hostages, "models/vicious/hostage.mdl")     }         while((hostages = find_ent_by_class(hostages, "scientist_entity")))     {         entity_set_model(hostages, "models/vicious/scientist.mdl")     } }

That's my code, models change, but they can't be killed, or even shot, and people can walk thru them, how do I fix this?
__________________
M1dn1ghtT0ker is offline
Send a message via MSN to M1dn1ghtT0ker
VEN
Veteran Member
Join Date: Jan 2005
Old 07-15-2006 , 09:34   Re: Change Server Hostage Models
Reply With Quote #7

This should work:
Code:
#include <amxmodx> #include <engine> new g_hostage_entity[] = "hostage_entity" new g_scientist_entity[] = "scientist_entity" new g_model[] = "model" new g_model_hostage[] = "models/vicious/hostage.mdl" new g_model_scientist[] = "models/vicious/scientist.mdl" public plugin_precache() {     precache_model(g_model_hostage)     precache_model(g_model_scientist) } public pfn_keyvalue(entid) {     new class[24], key[8], temp[2]     copy_keyvalue(class, 23, key, 7, temp, 1)     if (equal(key, g_model)) {         if (equal(class, g_hostage_entity)) {             DispatchKeyValue(entid, g_model, g_model_hostage)         }         else if (equal(class, g_scientist_entity)) {             DispatchKeyValue(entid, g_model, g_model_scientist)         }         else             PLUGIN_CONTINUE         return PLUGIN_HANDLED     }     return PLUGIN_CONTINUE }
VEN is offline
M1dn1ghtT0ker
Junior Member
Join Date: Mar 2006
Location: Calgary, Alberta, Canada
Old 07-15-2006 , 21:12   Re: Change Server Hostage Models
Reply With Quote #8

thank you i will try it right now

Edit: Doesn't work it just crashes my server, it says "HostError: PF_precache_plugin error" or something like that
__________________

Last edited by M1dn1ghtT0ker; 07-15-2006 at 21:29.
M1dn1ghtT0ker is offline
Send a message via MSN to M1dn1ghtT0ker
VEN
Veteran Member
Join Date: Jan 2005
Old 07-16-2006 , 06:17   Re: Change Server Hostage Models
Reply With Quote #9

Seems like it's the corrupted/incorrect model(s).
Try this script, it works fine for me.
Code:
#include <amxmodx> #include <engine> new g_hostage_entity[] = "hostage_entity" new g_model[] = "model" #define MAX_HOSTAGES 4 new g_models[MAX_HOSTAGES][] = {"models/barney.mdl", "models/hgrunt.mdl", "models/scientist.mdl", "models/zombie.mdl"} new g_cur = -1 new g_ent public plugin_init() {     register_plugin("Hostage Models", "0.1", "VEN") } public plugin_precache() {     for (new i = 0; i < MAX_HOSTAGES; ++i)         precache_model(g_models[i]) } public pfn_keyvalue(entid) {     new class[16], key[8], temp[2]     copy_keyvalue(class, 15, key, 7, temp, 1)     if (!equal(class, g_hostage_entity))         return PLUGIN_CONTINUE     if (entid != g_ent) {         g_ent = entid         g_cur++     }     if (g_cur >= MAX_HOSTAGES)         return PLUGIN_CONTINUE     DispatchKeyValue(entid, g_model, g_models[g_cur])     if (equal(key, g_model))         return PLUGIN_HANDLED     return PLUGIN_CONTINUE }

Last edited by VEN; 07-16-2006 at 07:47.
VEN is offline
M1dn1ghtT0ker
Junior Member
Join Date: Mar 2006
Location: Calgary, Alberta, Canada
Old 07-16-2006 , 10:46   Re: Change Server Hostage Models
Reply With Quote #10

Quote:
Originally Posted by VEN
Seems like it's the corrupted/incorrect model(s).
Try this script, it works fine for me.
Code:
#include <amxmodx> #include <engine> new g_hostage_entity[] = "hostage_entity" new g_model[] = "model" #define MAX_HOSTAGES 4 new g_models[MAX_HOSTAGES][] = {"models/barney.mdl", "models/hgrunt.mdl", "models/scientist.mdl", "models/zombie.mdl"} new g_cur = -1 new g_ent public plugin_init() {     register_plugin("Hostage Models", "0.1", "VEN") } public plugin_precache() {     for (new i = 0; i < MAX_HOSTAGES; ++i)         precache_model(g_models[i]) } public pfn_keyvalue(entid) {     new class[16], key[8], temp[2]     copy_keyvalue(class, 15, key, 7, temp, 1)     if (!equal(class, g_hostage_entity))         return PLUGIN_CONTINUE     if (entid != g_ent) {         g_ent = entid         g_cur++     }     if (g_cur >= MAX_HOSTAGES)         return PLUGIN_CONTINUE     DispatchKeyValue(entid, g_model, g_models[g_cur])     if (equal(key, g_model))         return PLUGIN_HANDLED     return PLUGIN_CONTINUE }
yeah that would work fine if i wanted to use thouse models... but i dont

edit: i dont mean to sound like a prick i just would prefer to use the models i picked
__________________
M1dn1ghtT0ker is offline
Send a message via MSN to M1dn1ghtT0ker
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 00:43.


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