[Pedido] Ver comando
#1

Ja to desesperado,desde de manha que ando a volta disto! Eu sou dono nivel 4,para comeзar
pawn Код:
if(strcmp(cmd, "/masscarmodelrandom", true) == 0)
        {
            if(PlayerInfo[playerid][Dono] == 0)
                return SendClientMessage(playerid, COLOR_RED, "Nгo pds fazer este cmd");
                new i;
            for(; i < sizeof(DynamicCars); i++)
            {
                new rand = random(sizeof(RandomStableModels));
                DynamicCars[i][CarModel] = RandomStableModels[rand][0];
                DestroyVehicle(i);
                CreateVehicle(DynamicCars[i][CarModel],DynamicCars[i][CarX],DynamicCars[i][CarY],DynamicCars[i][CarZ],DynamicCars[i][CarAngle],DynamicCars[i][CarColor1],DynamicCars[i][CarColor2], -1);
                Fuel[i] = GasMax;
                EngineStatus[i] = 0;
                VehicleLocked[i] = 0;
                CarWindowStatus[i] = 1; //1 = up, 0 = down.
            }
            SaveDynamicCars();
            return 1;
        }
este comando funciona se o fizer... mas se estiver assim
pawn Код:
if(PlayerInfo[playerid][Dono] == 4)
jб nгo funciona...diz que nгo posso fazer o comando. Isto й sу o comeзo,o meu problema nгo estб neste comando,mas sim neste!

pawn Код:
if(strcmp(cmd, "/resetallvehicles", true) == 0)
         {
          if(PlayerInfo[playerid][Dono] == 4)
            return SendClientMessage(playerid, COLOR_RED, "Nao pds fazer este cmd");
            new i,Float:distance = 6.0, Float:metres = distance;
            for(; i < sizeof(DynamicCars); i++, metres += distance)
            {
                GetPlayerPos(playerid, DynamicCars[i][CarX], DynamicCars[i][CarY], DynamicCars[i][CarZ]);
                new Float:a;
                GetPlayerFacingAngle(playerid, a);
                DynamicCars[i][CarColor1] = 1;
                DynamicCars[i][CarColor2] = 1;
                DynamicCars[i][FactionCar] = 255;
                DynamicCars[i][CarType] = 0;
                DynamicCars[i][CarAngle] = a;
                DynamicCars[i][CarX] += (metres * floatsin(-a, degrees));
                DynamicCars[i][CarY] += (metres * floatcos(-a, degrees));
                DynamicCars[i][Neon] = 0;
                DynamicCars[i][cPaintjob] = 999;
                ClearVehicleComponents(i);
                DestroyVehicle(i);
                CreateVehicle(DynamicCars[i][CarModel],DynamicCars[i][CarX],DynamicCars[i][CarY],DynamicCars[i][CarZ],DynamicCars[i][CarAngle],DynamicCars[i][CarColor1],DynamicCars[i][CarColor2], -1);
                Fuel[i] = GasMax;
                EngineStatus[i] = 0;
                VehicleLocked[i] = 0;
                SaveVehicleComponents(i);
            }
            SaveDynamicCars();
            return 1;
        }
Pois sou dono nivel 4 e nгo consigo fazer este comando /resetallvehicles,jб tentei meter
pawn Код:
if(PlayerInfo[playerid][Dono] != 4)
Sу que nahora de fazer o cmd diz "SERVEr:Unknow Command"
Reply
#2

Entгo o problema nгo estб nessa parte.
Tenha certeza que vocк estб tentando acessar uma coluna ou uma linha vбlida em alguma das matrizes que vocк tem aн.

Por exemplo:

pawn Код:
new matriz[20];
Se vocк tentar acessar matriz[21], retornarб Unknow Command.
Reply
#3

a uncia new й esta
pawn Код:
new i,Float:distance = 6.0, Float:metres = distance;
e nгo tou vendo nenhum problema
Reply
#4

e assim:

pawn Код:
if(strcmp(cmd, "/resetallvehicles", true) == 0)
{
    if(PlayerInfo[playerid][Dono] <= 4) return SendClientMessage(playerid, COLOR_RED, "Nao pds fazer este cmd");
       
    new Float:distance = 6.0, Float:metres = distance, Float:a;
   
    for(new i = 0; i < sizeof(DynamicCars); i++, metres += distance)
    {
        GetPlayerPos(playerid, DynamicCars[i][CarX], DynamicCars[i][CarY], DynamicCars[i][CarZ]);
        GetPlayerFacingAngle(playerid, a);
        DynamicCars[i][CarColor1] = 1;
        DynamicCars[i][CarColor2] = 1;
        DynamicCars[i][FactionCar] = 255;
        DynamicCars[i][CarType] = 0;
        DynamicCars[i][CarAngle] = a;
        DynamicCars[i][CarX] += (metres * floatsin(-a, degrees));
        DynamicCars[i][CarY] += (metres * floatcos(-a, degrees));
        DynamicCars[i][Neon] = 0;
        DynamicCars[i][cPaintjob] = 999;
        ClearVehicleComponents(i);
        DestroyVehicle(i);
        CreateVehicle(DynamicCars[i][CarModel],DynamicCars[i][CarX],DynamicCars[i][CarY],DynamicCars[i][CarZ],DynamicCars[i][CarAngle],DynamicCars[i][CarColor1],DynamicCars[i][CarColor2], -1);
        Fuel[i] = GasMax;
        EngineStatus[i] = 0;
        VehicleLocked[i] = 0;
        SaveVehicleComponents(i);
    }
    SaveDynamicCars();
    return 1;
}
o outro

pawn Код:
if(strcmp(cmd, "/masscarmodelrandom", true) == 0)
{
    if(PlayerInfo[playerid][Dono] < 1) return SendClientMessage(playerid, COLOR_RED, "Nгo pds fazer este cmd");
   
    for(new i = 0; i < sizeof(DynamicCars); i++)
    {
        new rand = random(sizeof(RandomStableModels));
        DynamicCars[i][CarModel] = RandomStableModels[rand][0];
        DestroyVehicle(i);
        CreateVehicle(DynamicCars[i][CarModel],DynamicCars[i][CarX],DynamicCars[i][CarY],DynamicCars[i][CarZ],DynamicCars[i][CarAngle],DynamicCars[i][CarColor1],DynamicCars[i][CarColor2], -1);
        Fuel[i] = GasMax;
        EngineStatus[i] = 0;
        VehicleLocked[i] = 0;
        CarWindowStatus[i] = 1; //1 = up, 0 = down.
    }
    SaveDynamicCars();
    return 1;
}
Reply
#5

o /resetallvehicles dб SERVer:Unknow Command
Reply
#6

pawn Код:
if(strcmp(cmd, "/resetallvehicles", true) == 0)
{
    if(PlayerInfo[playerid][Dono] <= 4) return SendClientMessage(playerid, COLOR_RED, "Nao pds fazer este cmd");
       
    new i, Float:distance = 6.0, Float:metres = distance, Float:a;
   
    for(; i < sizeof(DynamicCars); i++, metres += distance)
    {
        GetPlayerPos(playerid, DynamicCars[i][CarX], DynamicCars[i][CarY], DynamicCars[i][CarZ]);
        GetPlayerFacingAngle(playerid, a);
        DynamicCars[i][CarColor1] = 1;
        DynamicCars[i][CarColor2] = 1;
        DynamicCars[i][FactionCar] = 255;
        DynamicCars[i][CarType] = 0;
        DynamicCars[i][CarAngle] = a;
        DynamicCars[i][CarX] += (metres * floatsin(-a, degrees));
        DynamicCars[i][CarY] += (metres * floatcos(-a, degrees));
        DynamicCars[i][Neon] = 0;
        DynamicCars[i][cPaintjob] = 999;
        ClearVehicleComponents(i);
        DestroyVehicle(i);
        CreateVehicle(DynamicCars[i][CarModel],DynamicCars[i][CarX],DynamicCars[i][CarY],DynamicCars[i][CarZ],DynamicCars[i][CarAngle],DynamicCars[i][CarColor1],DynamicCars[i][CarColor2], -1);
        Fuel[i] = GasMax;
        EngineStatus[i] = 0;
        VehicleLocked[i] = 0;
        SaveVehicleComponents(i);
    }
    SaveDynamicCars();
    return 1;
}
tenta agr
Reply
#7

continua a dar a mesma mensagem
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)