Jump to content
  • 0

Problema trecere comanda


Leonardo23

Question

Am incercat sa trec comanda asta in ce ve-ti vedea mai jos.

 

CMD:etuning(playerid, params[])
{
    if(sscanf(params, "s[16]", params))
    {
        SendClientMessage(playerid, COLOR_WHITE, "[Usage]: /etuning [option]");
        SendClientMessage(playerid, COLOR_WHITE, "OPTIONS: x | y | z | done");
    }
    else if(!strcmp(params, "x", true))
    {
        PlayerData[playerid][EditStatus] = 1;
    }
    else if(!strcmp(params, "y", true))
    {
        PlayerData[playerid][EditStatus] = 2;
    }
    else if(!strcmp(params, "z", true))
    {
        PlayerData[playerid][EditStatus] = 3;
    }
    /*else if(!strcmp(params, "rx", true))
    {
        PlayerData[playerid][EditStatus] = 4;
    }
    else if(!strcmp(params, "ry", true))
    {
        PlayerData[playerid][EditStatus] = 5;
    }
    else if(!strcmp(params, "rz", true))
    {
        PlayerData[playerid][EditStatus] = 6;
    }*/
    else if(!strcmp(params, "done", true))
    {
        PlayerData[playerid][EditStatus] = 0;
        KillTimer(PlayerData[playerid][EditingTimer]);
        SaveTuning(playerid);
    }
    return 1;
}

 

 

Noua comanda, nu cred ca am trecut-o bine, am incercat singur, tutoriale nu am gasit, deci, help my please?:

 

if(strcmp(cmd, "/etuning", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            if(PlayerInfo[playerid][pAdmin] < 4)
            {
                SendClientMessage(playerid, COLOR_GRAD2, "   You are not an Admin !");
                return 1;
            }
    new tunninge[256];
    if(strtok(cmdtext, idx))
    {
            tunninge = strtok(cmdtext, idx);
            if(strlen(tunninge)) {
                SendClientMessage(playerid, COLOR_WHITE, "|__________________ Edit __________________|");
                SendClientMessage(playerid, COLOR_WHITE, "[Usage]: /etuning [option]");
            SendClientMessage(playerid, COLOR_WHITE, "OPTIONS: x | y | z | done");
                SendClientMessage(playerid, COLOR_WHITE, "|____________________________________________|");
                return 1;
            }
            tmp = strtok(cmdtext, idx);
            if(!strlen(tmp))
            {
                SendClientMessage(playerid, COLOR_GRAD2, "[Usage]: /etuning [option]");
                return 1;
            }

    else if(strcmp(new tunninge,"x",true) == 0)
    {
        PlayerData[playerid][EditStatus] = 1;
    }
    else if(strcmp(new tunninge,"y",true) == 0)
    {
        PlayerData[playerid][EditStatus] = 2;
    }
    else if(strcmp(new tunninge,"z",true) == 0)
    {
        PlayerData[playerid][EditStatus] = 3;
    }
    /*else if(strcmp(new tunninge,"ex",true) == 0)
    {
        PlayerData[playerid][EditStatus] = 4;
    }
    else if(strcmp(new tunninge,"ry",true) == 0)
    {
        PlayerData[playerid][EditStatus] = 5;
    }
    else if(strcmp(new tunninge,"rz",true) == 0)
    {
        PlayerData[playerid][EditStatus] = 6;
    }*/
    else if(strcmp(new tunninge,"done",true) == 0)
    {
        PlayerData[playerid][EditStatus] = 0;
        KillTimer(PlayerData[playerid][EditingTimer]);
        SaveTuning(playerid);
        format(string, sizeof(string), "You've adjusted the: %s.", tunninge);
        SendClientMessage(playerid, COLOR_WHITE, string);
            }
        }
    }
    return 1;
}

Edited by Leonardo23
Link to comment
Share on other sites

1 answer to this question

Recommended Posts

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.