sscanf warning: Format specifier does not match parameter count.
CMD:a(playerid,params[]){ new string[128]; if(PlayerInfo[playerid][pAdminLevel] <= 1) return SendClientMessage(playerid,COLOR_GREY,"You're not authorized to use this command!"); if(sscanf(params, "us")) return SendClientMessage(playerid,COLOR_GREY,"SYNTAX: /a(dmin) [message]"); else { format(string,sizeof(string),"%s: %d",GetName(playerid), params); SendToAdmins(COLOR_RED, string); } return 1; }
stock SendToAdmins(COLOR,message[])//here we set params for this stock, [] means string/message { for( new i = 0; i < MAX_PLAYERS; i++ ) if( PlayerInfo[i][pAdminLevel] <= 1 ) { SendClientMessage( i,COLOR,message ); } return 0; //for everyone else return 0; }
CMD:a(playerid, params[])
{
if(PlayerInfo[playerid][pAdminLevel]< 1) return SCM(playerid, Red, "You're not authorized to use this command");
new
text[128];
if(sscanf(params, "s[128]",text)) return SCM(playerid, -1, "USAGE: /a [Text]");
format(text,sizeof(text),"Admin %s| Message: %s",GN(playerid),params[0]);
foreach(Player, i) {
if(pInfo[i][Adminlevel] > 0){
SCM(i,Purple,text);}}
return 1;
}
pawn Код:
|
CMD:a(playerid,params[]){
new string[128];
if(PlayerInfo[playerid][pAdminLevel] <= 1) return SendClientMessage(playerid,COLOR_GREY,"You're not authorized to use this command!");
if(sscanf(params, "us",string)) return SendClientMessage(playerid,COLOR_GREY,"SYNTAX: /a(dmin) [message]");
else
{
format(string,sizeof(string),"%s: %d",GetName(playerid), params);
SendToAdmins(COLOR_RED, string);
}
return 1;
}
He did copy from his own script that command that's why you had that error.
pawn Код:
|
CMD:a(playerid, params[])
{
if(pInfo[playerid][Adminlevel]< 1) return SCM(playerid, Red, "You are not admin");
new
text[128];
if(sscanf(params, "s[128]",text)) return SCM(playerid, -1, "USAGE: /a [Message]");
format(text,sizeof(text),"%s Message: %s",GN(playerid),params[0]);
foreach(Player, i) {
if(pInfo[i][Adminlevel] > 0){
SCM(i,Pink,text);}}
return 1;
}
CMD:a(playerid,params[])
{
new string[128], chat[128];
if(PlayerInfo[playerid][pAdminLevel] <= 1) return SendClientMessage(playerid,COLOR_GREY,"You're not authorized to use this command!");
if(sscanf(params, "s[128]", chat)) return SendClientMessage(playerid,COLOR_GREY,"SYNTAX: /a(dmin) [message]");
format(string,sizeof(string),"%s: %d",GetName(playerid), chat);
SendToAdmins(COLOR_RED, string);
return 1;
}
stock SendToAdmins(COLOR,message[])//here we set params for this stock, [] means string/message
{
for( new i = 0; i < MAX_PLAYERS; i++ )
{
if( PlayerInfo[i][pAdminLevel] >= 1 )
{
SendClientMessage( i,COLOR,message );
}
}
return 1; //for everyone else return 0;
}