Must be assigned to an Array.
#1

Hello there, this is my command.
pawn Код:
CMD:veh(playerid, params[])
{
    new car,color,color2;
    if(PlayerInfo[playerid][pAdmin] >= 4)
    {
        if(gPlayerLogged[playerid] == 0) return SendClientMessage(playerid, COLOR_GREY, "You're not logged in.");
        if(PlayerInfo[playerid][pInjuried] == 2) return SendClientMessage(playerid, COLOR_WHITE, "SERVER: You cant do this when you're in heavily wounded modus.");
        if(sscanf(params, "iii", car,color,color2)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /veh [model] [color1] [color2]");
        if(car < 400 || car > 611) return SendClientMessage(playerid,COLOR_GRAD2, "Invalid vehicle ID specified !(411 - 611)");
        if(color> 255 || color< 0) return SendClientMessage(playerid, COLOR_GRAD2, "Car color ID's: 0-255");
        if(color2> 255 || color2< 0) return SendClientMessage(playerid, COLOR_GRAD2, "Car color ID's: 0-255");
        if(IsPlayerInAnyVehicle(playerid)) return RemovePlayerFromVehicle(playerid);
        oldcar[playerid] = currentcar;
        new Float:X, Float:Y, Float:Z, Float:A;
        GetPlayerPos(playerid, X,Y,Z);
        GetPlayerFacingAngle(playerid,A);
        new carid = CreateVehicle(car, X,Y,Z,A, color, color2, -1);
        currentcar[playerid] = carid;
        DestroyVehicle(oldcar[playerid]);
        PutPlayerInVehicle(playerid,carid, 0);
        LinkVehicleToInterior(carid,GetPlayerInterior(playerid));
    }
    else return SendClientMessage(playerid, COLOR_GRAD2, NOTADMIN);
    return 1;
}
It gives me this warning:
Код:
(1845) : error 006: must be assigned to an array
Line 1845
pawn Код:
oldcar[playerid] = currentcar;
Reply
#2

Post here the definition of currentcar.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)