need help with sscanf
#1

pawn Код:
CMD:createcar(playerid, params[])
{
        new mid;
        new vfile[225];
        new color1;
        new color2;
        new member;
        if(sscanf(params, "iiii", mid,color1,color2,member)) return SendClientMessage(playerid, 0xFFFFFF, "/createcar [ModelID][color1][color2]");
        else if(mid > 600 || mid < 400) return SendClientMessage(playerid, 0xFFFFFF, "uknown modelid");
        else if(color1 > 0 || color1 < 126) return SendClientMessage(playerid, 0xFFFFFF, "uknown col2");
        else if(color2 > 0 || color2 < 126) return SendClientMessage(playerid, 0xFFFFFF, "uknown col2");
        else if(member > 0 || member < 3) return SendClientMessage(playerid, 0xFFFFFF, "uknown member");
It Sends Me message
Код:
uknown col2
please help
//-------------------------------------------------------------------------//
Sorry for my bad english
Reply
#2

/createcar [modelid] [color1] [color2] = 3


sscanf = 4 " i i i i" maybe you are pressing wrong command :S
Reply
#3

It's just that all your if statements are wrong. Nothing to do with sscanf. I hope you learned in school what the greater than and smaller than symbols are? And I also hope that you know what return means?

Logic thinking and common sense will solve your problem.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)