29.06.2011, 08:17
Got a small problem and I actually realize the problem, the problem is
the main problem is the IsPlayerAdmin which checks if player is a rcon admin which I dont want but I want it to be replaced with my one but not sure how it is done
this checks if player is an admin in my script tho it works that admins with that one can speak in the admin chat but they dont see messages unless they are rcon admin logged in... Here is the code
this is a admin chat (I call it Public Safety beside admins to make it sound unique ^^) (The main problem is at when it starts isplayerconnected)
pawn Код:
if(IsPlayerConnected(i) && IsPlayerAdmin(i)) {
pawn Код:
if(pData[playerid][Admin] < 1
pawn Код:
COMMAND:psm(playerid,params[]) {
new
poster[40],
mess[128];
sscanf(params,"s",mess);
if(pData[playerid][Admin] < 1 && !IsPlayerAdmin(playerid))
return SendError(playerid, NOT_ADMIN_LEVEL_1 );
if(!isnull(mess)) {
for(new i = 0; i < MAX_PLAYERS; ++i) {
if(IsPlayerConnected(i) && IsPlayerAdmin(i)) {
new
text[512];
GetPlayerName(playerid,poster,sizeof(poster));
format(text,sizeof(text),"[Public Safety Chat] | %s: %s",poster,mess);
SendClientMessage(i,COLOR_MOCCASIN ,text);
}
}
} else {
return SendClientMessage(playerid,COLOR_GRAY,"SYNTAX: /psm [Message]");
}
return 1;
}