[Help] me with command.
#1

Can any one help me with that command, when I try in game its says [Server: Unknown command].
Any one Help me.

pawn Код:
if(strcmp(cmd,"/buymats",true)==0)
    {
        if(IsPlayerConnected(playerid))
        {
            if(PlayerInfo[playerid][pJob] != 23)
            {
                SendClientMessage(playerid, COLOR_GREY, "   You are not a Arms Dealer. ");
                return 1;
            }
            if(!PlayerToPoint(2.0, playerid, -1291.601806,2533.543212,87.742187))
            {
                SendClientMessage(playerid, COLOR_GREY, "   You are not at the materials bank !");
                return 1;
            }
            tmp = strtok(cmdtext, idx);
            if(!strlen(tmp))
            {
                SendClientMessage(playerid, COLOR_WHITE, "USAGE: /buymats [ammount]");
                return 1;
            }
            new mammount;
            mammount = strval(tmp);
            if(GetPlayerPCash(playerid) < mammount *2)
            {
                SendClientMessage(playerid, COLOR_GREY, "   You don't have enough money ! ");
                return 1;
            }
            if(mammount < 1 || mammount > 10000) { SendClientMessage(playerid, COLOR_GREY, "   Cannot be below 0, and not more then 10,000!"); return 1; }
            PlayerInfo[playerid][pMats] += mammount;
            GivePlayerPCash(playerid, - mammount *2);
            format(string, sizeof(string), "   You have bought %d materials for %d$ !", mammount, mammount *2);
            SendClientMessage(playerid, COLOR_GREY, string);
            return 1;
        }
        return 1;
    }
Reply
#2

pawn Код:
if (strcmp("/buymats", cmdtext, true, 10) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            if(PlayerInfo[playerid][pJob] != 23)
            {
                SendClientMessage(playerid, COLOR_GREY, "   You are not a Arms Dealer. ");
                return 1;
            }
            if(!PlayerToPoint(2.0, playerid, -1291.601806,2533.543212,87.742187))
            {
                SendClientMessage(playerid, COLOR_GREY, "   You are not at the materials bank !");
                return 1;
            }
            tmp = strtok(cmdtext, idx);
            if(!strlen(tmp))
            {
                SendClientMessage(playerid, COLOR_WHITE, "USAGE: /buymats [ammount]");
                return 1;
            }
            new mammount;
            mammount = strval(tmp);
            if(GetPlayerPCash(playerid) < mammount *2)
            {
                SendClientMessage(playerid, COLOR_GREY, "   You don't have enough money ! ");
                return 1;
            }
            if(mammount < 1 || mammount > 10000) { SendClientMessage(playerid, COLOR_GREY, "   Cannot be below 0, and not more then 10,000!"); return 1; }
            PlayerInfo[playerid][pMats] += mammount;
            GivePlayerPCash(playerid, - mammount *2);
            format(string, sizeof(string), "   You have bought %d materials for %d$ !", mammount, mammount *2);
            SendClientMessage(playerid, COLOR_GREY, string);
            return 1;
        }
        return 1;
    }
Reply
#3

Thank you bro. 1+ rep
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)