Jump to content
  • 0

Ajutor trecere comanda strcmd


Leonardo23

Question

Comanda asta vreau sa o trec pe strcmd, aveti 2 exeple, eu am trecuto rau, primul e cum arata comanda, al doilea e cum as vrea sa arate, dar nu-mi iese, nu folosesc zcmd, imi da eroare la params.

 

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;
}

 
 

 

 

Aici

 

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

Link to comment
Share on other sites

3 answers to this question

Recommended Posts

  • 0

Stai ce face, vrei sa o muti pe ZCMD?

Atunci e simplu (Te saluta MrAndyAdv)

 

CMD:etuning(playerid,params[])

{

         SendClientMessage(playerid, COLOR_WHITE, "[Usage]: /etuning [option]");
        SendClientMessage(playerid, COLOR_WHITE, "OPTIONS: x | y | z | done");

{

 

Si de aici continui, nu e greu.

Link to comment
Share on other sites

  • 0
1 hour ago, Leonardo23 said:

Comanda asta vreau sa o trec pe strcmd, aveti 2 exeple, eu am trecuto rau, primul e cum arata comanda, al doilea e cum as vrea sa arate, dar nu-mi iese, nu folosesc zcmd, imi da eroare la params.

  Hide contents

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;
}

  Reveal hidden contents
 

 

 

Aici

  Reveal hidden contents

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

https://pastebin.com/wJt4HjTQ

Link to comment
Share on other sites

  • 0
1 hour ago, RazvaN. said:

 

2 hours ago, AndreiAdv said:

Stai ce face, vrei sa o muti pe ZCMD?

Atunci e simplu (Te saluta MrAndyAdv)

 

CMD:etuning(playerid,params[])

{

         SendClientMessage(playerid, COLOR_WHITE, "[Usage]: /etuning [option]");
        SendClientMessage(playerid, COLOR_WHITE, "OPTIONS: x | y | z | done");

{

 

Si de aici continui, nu e greu.

E pe zcmd/sscanf/nsh exact, faza e ca nu folosesc zmcd, vreau sa o mut pe strcmd sau ce o fi gen comanda asta  :>

if(strcmp(cmd, "/tuningcmds", true) == 0)
{
     SendClientMessage(playerid,COLOR_YELLOW,"/tuning /etuning /rtuning /vehicle");
     SendClientMessage(playerid,COLOR_YELLOW,"After using /tuning use /etuning X/Y/Z/RX/RY/RZ and then use A and D to move the object.");
    return 1;
}

Edited by Leonardo23
Link to comment
Share on other sites

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.