[Pedido] Converter comando para zcmd
#1

gostaria que alguem convertesse este comando para zcmd
meu comando :
pawn Код:
if(strcmp(cmd, "/car", true, 4) == 0)
        {
               
 
                new String[200];
                new tmp[256];
                new Float:x, Float:y, Float:z;
                tmp = strtok(cmdtext, idx);
                if(!strlen(tmp)) return SendClientMessage(playerid,red, "SYNTAX: /car [car name]");
                new vehicle = GetVehicleModelIDFromName(tmp);
                if(vehicle < 400 || vehicle > 611) return SendClientMessage(playerid,red, "That vehicle name you have given was not found, please try again!");
                if(Veh[playerid][VehId] == -1)
                {
                        new Float:a;
                        GetPlayerFacingAngle(playerid, a);
                        GetPlayerPos(playerid, x, y, z);
 
                        if(IsPlayerInAnyVehicle(playerid) == 1)
                        {
                                GetXYInFrontOfPlayer(playerid, x, y, 8);
                        }
                        else
                        {
                            GetXYInFrontOfPlayer(playerid, x, y, 5);
                        }
 
                        new PlayersVehicle = CreateVehicle(vehicle, x, y, z, a+90, -1, -1, -1);
                        Veh[playerid][VehId] = PlayersVehicle;
                        LinkVehicleToInterior(PlayersVehicle, GetPlayerInterior(playerid));
                }
                else
                {
                    DestroyVehicle(Veh[playerid][VehId]);
                        new Float:a;
                        GetPlayerFacingAngle(playerid, a);
                        GetPlayerPos(playerid, x, y, z);
 
                        if(IsPlayerInAnyVehicle(playerid) == 1)
                        {
                                GetXYInFrontOfPlayer(playerid, x, y, 8);
                        }
                        else
                        {
                            GetXYInFrontOfPlayer(playerid, x, y, 5);
                        }
 
                        new PlayersVehicle = CreateVehicle(vehicle, x, y, z, a+90, -1, -1, -1);
                        Veh[playerid][VehId] = PlayersVehicle;
                        LinkVehicleToInterior(PlayersVehicle, GetPlayerInterior(playerid));
                }
                format(String, sizeof(String), "You have spawned a %s", aVehicleNames[vehicle - 400]);
                SendClientMessage(playerid,green, String);
                return 1;
        }
        return 0;
}
quem ajudar vou dar +rep
Reply
#2

http://pastebin.com/rZfsEpb5
Reply
#3

Quote:
Originally Posted by MultiKill
Посмотреть сообщение
Nao e o mesmo sistema que o meu

gostaria da conversao de meu comando
Reply
#4

Alguem me ajuda Porfavor ?
Reply
#5

pawn Код:
CMD:car(playerid, params[])
{
        new String[200];
    new tmp[256];
    new Float:x, Float:y, Float:z;
    tmp = strtok(cmd, idx);
    if(!strlen(tmp)) return SendClientMessage(playerid,red, "SYNTAX: /car [car name]");
    new vehicle = GetVehicleModelIDFromName(tmp);
    if(vehicle < 400 || vehicle > 611) return SendClientMessage(playerid,red, "That vehicle name you have given was not found, please try again!");
    if(Veh[playerid][VehId] == -1)
    {
        new Float:a;
        GetPlayerFacingAngle(playerid, a);
        GetPlayerPos(playerid, x, y, z);
       
        if(IsPlayerInAnyVehicle(playerid) == 1)
        {
            GetXYInFrontOfPlayer(playerid, x, y, 8);
        }
        else
        {
            GetXYInFrontOfPlayer(playerid, x, y, 5);
        }
       
        new PlayersVehicle = CreateVehicle(vehicle, x, y, z, a+90, -1, -1, -1);
        Veh[playerid][VehId] = PlayersVehicle;
        LinkVehicleToInterior(PlayersVehicle, GetPlayerInterior(playerid));
    }
    else
    {
        DestroyVehicle(Veh[playerid][VehId]);
        new Float:a;
        GetPlayerFacingAngle(playerid, a);
        GetPlayerPos(playerid, x, y, z);
       
        if(IsPlayerInAnyVehicle(playerid) == 1)
        {
            GetXYInFrontOfPlayer(playerid, x, y, 8);
        }
        else
        {
            GetXYInFrontOfPlayer(playerid, x, y, 5);
        }
       
        new PlayersVehicle = CreateVehicle(vehicle, x, y, z, a+90, -1, -1, -1);
        Veh[playerid][VehId] = PlayersVehicle;
        LinkVehicleToInterior(PlayersVehicle, GetPlayerInterior(playerid));
    }
    format(String, sizeof(String), "You have spawned a %s", aVehicleNames[vehicle - 400]);
    SendClientMessage(playerid,green, String);
    return 1;
}
return 0;
}
Reply
#6

Quote:
Originally Posted by Ivison
Посмотреть сообщение
pawn Код:
CMD:car(playerid, params[])
{
        new String[200];
    new tmp[256];
    new Float:x, Float:y, Float:z;
    tmp = strtok(cmd, idx);
    if(!strlen(tmp)) return SendClientMessage(playerid,red, "SYNTAX: /car [car name]");
    new vehicle = GetVehicleModelIDFromName(tmp);
    if(vehicle < 400 || vehicle > 611) return SendClientMessage(playerid,red, "That vehicle name you have given was not found, please try again!");
    if(Veh[playerid][VehId] == -1)
    {
        new Float:a;
        GetPlayerFacingAngle(playerid, a);
        GetPlayerPos(playerid, x, y, z);
       
        if(IsPlayerInAnyVehicle(playerid) == 1)
        {
            GetXYInFrontOfPlayer(playerid, x, y, 8);
        }
        else
        {
            GetXYInFrontOfPlayer(playerid, x, y, 5);
        }
       
        new PlayersVehicle = CreateVehicle(vehicle, x, y, z, a+90, -1, -1, -1);
        Veh[playerid][VehId] = PlayersVehicle;
        LinkVehicleToInterior(PlayersVehicle, GetPlayerInterior(playerid));
    }
    else
    {
        DestroyVehicle(Veh[playerid][VehId]);
        new Float:a;
        GetPlayerFacingAngle(playerid, a);
        GetPlayerPos(playerid, x, y, z);
       
        if(IsPlayerInAnyVehicle(playerid) == 1)
        {
            GetXYInFrontOfPlayer(playerid, x, y, 8);
        }
        else
        {
            GetXYInFrontOfPlayer(playerid, x, y, 5);
        }
       
        new PlayersVehicle = CreateVehicle(vehicle, x, y, z, a+90, -1, -1, -1);
        Veh[playerid][VehId] = PlayersVehicle;
        LinkVehicleToInterior(PlayersVehicle, GetPlayerInterior(playerid));
    }
    format(String, sizeof(String), "You have spawned a %s", aVehicleNames[vehicle - 400]);
    SendClientMessage(playerid,green, String);
    return 1;
}
return 0;
}
Uso Zcmd e Sscanf2 e amigo quando ultiliza sscanf nao e poe : tmp = strtok(cmd, idx);
Reply
#7

ih espera alguem melho que eu vim aqui que eu usei o conversor
Reply
#8

Quote:
Originally Posted by Ivison
Посмотреть сообщение
ih espera alguem melho que eu vim aqui que eu usei o conversor
existe conversor ? nem sabia
Reply
#9

Conversor : Strcmp para Zcmd.
Reply
#10

Quote:
Originally Posted by Ivison
Посмотреть сообщение
Se for o do rjj nao usei pois ele nao converte totalmente o comando apenas muda de zcmd para strcmp
so a primeira linha do comando o resto continua igual ,_,
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)