MAGNAT2645
Участник
- Сообщения
- 63
- Реакции
- 7
Проблема заключается в том, что компилятор пишет:
saysounds.sp(962) : warning 213: tag mismatch
saysounds.sp(962) : error 035: argument type mismatch (argument 2)
И такие ошибки в разных местах, где есть (например):
Второй аргумент функции в коде разный, я просто привёл один пример.
Вот сама функция:
Код не мой, я взял его из последней версии Say Sounds Redux.
saysounds.sp(962) : warning 213: tag mismatch
saysounds.sp(962) : error 035: argument type mismatch (argument 2)
И такие ошибки в разных местах, где есть (например):
PHP:
runSoundEvent(event, "uber", "uber", attacker, victim, -1);
// или
runSoundEvent(event, "kill", "headshot", attacker, victim, -1);
// ошибка такая же
Второй аргумент функции в коде разный, я просто привёл один пример.
Вот сама функция:
PHP:
public runSoundEvent(Handle:event, String:type[], String:extra[], attacker, victim, team)
{
decl String:action[PLATFORM_MAX_PATH + 1];
decl String:extraparam[PLATFORM_MAX_PATH + 1];
decl String:location[PLATFORM_MAX_PATH + 1];
decl String:playto[PLATFORM_MAX_PATH + 1];
new bool:result = false;
if (listfile == INVALID_HANDLE)
return false;
KvRewind(listfile);
if (!KvGotoFirstSubKey(listfile))
return false;
// Do while loop that finds out what extra parameter is and plays according sound, also adds random
do
{
KvGetString(listfile, "action", action, sizeof(action), "");
//PrintToServer("Found Subkey, trying to match (%s) with (%s)",action,type);
if (StrEqual(action, type, false))
{
if (!KvGetNum(listfile, "enable", 1))
continue;
//KvGetString(listfile, "file", location, sizeof(location),"");
// ###### Random Sound ######
decl String:file[8] = "file";
new count = KvGetNum(listfile, "count", 1);
if (count > 1)
Format(file, sizeof(file), "file%d", GetRandomInt(1, count));
if (StrEqual(file, "file1"))
KvGetString(listfile, "file", location, sizeof(location), "");
else
KvGetString(listfile, file, location, sizeof(location), "");
// ###### Random Sound End ######
KvGetString(listfile, "param", extraparam, sizeof(extraparam), action);
if (team == -1)
KvGetString(listfile, "playto", playto, sizeof(playto), "all");
else
KvGetString(listfile, "playto", playto, sizeof(playto), "RoundEvent");
// Used for identifying the names of things
//PrintToChatAll("Found Subkey, trying to match (%s) with (%s)",extra,extraparam);
if (!IsGameSound(location) && !checkSamplingRate(location))
return false;
if (StrEqual(extra, extraparam, false)) // && checkSamplingRate(location))
{
// Next section performs random calculations, all percents in decimal from 1-0
new Float:random = KvGetFloat(listfile, "prob", 1.0);
// Added error checking for the random number
if (random <= 0.0)
{
random = 0.01;
PrintToChatAll("Your random value for (%s) is <= 0, please make it above 0", location);
}
else if (random > 1.0)
random = 1.0;
new Float:generated = GetRandomFloat(0.0, 1.0);
// Debug line for new action sounds -- FernFerret
//PrintToChatAll("I found action: %s",action);
if (generated <= random)
{
//### Delay
new Float:delay = KvGetFloat(listfile, "delay", 0.1);
if (delay < 0.1)
delay = 0.1;
else if (delay > 60.0)
delay = 60.0;
new Handle:pack;
CreateDataTimer(delay, runSoundEventTimer, pack, TIMER_FLAG_NO_MAPCHANGE);
WritePackCell(pack, attacker);
WritePackCell(pack, victim);
WritePackCell(pack, team);
WritePackString(pack, playto);
WritePackString(pack, location);
ResetPack(pack);
//PrepareAndEmitSound(clientlist, clientcount, location);
}
result = true;
}
else
result = false;
}
else
result = false;
} while (KvGotoNextKey(listfile));
//return false;
return result;
}
Код не мой, я взял его из последней версии Say Sounds Redux.