*** This topic title is not descriptive.
#1

1.
pawn Код:
if(strcmp(cmd, "/buyc", true) == 0 || strcmp(cmd, "/buyclotes", true) == 0)
    {
How i can do that in dcmd , so /buyc sau /buyclotes work ?

2.
pawn Код:
//=============================================================================================================================================================
// = Comanda: /r(adio)c(hannel)
//=============================================================================================================================================================
    if (strcmp(cmd, "/rc", true) == 0 || strcmp(cmd, "/radiochannel", true) == 0)
    {
        if(IsPlayerInAnyVehicle(playerid) == 1 && GetPlayerVehicleSeat(playerid) == 0)
        {
            tmp = strtok(cmdtext, idx);
            if(strlen(tmp) == 0) return SendClientMessage(playerid, COLOR_WHITE, "» Scrie: /r(adio)c(hannel) on / off");

//=============================================================================================================================================================
// = Comanda: /r(adio)c(hannel) off
//=============================================================================================================================================================
            else if(strcmp(tmp, "off", true) == 0)
            {
                vehid = GetPlayerVehicleID(playerid);
                for(new i; i<MAX_PLAYERS; i++)
                {
                    if(IsPlayerInVehicle(i, vehid))
                    {
                        StopAudioStreamForPlayer(i);
                    }
                }
                return 1;
            }
//=============================================================================================================================================================
// = Comanda: /r(adio)c(hannel) on
//=============================================================================================================================================================
            else if(strcmp(tmp, "on", true) == 0)
            {
                ShowPlayerDialog(playerid, 9998, DIALOG_STYLE_LIST, "GameFront Radio System", "{ffd700}Radio: {ffffff}Dance\n{ffd700}Radio: {ffffff}Manele\n{ffd700}Radio: {ffffff}Populara\n{ffd700}Radio: {ffffff}DubSTEP\n{ffd700}Radio: {ffffff}House\n{ffd700}Radio: {ffffff}Hip-Hop\n{ffd700}Radio: {ffffff}RadioZU\n{ffd700}Radio: {ff0000}OFFLINE", "Ok", "");
                return 1;
            }
            SendClientMessage(playerid, COLOR_WHITE, "» Scrie: /r(adio)c(hannel) on / off");
            return 1;
        }
        else
        {
            SendClientMessage(playerid, COLOR_WHITE, "{30a030}[GameFront]: {ffffff}Ne pare rau, dar trebuie sa te afli intr-un Vehicul pentru a utiliza aceasta comanda.");
            return 1;
        }
    }
And that , how i can do that in DCMD ?

Thank's in advance !
Reply
#2

How to convert strcmp to ZCMD/DCMD
Reply
#3

Quote:
Originally Posted by doreto
Посмотреть сообщение
I know that , but if command is

pawn Код:
if(strcmp(cmd, "/buyc", true) == 0 || strcmp(cmd, "/buyclotes", true) == 0)
    {
How i can do that in dcmd , so /buyc and /buyclotes work together !
Reply
#4

Quote:
Originally Posted by Sp3cter
Посмотреть сообщение
I know that , but if command is

pawn Код:
if(strcmp(cmd, "/buyc", true) == 0 || strcmp(cmd, "/buyclotes", true) == 0)
    {
How i can do that in dcmd , so /buyc and /buyclotes work together !
Why didnt scroll down to see it !
pawn Код:
public OnPlayerCommandText( playerid, cmdtext[ ] )
{
    dcmd( buyc, 4, cmdtext );
    dcmd( buyclotes, 9, cmdtext );
    return 0;
}

dcmd_buyc( playerid, params[ ] )
{
    // code for command /buyc
    return 1;
}

dcmd_buyclotes( playerid, params[ ] )
{
    // code for command /buyclotes
    return 1;
}
Reply
#5

Quote:
Originally Posted by doreto
Посмотреть сообщение
Why didnt scroll down to see it !
pawn Код:
public OnPlayerCommandText( playerid, cmdtext[ ] )
{
    dcmd( buyc, 4, cmdtext );
    dcmd( buyclotes, 9, cmdtext );
    return 0;
}

dcmd_buyc( playerid, params[ ] )
{
    // code for command /buyc
    return 1;
}

dcmd_buyclotes( playerid, params[ ] )
{
    // code for command /buyclotes
    return 1;
}
I know that .... i want to know if i can do to that in same command , not make it 20 times ....
Reply
#6

Quote:
Originally Posted by Sp3cter
Посмотреть сообщение
I know that .... i want to know if i can do to that in same command , not make it 20 times ....
If you wont to run every dcmd , you must make it like
pawn Код:
public OnPlayerCommandText( playerid, cmdtext[ ] )
{
    dcmd( buyc, 4, cmdtext );
    dcmd( buyclotes, 9, cmdtext );
    return 0;
}
else if you download and use ZCMD (wich i preffer becose its faster and easy for use ) then

pawn Код:
CMD:buyc(playrid,params[])
{
    // you code here
    return 1;
}
and nothing else you have too add such us dcmd on OnPlayerCommandText
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)