Problem command
#1

Hello
Anyone can help me?
This command doesn't work. Why?
pawn Код:
CMD:gethelper(playerid, params[])
    {
        new tmp[256];
        new string[256];
        new idx;
        tmp = strtok(params, idx);
        if(sscanf(params, "ud",params[0],params[1])) return SendClientMessage(playerid, COLOR_WHITE, "Type: /gothelper [SLOT] [NAME]");
        if (Info[playerid][pAdmin] >= 4)
        {
            new stat;
            stat = params[0];
            switch (stat)
            {
                case 1:
                {
                    new file = ini_openFile("/leaders.ini");
                    INI_WriteString(file,"LSPD",params[1]);
                    format(string, sizeof(string), "LSPD  -  %s", string);
                    SendClientMessage(playerid, COLOR_WHITE, string);
                    ini_closeFile(file);//
                }
                default:
                {
                    SendClientMessage(playerid, COLOR_WHITE, "Invalid ID");
                }
            }
        }
        return 1;
    }
Reply
#2

I wish you access command (/ gethelper [SLOT] [HELPER]) to edit HELPER1 name which I will add it.
Reply
#3

Use sscanf: https://sampforum.blast.hk/showthread.php?tid=120356

remove
pawn Код:
if(!strlen(tmp) && PlayerInfo[playerid][pAdmin] >= 1) return SendClientMessage(playerid, COLOR_WHITE, "Type: /gothelper [SLOT] [NAME]");
use

pawn Код:
if(sscanf(params, "is[32]", slot, helper)) return SendClientMessage(playerid, COLOR_WHITE, "Type: /gothelper [SLOT] [NAME]");
Reply
#4

Quote:
Originally Posted by SnG.Scot_MisCuDI
Посмотреть сообщение
Use sscanf: https://sampforum.blast.hk/showthread.php?tid=120356

remove
pawn Код:
if(!strlen(tmp) && PlayerInfo[playerid][pAdmin] >= 1) return SendClientMessage(playerid, COLOR_WHITE, "Type: /gothelper [SLOT] [NAME]");
use

pawn Код:
if(sscanf(params, "is[32]", slot, helper)) return SendClientMessage(playerid, COLOR_WHITE, "Type: /gothelper [SLOT] [NAME]");
ok,but you could do me this command? are started scripting and still do not understand some things.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)