14.09.2012, 19:05
Hello, the function of admin:
GetPVarInt > Level
in CMD:command( playerid, params[ ] )
thanks you.
GetPVarInt > Level
in CMD:command( playerid, params[ ] )
thanks you.
CMD:a(playerid, params[])
{
if(GetPVarInt < Level) return ErrorMessage(playerid);
{
new message[91];
if(sscanf(params, "s[90]", message)) return SendClientMessage( playerid, white, "USAGE: /a [message]");
if(strlen(params)>90) return SendClientMessage(playerid, red, "Invalid length. The length must be between 1 and 90 characters.");
new string[128]=0;
foreach (Player, i)
{
if(PlayerInfo[i][pAdmin] != 0) { format(string,sizeof(string),"[Admin Chat] {FFFFFF}%s{FF0000}:{FFFFFF} %s", GetPName(playerid), message); SendClientMessage(i, red, string); }
}
}
return 1;
}
CMD:command( playerid, params[ ] )
{
if( GetPVarInt( playerid, "Level" ) < 1 )
return SendClientMessage(playerid, 0xFFFFFFFF, "Only admins!");
if(isnull( params ))
return SendClientMessage(playerid, 0xFFFFFFFF, "Usage: /command [text]");
new
i = -1,
message[148 + MAX_PLAYER_NAME + 14 + 1]
;
GetPlayerName(playerid, message, MAX_PLAYER_NAME);
format(message, sizeof(message), "[AdminChat] %s: %s", message, params);
for( ;++i < MAX_PLAYERS; )
{
if( IsPlayerConnected( i ) && ( GetPVarInt( i , "Level" ) > 1) )
{
SendClientMessage( i, 0xFFFFFFFF, params );
}
}
return true;
}
stock SendMessageToAdmins(color, const string[])
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(GetPVarInt > Level)
{
SendClientMessage(i, color, string);
}
}
}
return 1;
}
CMD:a(playerid,params[])
{
#pragma unused params
//new pname[MAX_PLAYER_NAME]; //Your playername stock..
new string[128];
if(GetPVarInt > Level)
{
if(!strlen(params)) return SendClientMessage(playerid,COLOR_ERROR,"Usage: /ac (Message)");
//GetPlayerName(playerid, pname, sizeof(pname)); //Your player name stock..
format(string,sizeof(string), "[ADMIN MESSAGE] %s(%d): %s",pname, playerid, params);
SendMessageToAdmins(COLOR_RED, string);
return 1;
}
}
First add stock for admin chat..
pawn Код:
|
pawn Код:
|
Dunno sorry :/
I'm not familiar with anything but Y_INI.. Don't know MySQL or anything else.. show me your player saving codes. |
it stock, (1487) : error 076: syntax error in the expression, or invalid function call
stock SendMessageToAdmins(color, const string[])
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(GetPVarInt > Level)
{
SendClientMessage(i, color, string);
}
}
}
return 1;
}
it line 1487: if(GetPVarInt > Level)
How do i fix it?