i want this func work with teams
if(!pev_valid(entid) || !equal(model, "sprites/laserdot.spr"))
return FMRES_IGNORED
engfunc(EngFunc_SetModel,entid, "sprites/my_sprite1.spr")
return FMRES_SUPERCEDE
like this !
ex :
Код:
/* Plugin generated by AMXX-Studio */
#include <amxmodx>
#include <amxmisc>
#include <fakemeta_util>
#include <engine>
#define PLUGIN "laserdotchange"
#define VERSION "1.0"
#define AUTHOR "test"
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR);
register_forward(FM_SetModel, "FORWARD_SET_MODEL", 0);
}
public plugin_precache()
{
precache_model("sprites/my_sprite1.spr")
precache_model("sprites/my_sprite2.spr")
}
public FORWARD_SET_MODEL(entid, model[])
{
new id = pev(entid, pev_owner);
new team = get_user_team(id);
if(team == 1)
{
if(!pev_valid(entid) || !equal(model, "sprites/laserdot.spr"))
return FMRES_IGNORED
engfunc(EngFunc_SetModel,entid, "sprites/my_sprite1.spr")
return FMRES_SUPERCEDE
}
if(team == 2)
{
if(!pev_valid(entid) || !equal(model, "sprites/laserdot.spr"))
return FMRES_IGNORED
engfunc(EngFunc_SetModel,entid, "sprites/my_sprite2.spr")
return FMRES_SUPERCEDE
}
}
but
Код:
Welcome to the AMX Mod X 1.8.1-300 Compiler.
Copyright (c) 1997-2013 ITB CompuPhase, AMX Mod X Team
include\engine_const.inc(249) : warning 201: redefinition of constant/macro (symbol "TraceResult")
laserdot_team.sma(46) : warning 217: loose indentation
laserdot_team.sma(52) : warning 217: loose indentation
laserdot_team.sma(58) : warning 209: function "FORWARD_SET_MODEL" should return a value
Header size: 376 bytes
Code size: 924 bytes
Data size: 708 bytes
Stack/heap size: 16384 bytes; estimated max. usage=780 cells (3120 bytes)
Total requirements: 18392 bytes
4 Warnings.
Done.
im not sur with code !! and not work ( server crashed )
![Search :Search:](./images/smilies/search.gif)