Hello, I Have Got command /adminchat From
@umar4911I Do /adminchat iTs Work But i Dont Know What is Problem.
I Have Setlevel of Umar To 4 And i Do /adminchat <HAHAHA> But
@umar4911 Say me i Dont Receirve Anything.
Here iTs Command:-else if ( ( cmd == "adminchat" )
{
if(pstats[ player.ID ].Level < 3 ) MessagePlayer("[#FFDD33]Information:[#FFFFFF] Unauthorized Access", player);
else if(!text) MessagePlayer("[#FF0000]Command Error:[#FFFFFF] Use /" + cmd + " [Message]", player);
else {
local plr;
for( local i = 0; i <= GetMaxPlayers(); i++ )
{
plr = FindPlayer( i );
if ( ( plr ) && ( pstats[ plr.ID ].Level >= 3 ) )
{
MessagePlayer("[#00ff00][Admin Chat] : [#00ffff]" + playerName + " : [#FFFFFF]" + text + ".", plr);
}
}
ITs Wok But i Dont Know What Is Problem :( Help Me...
Quote from: Mohamed on Dec 12, 2017, 12:09 PMHello, I Have Got command /adminchat From @umar4911
I Do /adminchat iTs Work But i Dont Know What is Problem.
I Have Setlevel of Umar To 4 And i Do /adminchat <HAHAHA> But @umar4911 Say me i Dont Receirve Anything.
Here iTs Command:-
else if ( ( cmd == "adminchat" )
{
if(pstats[ player.ID ].Level < 3 ) MessagePlayer("[#FFDD33]Information:[#FFFFFF] Unauthorized Access", player);
else if(!text) MessagePlayer("[#FF0000]Command Error:[#FFFFFF] Use /" + cmd + " [Message]", player);
else {
local plr;
for( local i = 0; i <= GetMaxPlayers(); i++ )
{
plr = FindPlayer( i );
if ( ( plr ) && ( pstats[ plr.ID ].Level >= 3 ) )
{
MessagePlayer("[#00ff00][Admin Chat] : [#00ffff]" + playerName + " : [#FFFFFF]" + text + ".", plr);
}
}
ITs Wok But i Dont Know What Is Problem :( Help Me...
Change this
else if ( ( cmd == "adminchat" )
to
else if ( cmd == "adminchat" )
You needed to remove plr.ID I think and replace it with i, Also did not see that
@umar4911, I changed that error, kudos to that
else if ( cmd == "adminchat" ) {
if(pstats[ player.ID ].Level < 3 ) {
MessagePlayer("[#FFDD33]Information:[#FFFFFF] Unauthorized Access", player);
return true;
}
if(!text) {
MessagePlayer("[#FF0000]Command Error:[#FFFFFF] Use /" + cmd + " [Message]", player);
return true;
}
else {
for (local i=0;i<GetMaxPlayers();i++) {
if ( pstats[ i ].Level > 3) {
local plr = FindPlayer(i);
if (plr) {
MessagePlayer("[#00ff00][Admin Chat] : [#00ffff] ("+playerName+"): : [#FFFFFF]"+text, plr);
}
}
}
}
}
Also you have playerName instead of player.Name?
@TurboGrafx,
@umar4911.
Just i Change PlayerName To Player.Name.
Problem Solved Thanks For Help
Locked.