13.10.2018, 12:15
PHP код:
alias:tchat("t");
CMD:tchat(playerid,params[])
{
new Testerstring[257];
if(pInfo[playerid][Tester] >= 1 || pInfo[playerid][pAdminLevel] >= 1)
{
if(!strlen(params))
{
SendClientMessage(playerid, -1, ""COL_RED"TesterCmd: /tchat [Text]");
return 1;
}
format(Testerstring, sizeof(Testerstring), ""COL_GREEN"[Tester Chat] %s %s[%d]: %s",GetTesterName(playerid),PlayerName(playerid), playerid, params);
SendMessageToAllTesters(Testerstring, -1);
}
if(pInfo[playerid][pAdminLevel] >= 1)
{
if(!strlen(params))
{
SendClientMessage(playerid, -1, ""COL_RED"TesterCmd: /tchat [Mesaj]");
return 1;
}
format(Testerstring, sizeof(Testerstring), ""COL_GREEN"[Tester Chat] %s %s[%d]: %s",GetAdminName(playerid),PlayerName(playerid), playerid, params);
SendMessageToAllTesters(Testerstring, -1);
}
else {
SendClientMessage(playerid,-1,""COL_RED"EROARE: You are not admin or tester!");
}
return 1;
}
1) If I am admin, it won't work /tchat.
2) If I am tester, when i write /tchat it shows "you are not admin or tester" even if I am, but I can see and write on /tchat.
3) If I am both admin or tester it works fine.
what I want:
if player is admin, to show getAdminName
if player is tester, to show Gettestername.
Player can't be both.