[AYUDA]Error 006
#1

Porfavor me pueden ayudar me sale este error pero no se que hacer! Me serviria de mucha ayuda! Gracias


pawn Код:
D:\serverxd\filterscripts\ccar.pwn(12) : error 006: must be assigned to an array
D:\serverxd\filterscripts\ccar.pwn(13) : error 006: must be assigned to an array
D:\serverxd\filterscripts\ccar.pwn(14) : error 006: must be assigned to an array
D:\serverxd\filterscripts\ccar.pwn(15) : error 006: must be assigned to an array
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


4 Errors.
Y nose cual es el error
Reply
#2

Posteб el cуdigo usando [pawn] (cуdigo) [pawn]
Reply
#3

No se tu codigo, pero supongo q a la variable que estas usando le tenes que poner [0] para hacerla array, asi:
variable[0]
Reply
#4

Aqui esta el filterscript completo para que me digan cual es el error porfavor :C

pawn Код:
#include <a_samp> //includes a_samp

new AllCars[93] =
{
400,401,402,404,405,410,411,412,415,418,419,420,421,422,424,426,429,434,436,
438,439,442,445,451,458,466,467,470,474,475,477,478,480,480,480,480,489,490,
491,492,494,496,500,501,502,503,504,505,506,507,516,517,518,526,527,529,533,
534,535,536,540,541,542,543,545,546,547,549,550,551,555,558,559,560,561,562,
565,566,567,575,576,580,585,587,589,596,597,598,600,602,603,604,605,
}; //defines all the cars in game

new Float:x = "1737.4010,2063.6392,13.6036,87.5051"; //x position
new Float:y = "1978.3867,440.5475,26.8465,175.2626"; //y position
new Float:z = "2137.7017,1483.1578,10.8203,359.3649"; //z position
new Float:rot = "2133.8037,1485.7959,10.8203,355.9182"; //rotation

new ccar; //stores the car
forward ccc(); //forward ccc

main()
{
    print("ChaseCar loaded!"); //prints ClaseCar loaded!
}

public OnFilterScriptInit()
{
    ccar = AddStaticVehicle(562,x,y,z,rot,122,1); // ccar
    SetTimer("ccc", 500, 1); //sets the timer
   
    for(new i=0; i<MAX_VEHICLES; i++)  //loop
    {
        if(i == ccar) //if i == ccar
        {
            SetVehicleNumberPlate(i, "CCAR"); //sets the cars number plate
            SetVehicleToRespawn(i); //respawns it (VERY IMPORTANT!!!)
        }
    }
    return 1;
}

public OnFilterScriptExit()
{
    DestroyVehicle(ccar); //destroys the car
    return 1;
}

public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
    if(vehicleid == ccar) //if vehicleid == ccar
    {
        new name[MAX_PLAYER_NAME], string[44]; //defines name and string
        GetPlayerName(playerid, name, sizeof(name)); //gets the players name
        format(string, sizeof(string), "%s has taken the ChaseCar!",name); //formats the message
        SendClientMessageToAll(0xFF0000FF, string); //sends the message
    }
    return 1;
}

public OnPlayerExitVehicle(playerid, vehicleid)
{
    if(vehicleid == ccar) //if vehicleid == ccar
    {
        new name[MAX_PLAYER_NAME], string[44]; //defines name and string
        GetPlayerName(playerid, name, sizeof(name)); //gets the players name
        format(string, sizeof(string), "%s has left the ChaseCar!",name); //formats the message
        SendClientMessageToAll(0xFF0000FF, string); //sends the message
    }
    return 1;
}

public OnVehicleSpawn(vehicleid)
{
    if(vehicleid == ccar)
    {
        ChangeVehiclePaintjob(vehicleid,0); // paint job
        AddVehicleComponent(vehicleid, 1035); // roof
        AddVehicleComponent(vehicleid, 1079); // rim
        AddVehicleComponent(vehicleid, 1037); // exhaust
        AddVehicleComponent(vehicleid, 1039); // side
        AddVehicleComponent(vehicleid, 1172); // front
        AddVehicleComponent(vehicleid, 1146); // Spoiler
        AddVehicleComponent(vehicleid, 1010); // Nitrous
        SendClientMessageToAll(0xFF0000FF, "The ChaseCar Respawned!!!"); //message
    }
    return 1;
}

public ccc() //public
{
    for(new i=0; i < MAX_PLAYERS; i++) //loop
    {
        if(IsPlayerInCar(i)) //if player is in car
        {
            if(GetPlayerVehicleID(i) == ccar) //if player car == ccar
            {
                GivePlayerMoney(i, 100); //gives player money
            }
        }
    }
}

stock IsPlayerInCar(playerid) //function
{
    new vehicleid = GetPlayerVehicleID(playerid); //gets the vehicle id
    if(!IsPlayerInAnyVehicle(playerid)) return 0; //if player aint in cat, return 0;
    for(new i = 0; i < 93; i++) //loop
    {
        if(GetVehicleModel(vehicleid) == AllCars[i]) //if the car is a car in allcars
        {
            return 1; //returns 1
        }
    }
    return 0; //returns 0
}
Reply
#5

pawn Код:
new Float:x = "1737.4010,2063.6392,13.6036,87.5051"; //x position
new Float:y = "1978.3867,440.5475,26.8465,175.2626"; //y position
new Float:z = "2137.7017,1483.1578,10.8203,359.3649"; //z position
new Float:rot = "2133.8037,1485.7959,10.8203,355.9182"; //rotation
eso quitalo lo de arriba

No tiene sentido usar float asi y tampoco se puede XD es para obtener el valor de algo mas o menos, quita eso ahora solo deberias coger 1 auto poner /save in game y las coordenadas que te tire las pones ahi :S
pawn Код:
ccar = AddStaticVehicle(562,x,y,z,rot,122,1); // PON ACA ESAS COORDENADAS
ademas en lo de arriba en cada "cordenada" hay 4 coordenadas x,y,z, rot osea que son 16!! basta con las 4 de una ya esta

Ejemplo:
pawn Код:
ccar = AddStaticVehicle(562,1737.4010,2063.6392,13.6036,87.5051,122,1); // PON ACA ESAS COORDENADAS
Reply
#6

No entiendo porfavor explicamelo
Reply
#7

Mira donde esta "AddStaticVehicle(562,x,y,z,rot,122,1);"
x= 1 posicion
y= otra
z= otra
rot= la rotacion

Borra esto:
pawn Код:
new Float:x = "1737.4010,2063.6392,13.6036,87.5051"; //x position
new Float:y = "1978.3867,440.5475,26.8465,175.2626"; //y position
new Float:z = "2137.7017,1483.1578,10.8203,359.3649"; //z position
new Float:rot = "2133.8037,1485.7959,10.8203,355.9182"; //rotation
Eso no va, ahora como obtienes esas posiciones x,y,z y la rotacion?, simple anda a tu server entras en 1 auto lo pones donde se supone debe ir usas el comando /save aquicualquiercosa adentro del auto, ahora vas a mis documentos/ gta san andreas /samp /savepositions.txt creo que es ahi a mi se me graban en otra parte.

Ahora dira algo asi:

AddStaticVehicle(562,algoaqui,algoaqui,algoaqui,al goaqui,122,1);
donde "algo aqui" estб, son las posiciones de ese auto simplemente remplaza esa linea que veas por el que tienes
Reply
#8

Osea mmm, borro todo donde dice float x ,etc. Luego ya tengo las posiciones guardadas, pero pongo una sola coordenada en AddStaticVehicle, tengo que copearlo para poner otra coordenada?
Reply
#9

osea si ves donde dice float: "x ", ahi tienes las 4 coordenadas de izquierda a derecha: x,y,z,rotacion

Donde AddStaticVehicle pasa lo mismo

AddStaticVehicle(562,x,y,z,rotacion,122,1);

aca encuentra mas

"562" = id del coche...ejemplo: bus, taxi, cheetah

x,y,z,rotacion lo que indica donde estara el coche...

122,1 los colores

Eso es todo en donde deben ir las coordenadas x,y,z,rotacion ponlas que tu gustes.... lo de float deberias borrarlo eso es lo que da el error
Reply
#10

Aun asi no me salen errores pero, cuando abro el server, cuando entro no esta donde debe de estar, no aparece.. A qe se debe eso?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)