sscanf warning format specifier does not match parameter count
#1

pawn Код:
COMMAND:vcolor(playerid, params[])
{
new color1,color2;
if(sscanf(params, "ii", color1, color2)) return SendClientMessage(playerid, COLOR_RED, "Usage: /vcolor [0-255] [0-255]");
if(GetPlayerState(playerid) == PLAYER_STATE_ONFOOT) return SendClientMessage(playerid, COLOR_WHITE, "You are not in a vehicle.");
ChangeVehicleColor(GetPlayerVehicleID(playerid),color1,color2);
GameTextForPlayer(playerid,"~y~Vehicle Color Changed",2000,3);
return 1;
}
i get this error when i type the command:
Код:
sscanf warning: Format specifier does not match parameter count
Reply
#2

try this

pawn Код:
COMMAND:vcolor(playerid, params[])
{
new color1 = strval(params),color2 = strval(params);
if(sscanf(params, "ii", color1, color2)) return SendClientMessage(playerid, COLOR_RED, "Usage: /vcolor [0-255] [0-255]");
if(color1 < 0 || color1 > 255)return SendClientMessage(playerid,COLOR_RED,"[ERROR]:- Colors available from 0 - 255!");
if(color2 < 0 || color2 > 255)return SendClientMessage(playerid,COLOR_RED,"[ERROR]:- Colors available from 0 - 255!");
if(GetPlayerState(playerid) == PLAYER_STATE_ONFOOT) return SendClientMessage(playerid, COLOR_WHITE, "You are not in a vehicle.");
ChangeVehicleColor(GetPlayerVehicleID(playerid),color1,color2);
GameTextForPlayer(playerid,"~y~Vehicle Color Changed",2000,3);
return 1;
}
Reply
#3

Quote:
Originally Posted by -=Dar[K]Lord=-
Посмотреть сообщение
try this
Go away. Quite frankly I'm getting sick of these 'Try this' posts that won't work anyway!

OT: Are you sure the warning originates from this command? As far as I can see it is correct.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)