AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting (https://forums.alliedmods.net/forumdisplay.php?f=107)
-   -   error 035: argument type mismatch (argument 1) (https://forums.alliedmods.net/showthread.php?t=327841)

lisauro 10-13-2020 00:14

error 035: argument type mismatch (argument 1)
 
Trying to fix a code, getting error in this line. Am noob, sorry, provided all warning/error info as compiler show.
Code:

CreateTeamVehicle(org,rank,model,Float:X,Float:Y,Float:Z,Float:A,Color_1,Color_2,spawntime)
{
        new carid = J_AddStaticVehicleEx(model, X, Y, Z, A, Color_1, Color_2, spawntime);  <=== error in this line
        VehicleInfo[carid][vTeam] = org;
        VehicleInfo[carid][vRank] = rank;
        return carid;
}

In fact multiple warnings just for that line.
symbol is never used: "spawntime"
symbol is never used: "Color_2"
symbol is never used: "Color_1"
symbol is never used: "A"
symbol is never used: "Z"
symbol is never used: "Y"
symbol is never used: "X"
symbol is never used: "model"
warning 219: local variable "model" shadows a variable at a preceding level
warning 219: local variable "X" shadows a variable at a preceding level
warning 219: local variable "Y" shadows a variable at a preceding level
warning 219: local variable "Z" shadows a variable at a preceding level
warning 219: local variable "A" shadows a variable at a preceding level
warning 219: local variable "carid" shadows a variable at a preceding level

Marttt 10-13-2020 00:39

Re: error 035: argument type mismatch (argument 1)
 
well using old syntax, also this snippet code you pasted here is not enough to somebody help you
Post the full code or better error messages
Warnings you can just ignore (symbol is never used)
the others can be a problem.

lisauro 10-13-2020 02:13

Re: error 035: argument type mismatch (argument 1)
 
All script is over 100k lines.
I don't know, maybe this part can help to identify error.
Code:

{
        new carid = AddStaticVehicleEx(model, x, y, z, a, color_1, color_2, spawntime);
        VehicleInfo[carid][vAntiRepair]=2;
        VehicleInfo[carid][vLock]=0;
        VehicleInfo[carid][vModel] = model;
        VehicleInfo[carid][vPos_X] = x;
        VehicleInfo[carid][vPos_Y] = y;
        VehicleInfo[carid][vPos_Z] = z;
        VehicleInfo[carid][vPos_A] = a;
        VehicleInfo[carid][vColor_1] = color_1;
        VehicleInfo[carid][vColor_2] = color_2;
        VehicleInfo[carid][vSpawnTime] = spawntime;
        LinkVehicleToInterior(carid, interior);
        SetVehicleVirtualWorld(carid, world);
        VehicleInfo[carid][vTuning] = GetVehicleTuningState( model );
        switch(model)
        {
        case 430, 446, 452, 453, 454, 472, 473, 484, 493: VehicleState[carid] = VEHICLE_STATE_BOAT;
        case 417, 425, 447, 460, 469, 476, 487, 488, 497,465, 511, 512, 513, 519, 520, 548, 553,
                563, 577, 592, 593:  VehicleState[carid] = VEHICLE_STATE_PLANE;
        case 581, 522, 461, 521, 523, 463, 468, 471, 586: VehicleState[carid] = VEHICLE_STATE_BIKE;
        case 509, 481, 510: VehicleState[carid] = VEHICLE_STATE_VELIK;
        case 462,448: VehicleState[carid] = VEHICLE_STATE_MOPED;
        case 538, 537: VehicleState[carid] = VEHICLE_STATE_TRAIN;
        default: VehicleState[carid] = VEHICLE_STATE_CAR;
        }
        return carid;
}


lisauro 10-13-2020 07:53

Re: error 035: argument type mismatch (argument 1)
 
Fixed it by myself, thanks.


All times are GMT -4. The time now is 05:58.

Powered by vBulletin®
Copyright ©2000 - 2020, vBulletin Solutions, Inc.