ocmd:nc(playerid,params[])
{
if(!IsPlayerAnAdmin(playerid,3))
{
if(newbiechatsys==0)
{
ErrorMsg(playerid,"Der Newbiechat wurde vom Adminteam abgeschaltet.");
ErrorMsg(playerid,"Stelle deine Frage bitte per (/report)");
ErrorMsg(playerid,"Um dich wird sich so schnell wie möglich gekümmert.");
return 1;
}
}
if(GetPVarInt(playerid,"lastnc")+2>gettime())return ErrorMsg(playerid,"Nur alle 2 Sekunden möglich.");
if(countAllAdmins()>0)
{
if(GetPVarInt(playerid,"muted")==0)
{
if(sscanf(params,"s[128]",string))return ErrorMsg(playerid,"INFO: /nc [text]");
new strpos = strfind(string,"www",true);
if(strfind(string,".",true) != -1 && strfind(string,":",true) != -1 && strlen(string) > 8 && strfind(string,TSIP,false) == -1)
{
strdel(string,strpos,strfind(string,".",true) && strfind(string,":",true));
SendClientMessage(playerid,COLOR_BRIGHTRED,"Senden fehlgeschlagen...");
return 1;
}
newbichat[playerid]=1;
if(SpielerInfo[playerid][Level]==1||SpielerInfo[playerid][Level]==2)
{
format(string,sizeof(string),"**(( Newbie %s: %s ))",SpielerName(playerid),string);
}
if(SpielerInfo[playerid][Level]>=3&&SpielerInfo[playerid][Admin]==0&&uadmin[playerid]==0)
{
format(string,sizeof(string),"**(( User %s: %s ))",SpielerName(playerid),string);
}
if(uadmin[playerid]==1)
{
format(string,sizeof(string),"**(( User %s: %s ))",SpielerName(playerid),string);
}
if(IsPlayerAnAdmin(playerid,1)&&uadmin[playerid]==0)
{
new adminname[100];
adminname="Unknown";
switch(SpielerInfo[playerid][Admin])
{
case 1:{adminname="Probesupporter";}
case 2:{adminname="Supporter";}
case 3:{adminname="Moderator";}
case 4:{adminname="Administrator";}
case 5:{adminname="FullAdmin";}
case 6:{adminname="ServerManager";}
case 7:{adminname="Techniker";}
case 8:{adminname="Projektleitung";}
}
if(GetPVarInt(playerid,"CM")==1)
{
adminname="CommunityManager";
if(SpielerInfo[playerid][Geschlecht]==1)
{
strcat(adminname,"in",sizeof(adminname));
}
}
format(string,sizeof(string),"**(( %s %s: %s ))**",adminname,SpielerName(playerid),string);
}
SetPVarInt(playerid,"lastnc",gettime());
for(new i=0; i<MAX_PLAYERS; i++)
{
if(!IsPlayerConnected(i))continue;
if(IsPlayerEingeloggt(i))
{
if(newbichat[i]==1)
{
new Length = strlen(string), text[256];
if(Length > 80)
{
strmid(string, text, 0, Length / 2);
SendClientMessage(i,0xBC00FFFF,string);
strmid(string, text, Length / 2, Length);
SendClientMessage(i,0xBC00FFFF,string);
}
else
{
SendClientMessage(i,0xBC00FFFF,string);
}
}
}
}
}
else
{
return SendClientMessage(playerid,COLOR_GRAD2,"Du bist gemutet stell deine Frage bitte per /report.");
}
}
else
{
SendClientMessage(playerid,COLOR_GRAD2,"Es ist kein Admin on daher ist der Newbichat ausgeschaltet.");
SendClientMessage(playerid,COLOR_GRAD2,"Somit schliessen wir ServerWerbung aus. Bitte habt Verständnis.");
return 1;
}
return 1;
}
stock StrSplit(text[])
{
new string[128], Length = strlen(text) ;
if(Length > 80)
{
strmid(string, text, 0, Length / 2);
SendClientMessageToAll(COLOR, string);
strmid(string, text, Length / 2, Length);
SendClientMessageToAll(COLOR, string);
}
else
{
SendClientMessageToAll(COLOR, text);
}
}