strcmp issue
#4

Why are you splitting params with sscanf and then storing it into params[0]?

Why don't you people read zcmd's page before trying it...
"Here params[] is the parameters string, playerid is an ID of the player who send this command."

Try this and understand how I used params without sscanf
If you aren't going to use two strings, or ints/floats/hex, just use params.
pawn Код:
CMD:code(playerid, params[])
{
    if (isnull(params)) return SendClientMessage(playerid, -1,"[Syntax]: /code {b01111}<code>");
    for(new i; i<MAX_CODES; i++)
    {
        if(codeInfo[i][CodeOwned] == 0 && !strcmp(params, codeInfo[i][CodeName], false))
        {
            new money = random(50000);
            switch(codeInfo[i][CodeType])
            {
                case 1:
                {
                    format(CodeTypes, sizeof(CodeTypes), "Money");
                    GivePlayerMoney(playerid, money);
                    SendFormatMessage(-1, -1, ".%d$ едеа жлд б %s жлд бчег %s дщзчп", money, CodeTypes, pInfo[playerid][pName]), fremove(codeFile(i));
                }
                case 2:
                {
                    format(CodeTypes, sizeof(CodeTypes), "Car Jump");
                    SendFormatMessage(-1, -1, ".йойн %d м %s жлд бчег %s дщзчп", codeInfo[i][Days], CodeTypes, pInfo[playerid][pName]);
                    codeInfo[i][CodeOwned] = 1;
                    format(codeInfo[i][CodeOwner], 25, "%s", pInfo[playerid][pName]);
                }
                case 3:
                {
                    format(CodeTypes, sizeof(CodeTypes), "Super Man");
                    SendFormatMessage(-1, -1, ".йойн %d м %s жлд бчег %s дщзчп", codeInfo[i][Days], CodeTypes, pInfo[playerid][pName]);
                    codeInfo[i][CodeOwned] = 1;
                    format(codeInfo[i][CodeOwner], 25, "%s", pInfo[playerid][pName]);
                }
                case 4:
                {
                    format(CodeTypes, sizeof(CodeTypes), "Car Godmod");
                    SendFormatMessage(-1, -1, ".йойн %d м %s жлд бчег %s дщзчп", codeInfo[i][Days], CodeTypes, pInfo[playerid][pName]);
                    codeInfo[i][CodeOwned] = 1;
                    format(codeInfo[i][CodeOwner], 25, "%s", pInfo[playerid][pName]);
                }
                case 5:
                {
                    format(CodeTypes, sizeof(CodeTypes), "Missiles");
                    SendFormatMessage(-1, -1, ".йойн %d м %s жлд бчег %s дщзчп", codeInfo[i][Days], CodeTypes, pInfo[playerid][pName]);
                    codeInfo[i][CodeOwned] = 1;
                    format(codeInfo[i][CodeOwner], 25, "%s", pInfo[playerid][pName]);
                }
            }
        }
        else return SendClientMessage(playerid, 0xFF0000FF, ".чег щвей ае ощеощ");
    }
    return 1;
}
Reply


Messages In This Thread
strcmp issue - by ReaZoN - 04.08.2014, 09:41
Re: strcmp issue - by Weaselpwns - 04.08.2014, 10:04
Re: strcmp issue - by ReaZoN - 04.08.2014, 10:16
Re: strcmp issue - by Stinged - 04.08.2014, 10:36
Re: strcmp issue - by Weaselpwns - 04.08.2014, 10:37
Re: strcmp issue - by Stinged - 04.08.2014, 10:41
Re: strcmp issue - by ReaZoN - 04.08.2014, 10:49
Re: strcmp issue - by Stinged - 04.08.2014, 11:13
Re: strcmp issue - by ReaZoN - 04.08.2014, 12:38

Forum Jump:


Users browsing this thread: 1 Guest(s)