AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   [TFC] Creating detpack entity (https://forums.alliedmods.net/showthread.php?t=104747)

HLM 09-27-2009 03:47

[TFC] Creating detpack entity
 
I am running a server with the medicmod plugin by hlstriker, in tfc there are walls and other things that can be 'destroyed' with detpacks to open new pathways, with medicmod, you cannot set detpacks as detpacks are for a certain class only, anyways I am trying to make a simple plugin that will create an entity when a user says in chat "!detpack" without the quotes..

PHP Code:

/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <engine>

#define PLUGIN "Detpacker"
#define VERSION "1.0"
#define AUTHOR "Master"


public plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
register_clcmd("say !detpack","set_detpack",-1,"Sets a detpack where you are standing")

}

public 
set_detpack(id)
{
    new 
entid create_entity("detpack")
    new 
Float:origin[3]
    
    
get_user_origin(idorigin0)
    
entity_set_model(entid"models/detpack.mdl")
    
entity_set_origin(entidFloat:origin)
    
entity_set_int(entidEV_INT_solid1)
    
// what am I missing?
    
client_print(id,print_chat,"[AMXX] Laying detpack at ^"%d^"",origin)
    return 
PLUGIN_HANDLED
}

public 
plugin_precache()
{
    
precache_model("models/detpack.mdl")
    
//since this is used by demoman, you would expect it to be precached
    // but its better to be safe than sorry :x


it apparently makes a detpack, but I guess it doesnt 'exist' because whe I try setting a detpack it says I cant stack detpacks..


All times are GMT -4. The time now is 22:37.

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