20.02.2014, 16:58
Hi, my server stops when i add this script in gamemode.
When i comment the timer in GameModeInit, the server works fine. When i un-comment it, then it stops working (The console doesn't close).
Any thing wrong in this script?
EDIT: The server is 0.3z.
pawn Код:
#define PUBLIC:%1(%2) forward %1(%2); public %1(%2)
new BadWeapons[][] = { //{Weaponid, Solt id}
{2, 1},{3, 1},{4, 1},{5, 1},{6, 1},{7, 1},{8, 1},{9, 1},
{10, 10},{11, 10},{12, 10},{13, 10},{14, 10},{15, 10},
{17, 8},{18, 8},{23, 2},{27, 3},{33, 6},{35, 7},{36, 7},
{38, 7},{39, 8},{41, 9},{42, 9},{43, 9},{44, 11},{45, 11}
};
public GameModeInit()
{
SetTimer("_CheckBadWeapons", 1000, true);
return 1;
}
PUBLIC:_CheckBadWeapons()
{
for(new i=0; i < GetMaxPlayers(); i++) if(IsPlayerConnected(i) && PlayerInfo[i][Dead] == 0) {
for(new w=0,w2 = sizeof(BadWeapons); w < w2; i++) {
new weaponid, ammo; GetPlayerWeaponData(i, BadWeapons[w][1], weaponid, ammo);
if(weaponid == BadWeapons[w][0]) {
new string[128], weapname[24]; GetWeaponName(BadWeapons[w][0],weapname, sizeof(weapname));
format(string,128,"[ANTI-HACK] {FFFFFF}%s has been banned from server. Reason: Weapon Hack (%s).",PlayerName(i), weapname);
SendClientMessageToAll(COLOR_RED, string);
SendClientMessage(i, COLOR_RED, "You've been banned from server for weapon hack.{FFFFFF} If you think this is a mistake, please report it to our forum.");
format(string,128,"Weapon Hack (%s)",weapname);
BanEx(i, string);
}
}
}
return 1;
}
Any thing wrong in this script?
EDIT: The server is 0.3z.