strcmp issue
#1

http://pastebin.com/EQjUAfL88
why strcmp doesn't work?
it says that the code does not exist
Reply
#2

At first, this isn't strcmp.

Have you put this at the top of your script?
pawn Код:
#include <zcmd>
Reply
#3

Quote:
Originally Posted by Weaselpwns
Посмотреть сообщение
At first, this isn't strcmp.

Have you put this at the top of your script?
pawn Код:
#include <zcmd>
the commands works fine, but when i try to use the code that a created its says that it isnt exist
Reply
#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
#5

Replace your public OnPlayerCommandText with this:

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    return 1;
}
Reply
#6

You can also remove OnPlayerCommandText when you're using zcmd.
Never return 0 because zcmd will not work.
Reply
#7

Quote:
Originally Posted by Stinged
Посмотреть сообщение
You can also remove OnPlayerCommandText when you're using zcmd.
Never return 0 because zcmd will not work.
there is no OnPlayerCommandText public
Reply
#8

Quote:
Originally Posted by ReaZoN
Посмотреть сообщение
there is no OnPlayerCommandText public
Try the code I posted, it should work.
Reply
#9

Quote:
Originally Posted by Stinged
Посмотреть сообщение
Try the code I posted, it should work.
it didn't work
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)