07.06.2011, 23:44
Код:
C:\Documents and Settings\d\Desktop\lvrp\Windows\gamemodes\BVRP.pwn(10125) : warning 209: function "OnPlayerCommandReceived" should return a value C:\Documents and Settings\d\Desktop\lvrp\Windows\gamemodes\BVRP.pwn(10126) : error 010: invalid function or declaration Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 1 Error.
pawn Код:
public OnPlayerCommandReceived(playerid, cmdtext[])
{
if(IsPlayerConnectedEx(playerid))
{
if(Player[playerid][Muted] >= 1)
{
SendClientMessage(playerid, WHITE, "You can't use any commands whilst you are muted.");
return 0;
}
else
{
if(Player[playerid][AdminLevel] >= 1 && strlen(Player[playerid][NormalName]) == 0)
{
SendClientMessage(playerid, WHITE, "You must have your admin name set first.");
return 0;
}
else
{
Player[playerid][SpamCount]++;
if(Player[playerid][SpamCount] >= 3 && Player[playerid][AdminLevel] >= 1 && Player[playerid][AdminLevel] < 5)
{
if(strfind(cmdtext, "ban", true) != -1 || strfind(cmdtext, "kick", true) != -1 || strfind(cmdtext, "warn", true) != -1 || strfind(cmdtext, "set", true) != -1)
{
new string[128], Name[MAX_PLAYER_NAME];
new hour, minute, second, day, year, month;
GetPlayerName(playerid, Name, sizeof(Name));
gettime(hour, minute, second);
getdate(year, month, day);
#pragma unused second
new IP[21];
GetPlayerIp(playerid, IP, sizeof(IP));
format(string, sizeof(string), "%d/%d/%d | %d:%d | %s | %s | SPAMMING | System", day, month, year, hour, minute, IP, Name);
BanLog(string);
format(string, sizeof(string), "Ban: %s has been auto-banned, defined reason: Spamming (ban/kick/warn/set).", Name);
SendClientMessageToAll(LIGHTRED, string);
Player[playerid][Banned] = 4;
Player[playerid][AdminDuty] = 0;
print(string);
Ban(playerid);
return 0;
}
else
{
Kick(playerid);
}
}
if(substr_count(".", cmdtext, true) >= 3 && substr_count(":", cmdtext, true) >= 1)
{
new string[128], tmp;
tmp = strfind(cmdtext, ":");
if(tmp != -1)
{
format(string, sizeof(string), "WARNING: %s may be server-advertising (%s).", GetName(playerid), cmdtext);
SendToAdmins(ADMINORANGE, string, 1);
return 0;
}
}
if(CurGMX == 2)
{
SendClientMessage(playerid, WHITE, "Please wait until the server has completely restarted.");
return 0;
}
else
{
if(Player[playerid][Tutorial] >= 1 && Player[playerid][AdminLevel] < 1)
{
SendClientMessage(playerid, WHITE, "You may not use commands whilst in the tutorial.");
return 0;
}
else
{
printf("[command] %s (%d) executes: %s", GetName(playerid), playerid, cmdtext);
return 1;
}
}
}
}
}
}
return 1;
}