Дезинфа. Нету вэб компилятора 1.9
- Ошибка
-
cs_models_manager.sma(173) : error 088: number of arguments does not match definition
- Компилятор
- WEB-компилятор
- Amx Mod X
- 1.9.0
- Исходный код
-
new const CONFIGNAME[] = "/players_models.ini";
new const MODELSDIR[] = "models/player";
const m_iPlayerTeam = 114;
const m_iModelIndexPlayer = 491;
const XO_PLAYER = 5;
const MAX_SIZE_PL_MODEL_DIR = 20;
const MAX_SIZE_PL_MODEL_NAME = 16;
const MAX_SIZE_PL_MODEL_TEAM = 4;
enum _: ENUM_DATA_TEAMS {
TEAM_NULL,
TEAM_T,
TEAM_CT
};
enum _: ENUM_DATA_PL_MODELS_INFO {
PL_MDL_TYPE[6],
PL_MDL_AUTH[35],
PL_MDL_TEAM[MAX_SIZE_PL_MODEL_TEAM],
PL_MDL_MODEL[MAX_SIZE_PL_MODEL_NAME]
};
new g_iArrayPlayerModelSize;
new bool: gp_bModel[MAX_PLAYERS+1];
new gp_szModel[MAX_PLAYERS+1][MAX_SIZE_PL_MODEL_NAME],
gp_szPersonalModels[MAX_PLAYERS+1][ENUM_DATA_TEAMS][MAX_SIZE_PL_MODEL_NAME];
new Array: g_aPlayerModel;
/*================================================================================
[PLUGIN]
=================================================================================*/
public plugin_init() {
/* [PLUGIN] */
register_plugin(PLUGIN_AUTHOR, PLUGIN_VERSION, PLUGIN_AUTHOR);
}
public plugin_precache() {
g_aPlayerModel = ArrayCreate(ENUM_DATA_PL_MODELS_INFO);
new szConfigFile[64]; get_configsdir(szConfigFile, sizeof(szConfigFile));
add(szConfigFile, charsmax(szConfigFile), CONFIGNAME);
#if defined DEBUGINFO
log_amx("szConfigFile: '%s'", szConfigFile);
#endif
if(!dir_exists(MODELSDIR))
{
log_amx("[WARN] Directory '%s' not found! Will be created automatically!", MODELSDIR);
mkdir(MODELSDIR);
}
new iFile = fopen(szConfigFile, "rt");
if(iFile){
new szLineBuffer[6 + 35 + MAX_SIZE_PL_MODEL_TEAM + MAX_SIZE_PL_MODEL_NAME],
szPrecache[MAX_SIZE_PL_MODEL_DIR + MAX_SIZE_PL_MODEL_NAME * 2];
new aData[ENUM_DATA_PL_MODELS_INFO];
while(!(feof(iFile))){
fgets(iFile, szLineBuffer, charsmax(szLineBuffer));
trim(szLineBuffer);
strtolower(szLineBuffer);
if(!(szLineBuffer[0]) || szLineBuffer[0] == ';' || szLineBuffer[0] == '#')
{
continue;
}
new parseArgsNum = parse(szLineBuffer,
aData[PL_MDL_TYPE], charsmax(aData[PL_MDL_TYPE]),
aData[PL_MDL_AUTH], charsmax(aData[PL_MDL_AUTH]),
aData[PL_MDL_TEAM], charsmax(aData[PL_MDL_TEAM]),
aData[PL_MDL_MODEL], charsmax(aData[PL_MDL_MODEL])
);
if(parseArgsNum < 4)
{
log_amx("Line '%s' not valid, will be skipped.", szLineBuffer);
continue;
}
#if defined DEBUGINFO
log_amx("^nFILE_READ^nType: '%s'^nAuth: '%s'^nTeam: '%s'^nModel: '%s'^n",aData[PL_MDL_TYPE], aData[PL_MDL_AUTH], aData[PL_MDL_TEAM], aData[PL_MDL_MODEL]);
#endif
formatex(szPrecache, charsmax(szPrecache), "%s/%s.mdl", MODELSDIR, aData[PL_MDL_MODEL]);
if(file_exists(szPrecache)){
precache_model(szPrecache);
ArrayPushArray(g_aPlayerModel, aData);
}else{
log_amx("[WARN] Model '%s' not found!", szPrecache);
}
}
if((g_iArrayPlayerModelSize = ArraySize(g_aPlayerModel))) {
/* [HAMSANDWICH] */
RegisterHam(Ham_Spawn, "player", "HamHook_Player_Spawn", true);
/* [FAKEMETA] */
register_forward(FM_SetClientKeyValue, "FMHook_SetClientKeyValue", false);
}
} else {
new const szInstructions[] = {
"\
; Instruction for use:^n\
; [Types]^n\
; 1 - IP^n\
; 2 - SteamId^n\
; 3 - Flag^n\
; 4 - Steam player (key ^"steam^")^n\
; 5 - Team, Everything else (key ^"TT | CT | ANY^")^n\
; 6 - Name^n^n\
; [Syntax]^n\
; ^"Type^" ^"IP | SteamId | Name | Flag | Team | *(for modes Steam | Team)^" \
^"Team: TT | CT | Any^" ^"Model name (without .mdl)^"^n^n\
; [Example]^n\
; ^"ip^" ^"127.0.0.1^" ^"CT^" ^"vip^"^n\
; ^"steam^" ^"*^" ^"TT^" ^"sas^"^n\
; ^"steam^" ^"STEAM_0:0:1234567^" ^"ANY^" ^"chicken^"^n\
; ^"flag^" ^"t^" ^"ct^" ^"vip_ct/vip_ct^"^n\
; ^"flag^" ^"d^" ^"tt^" ^"admin_t^"\
"
};
if(!file_exists(szConfigFile))
{
log_amx("[WARNING] Config file ^"%s^" not found! Will be created automatically!", szConfigFile);
if(!write_file(szConfigFile, szInstructions))
{
set_fail_state("[ERROR] Config file ^"%s^" not created! No access to write!", szConfigFile);
}else{
log_amx("Config File '%s' was created!", szConfigFile);
}
}
}
fclose(iFile);
}
public plugin_end(){
ArrayDestroy(g_aPlayerModel);
}
/*================================================================================
[CLIENT]
=================================================================================*/
public client_putinserver(pId) {
if(is_user_bot(pId) || is_user_hltv(pId))
return PLUGIN_HANDLED;
new aData[ENUM_DATA_PL_MODELS_INFO];
for(new iCount = 0; iCount < g_iArrayPlayerModelSize; iCount++) {
if(ArrayGetArray(g_aPlayerModel, iCount, aData)) {
if(aData[PL_MDL_AUTH][0] == '*') {
if(equal(aData[PL_MDL_TYPE], "team", 4) || (equal(aData[PL_MDL_TYPE], "steam", 5) && funcIsUserSteam(pId))) {
if(equal(aData[PL_MDL_TEAM], "any", 3)) {
formatex(gp_szPersonalModels[pId][TEAM_T], charsmax(gp_szPersonalModels[][]), aData[PL_MDL_MODEL]);
formatex(gp_szPersonalModels[pId][TEAM_CT], charsmax(gp_szPersonalModels[][]), aData[PL_MDL_MODEL]);
} else formatex(gp_szPersonalModels[pId][aData[PL_MDL_TEAM][0] == 't' ? TEAM_T : TEAM_CT], charsmax(gp_szPersonalModels[][]), aData[PL_MDL_MODEL]);
}
continue;
}
if(equal(aData[PL_MDL_TYPE], "ip", 2)) {
new szIP[16]; get_user_ip(pId, szIP, charsmax(szIP));
if(equal(aData[PL_MDL_AUTH], szIP)) {
if(equal(aData[PL_MDL_TEAM], "any", 3)) {
formatex(gp_szPersonalModels[pId][TEAM_T], charsmax(gp_szPersonalModels[][]), aData[PL_MDL_MODEL]);
formatex(gp_szPersonalModels[pId][TEAM_CT], charsmax(gp_szPersonalModels[][]), aData[PL_MDL_MODEL]);
} else formatex(gp_szPersonalModels[pId][aData[PL_MDL_TEAM][0] == 't' ? TEAM_T : TEAM_CT], charsmax(gp_szPersonalModels[][]), aData[PL_MDL_MODEL]);
}
continue;
}
if(equal(aData[PL_MDL_TYPE], "name", 4)) {
new szName[32]; get_user_name(pId, szName, charsmax(szName));
if(equal(aData[PL_MDL_AUTH], szName)) {
if(equal(aData[PL_MDL_TEAM], "any", 3)) {
formatex(gp_szPersonalModels[pId][TEAM_T], charsmax(gp_szPersonalModels[][]), aData[PL_MDL_MODEL]);
formatex(gp_szPersonalModels[pId][TEAM_CT], charsmax(gp_szPersonalModels[][]), aData[PL_MDL_MODEL]);
} else formatex(gp_szPersonalModels[pId][aData[PL_MDL_TEAM][0] == 't' ? TEAM_T : TEAM_CT], charsmax(gp_szPersonalModels[][]), aData[PL_MDL_MODEL]);
}
continue;
}
if(equal(aData[PL_MDL_TYPE], "steam", 5)) {
new szSteamId[35]; get_user_authid(pId, szSteamId, charsmax(szSteamId));
if(equal(aData[PL_MDL_AUTH], szSteamId)) {
if(equal(aData[PL_MDL_TEAM], "any", 3)) {
formatex(gp_szPersonalModels[pId][TEAM_T], charsmax(gp_szPersonalModels[][]), aData[PL_MDL_MODEL]);
formatex(gp_szPersonalModels[pId][TEAM_CT], charsmax(gp_szPersonalModels[][]), aData[PL_MDL_MODEL]);
} else formatex(gp_szPersonalModels[pId][aData[PL_MDL_TEAM][0] == 't' ? TEAM_T : TEAM_CT], charsmax(gp_szPersonalModels[][]), aData[PL_MDL_MODEL]);
}
continue;
}
if(equal(aData[PL_MDL_TYPE], "flag", 4)) {
if(get_user_flags(pId) & read_flags(aData[PL_MDL_AUTH])) {
if(equal(aData[PL_MDL_TEAM], "any", 3)) {
formatex(gp_szPersonalModels[pId][TEAM_T], charsmax(gp_szPersonalModels[][]), aData[PL_MDL_MODEL]);
formatex(gp_szPersonalModels[pId][TEAM_CT], charsmax(gp_szPersonalModels[][]), aData[PL_MDL_MODEL]);
} else formatex(gp_szPersonalModels[pId][aData[PL_MDL_TEAM][0] == 't' ? TEAM_T : TEAM_CT], charsmax(gp_szPersonalModels[][]), aData[PL_MDL_MODEL]);
}
}
}
}
return PLUGIN_CONTINUE;
}
public client_disconnect(pId) {
if(g_iArrayPlayerModelSize) {
gp_bModel[pId] = false;
gp_szModel[pId] = "";
gp_szPersonalModels[pId][TEAM_T] = "";
gp_szPersonalModels[pId][TEAM_CT] = "";
remove_task(pId + TASK_ID_PLAYER_MODEL_FIXED);
}
}
/*================================================================================
[HAMSANDWICH]
=================================================================================*/
public HamHook_Player_Spawn(const pId) {
if(is_user_alive(pId)){
new iTeam = get_pdata_int(pId, m_iPlayerTeam, XO_PLAYER);
if(gp_szPersonalModels[pId][iTeam][0] != '^0')
{
FM_SetPlayerModel(pId, gp_szPersonalModels[pId][iTeam]);
}
}
}
/*================================================================================
[FAKEMETA]
=================================================================================*/
public FMHook_SetClientKeyValue(const pId, const szLineBuffer[], const szKey[]) {
if(gp_bModel[pId] && equal(szKey, "model", 5)) {
new szModel[MAX_SIZE_PL_MODEL_NAME]; FM_GetPlayerModel(pId, szModel, charsmax(szModel));
if(!(equal(szModel, gp_szModel[pId])))
FM_SetPlayerModel(pId, gp_szModel[pId]);
return FMRES_SUPERCEDE;
}
return FMRES_IGNORED;
}
FM_GetPlayerModel(const pId, const szModel[], const iLen) return engfunc(EngFunc_InfoKeyValue, engfunc(EngFunc_GetInfoKeyBuffer, pId), "model", szModel, iLen);
FM_SetPlayerModel(const pId, const szModel[]) {
copy(gp_szModel[pId], charsmax(gp_szModel[]), szModel);
static Float: fGameTime, Float: fChangeTime; fGameTime = get_gametime();
if(fGameTime - fChangeTime > 0.1) {
taskSetPlayerModelFixed(pId + TASK_ID_PLAYER_MODEL_FIXED);
fChangeTime = fGameTime;
} else {
set_task((fChangeTime + 0.1) - fGameTime, "taskSetPlayerModelFixed", pId + TASK_ID_PLAYER_MODEL_FIXED);
fChangeTime += 0.1;
}
}
public taskSetPlayerModelFixed(pId) {
pId -= TASK_ID_PLAYER_MODEL_FIXED;
engfunc(EngFunc_SetClientKeyValue, pId, engfunc(EngFunc_GetInfoKeyBuffer, pId), "model", gp_szModel[pId]);
new szLineBuffer[MAX_SIZE_PL_MODEL_DIR + MAX_SIZE_PL_MODEL_NAME * 2]; formatex(szLineBuffer, charsmax(szLineBuffer), "%s/%s.mdl", MODELSDIR, gp_szModel[pId]);
set_pdata_int(pId, m_iModelIndexPlayer, engfunc(EngFunc_ModelIndex, szLineBuffer), XO_PLAYER);
gp_bModel[pId] = true;
}
/*================================================================================
[STOCK]
=================================================================================*/
bool: funcIsUserSteam(const pId) {
static dp_pointer;
if(dp_pointer || (dp_pointer = get_cvar_pointer("dp_r_id_provider"))) {
server_cmd("dp_clientinfo %d", pId);
server_exec();
return bool: (get_pcvar_num(dp_pointer) == 2);
}
return false;
}
cs_models_manager.sma(173) : error 088: number of arguments does not match definition
Совсем не пойму в чем проблема. Подскажите пожалуйста)
WEB: c-s.net.ua/compiler/
Совсем не пойму в чем проблема. Подскажите пожалуйста)
WEB: c-s.net.ua/compiler/
В этой теме было размещено решение! Перейти к решению.