16.02.2014, 19:26
When i go in server commands are not working.
I got only this - http://www.bildites.lv/images/akwt6vqcr47xc8sz2v4t.png
I got only this - http://www.bildites.lv/images/akwt6vqcr47xc8sz2v4t.png
public OnPlayerCommandText(playerid, cmdtext[])
{
return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
return 0;
}
#include <ZCMD>
public OnPlayerCommandPerformed(playerid, cmdtext[], success)
{
if(!success) SendClientMessageEx(playerid, COLOR_WHITE, "Unknown command. Please use /help to list all available commands.");
return 1;
}
public OnPlayerCommandReceived(playerid, cmdtext[])
{
playerLastTyped[playerid] = 0;
printf("[zcmd] [%s]: %s", GetPlayerNameEx(playerid), cmdtext);
if(gPlayerLogged{playerid} != 1)
{
SendClientMessageEx(playerid, COLOR_RED, "You are not logged in.");
return 0;
}
if(GetPVarInt(playerid, "LoadingObjects") == 1)
{
SendClientMessageEx(playerid, COLOR_GRAD2, "You can't do this right now.");
return 0;
}
if(PlayerInfo[playerid][pMuted] == 1)
{
SendClientMessageEx(playerid, COLOR_GREY, "You cannot speak, you have been silenced!");
return 0;
}
if(CommandSpamUnmute[playerid] != 0)
{
if(PlayerInfo[playerid][pAdmin] < 2)
{
SendClientMessage(playerid, COLOR_WHITE, "You are muted from submitting commands right now.");
return 0;
}
}
if(PlayerInfo[playerid][pAdmin] < 2)
{
CommandSpamTimes[playerid]++;
if(CommandSpamTimes[playerid] == 5)
{
CommandSpamTimes[playerid] = 0;
CommandSpamUnmute[playerid] = 10;
SendClientMessageEx(playerid, COLOR_YELLOW, "You have been muted automatically for spamming. Please wait 10 seconds and try again.");
SetTimerEx("OtherTimerEx", 1000, false, "ii", playerid, TYPE_FLOODPROTECTION);\
return 0;
}
}
/*Compares last string with current, if the same, alert the staff only on the 3rd command. (Expires after 5 secs)
if(PlayerInfo[playerid][pAdmin] < 2) {
new laststring[128];
if(GetPVarString(playerid, "LastCommand", laststring, 128)) {
if(!strcmp(laststring, cmdtext, true)) {
CommandSpamTimes[playerid]++;
if(CommandSpamTimes[playerid] == 2) {
CommandSpamTimer[playerid] = 30;
CommandSpamTimes[playerid] = 0;
new string[128];
format(string, sizeof(string), "{AA3333}AdmWarning{FFFF00}: %s (ID %d) is spamming with: %s", GetPlayerNameEx(playerid), playerid, cmdtext);
ABroadCast(COLOR_YELLOW, string, 2);
}
}
}
SetPVarString(playerid, "LastCommand", cmdtext);
}*/
if(strfind(cmdtext, "|", true) != -1)
{
SendClientMessageEx(playerid, COLOR_RED, "You cannot use the '|' character in commands.");
return 0;
}
if(PlayerInfo[playerid][pAdmin] < 2)
{
if(strfind(cmdtext, ":", true) != -1)
{
new
i_numcount,
i_period,
i_pos;
while(cmdtext[i_pos]) {
if('0' <= cmdtext[i_pos] <= '9') i_numcount++;
else if(cmdtext[i_pos] == '.') i_period++;
i_pos++;
}
if(i_numcount >= 8 && i_period >= 3) {
new string[128];
format(string,sizeof(string),"Warning: %s may be server advertising: '%s'.", GetPlayerNameEx(playerid),cmdtext);
SendAdminMessage(COLOR_RED, string);
return 0;
}
}
}
/*new string[128];
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(Spectate[i] == playerid)
{
format(STRING, "%s performed command: %s", GetPlayerNameEx(playerid), cmdtext);
SendClientMessageEx(GettingSpectated[playerid], COLOR_LIGHTBLUE, string);
}
}
if(GettingSpectated[playerid] != 999)
{
new string[128];
format(STRING, "%s performed command: %s", GetPlayerNameEx(playerid), cmdtext);
SendClientMessageEx(GettingSpectated[playerid], COLOR_LIGHTBLUE, string);
}*/
return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
return 0;
}