AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Need some help @ spawning an entity (https://forums.alliedmods.net/showthread.php?t=12460)

vampire 04-16-2005 11:14

Need some help @ spawning an entity
 
*updated*

Hi, i have a problem at spawning an entity.
Code:
#include <amxmodx> #include <amxmisc> #include <ns2amx> #include <engine> public plugin_init() {   register_plugin("test","0.9b","B")   register_clcmd("say /armory","cmdArmory",ADMIN_MAP,"spawn a armory")   register_cvar ("amx_test_debug","0") // debug messages disabled by default } public cmdArmory(id) {       new ent       ent = create_entity("team_armory")       new szOrigin[128]       new origin[3]       get_user_origin(id,origin,0)             format(szOrigin,127,"%d %d %d",origin[0],origin[1],origin[2])       entity_set_origin ( ent, szOrigin[127] ) // <- row 23 return PLUGIN_HANDLED; }
the team_armory is an ns specific entity, so dont wonder about it :D
Now the problem:
I get this error on compiling
Code:

test.sma(23) : error 047: array sizes must match
test.sma(25) : warning 217: loose indentation

thanks in advanced

-vampire

xeroblood 04-16-2005 12:03

Code:
public cmdArmory(id) {       new ent       ent = create_entity("team_armory")       new origin[3]       get_user_origin(id,origin,0)             entity_set_origin ( ent, origin ) // <- row 23       return PLUGIN_HANDLED; }

vampire 04-16-2005 12:09

wee thx :D
i still get a warning 213: tag mismatch
dunno whats up with that :D

XxAvalanchexX 04-16-2005 12:28

entity_set_origin takes a Float array! :-p

Code:
public cmdArmory(id) {       new ent       ent = create_entity("team_armory")       new Float:origin[3]       emtity_get_vector(id,EV_VEC_origin,origin);               entity_set_origin ( ent, origin )       return PLUGIN_HANDLED; }

xeroblood 04-16-2005 16:04

Quote:

Originally Posted by XxAvalanchexX
entity_set_origin takes a Float array! :-p

:P was in a rush! lol.. I knew you'd pick it up!! :D


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

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