[00:44:51] sscanf warning: Format specifier does not match parameter count. |
new a,b,c;
sscanf(string,"ss",a,b,c);//Here 2 specifiers and 3 parameters.. Hence the warning
sscanf(string,"sss",a,b);//3 specifier and 2 parameter also lead to warning
MD:pm(playerid, params[])
{
new str[256], str2[256], id, Name1[MAX_PLAYER_NAME], Name2[MAX_PLAYER_NAME];
if(sscanf(params, "us[512]", id, str2))
{
SendClientMessage(playerid, 0xFF0000FF, "{FF0000}[USAGE]: {FFFFFF}/PM (PlayerID) (Message)");
return 1;
}
if(!IsPlayerConnected(id)) return SendClientMessage(playerid, 0xFF0000FF, "{FF0000}[SERVER]: {FFFFFF}Player Is Not Connected!");
if(playerid == id) return SendClientMessage(playerid, 0xFF0000FF, "{FF0000}[USAGE]: {FFFFFF}You Cannot PM Yourself!");
{
GetPlayerName(playerid, Name1, sizeof(Name1));
GetPlayerName(id, Name2, sizeof(Name2));
format(str, sizeof(str), ">> PM To %s(ID %d): %s", Name2, id, str2);
SendClientMessage(playerid, 0xFF0000FF, str);
format(str, sizeof(str), ">> PM From %s(ID %d): %s", Name1, playerid, str2);
SendClientMessage(id, 0xFF0000FF, str);
}
return 1;
}
CMD:teleports(playerid, params[])
{
new string[1000];
strcat(string, "\n{00FFFF}======== -( Drifts )- ========\n{FFFF00}- /drifthill\n- /drift1-[53]\n- /prodrift\n- /circle1-[8]\n- /oceandrift\n{00FFFF}======== -( Cities )- ========\n{FFFF00}- /sf\n- /ls\n- /lv");
strcat(string, "\n{00FFFF}======== -( Airports )- ========\n{FFFF00}- /lsa\n- /lva\n- /sfa\n{00FFFF}======== -( Races )- ========\n{FFFF00}- /drag\n");
strcat(string, "{00FFFF}======== -( Parkour )- ========\n{FFFF00}- /nrgparkour\n{00FFFF}======== -( Stunts )- ========\n{FFFF00}- /stuntpark\n- /halfpipe\n{00FFFF}======== -( Tuning )- ========\n{FFFF00}- /arch\n- /fender\n- /loco");
ShowPlayerDialog(playerid, 27, DIALOG_STYLE_MSGBOX, "Server Teleports", string, "Okay", "");
PlayerPlaySound(playerid, 1057, 0.0, 0.0, 0.0);
return 1;
}
MD:pm(playerid, params[])
{
new str[256], str2[256], id, Name1[MAX_PLAYER_NAME], Name2[MAX_PLAYER_NAME];
if(sscanf(params, "us[256]", id, str2))//here
{
SendClientMessage(playerid, 0xFF0000FF, "{FF0000}[USAGE]: {FFFFFF}/PM (PlayerID) (Message)");
return 1;
}
if(!IsPlayerConnected(id)) return SendClientMessage(playerid, 0xFF0000FF, "{FF0000}[SERVER]: {FFFFFF}Player Is Not Connected!");
if(playerid == id) return SendClientMessage(playerid, 0xFF0000FF, "{FF0000}[USAGE]: {FFFFFF}You Cannot PM Yourself!");
{
GetPlayerName(playerid, Name1, sizeof(Name1));
GetPlayerName(id, Name2, sizeof(Name2));
format(str, sizeof(str), ">> PM To %s(ID %d): %s", Name2, id, str2);
SendClientMessage(playerid, 0xFF0000FF, str);
format(str, sizeof(str), ">> PM From %s(ID %d): %s", Name1, playerid, str2);
SendClientMessage(id, 0xFF0000FF, str);
}
return 1;
}
COMMAND:mytime(playerid, params[])
{
new time;
if(sscanf(params, "i[time]", time)) return SendClientMessage(playerid, -1, "{FF0000}[USAGE]: {FFFFFF}/mytime [Time]");
if(time > 24 || time < 0) return SendClientMessage(playerid, -1, "{FF0000}[SERVER]: {FFFFFF}Invalid Time! Choose Another!");
SetPlayerTime(playerid,time,0);
PlayerPlaySound(playerid, 1057, 0.0, 0.0, 0.0);
return 1;
}
COMMAND:mytime(playerid, params[])
{
new time;//Time is not an array.
if(sscanf(params, "i", time)) return SendClientMessage(playerid, -1, "{FF0000}[USAGE]: {FFFFFF}/mytime [Time]");
if(time > 24 || time < 0) return SendClientMessage(playerid, -1, "{FF0000}[SERVER]: {FFFFFF}Invalid Time! Choose Another!");
SetPlayerTime(playerid,time,0);
PlayerPlaySound(playerid, 1057, 0.0, 0.0, 0.0);
return 1;
}