[PEDIDO] sistema de carros
#6

Ficou assim:
Код:
/*

****************** CAR OWNERSHIP FILTERSCRIPT **********************************

*/
#include <a_samp>
#include <dini>


#define FILTERSCRIPT

new bool:validcar[MAX_VEHICLES];

stock GetFreeVehicleSlot()
{
    for(new i = 0; i < sizeof(validcar); i ++)
    {
        if(!validcar[i]) return i;
    }
    return -1;
}

enum carDataEnum {        
    model,
    Float:xspawn,
    Float:yspawn,
    Float:zspawn,
    Float:anglespawn,
    col1,
    col2,
    respawn,
    owner[20]
}

new carData[MAX_VEHICLES][carDataEnum];

stock CreateVehicleEx(modelid, Float:x, Float:y, Float:z, Float:angle, color1, color2, respawntime, ownername[20])
{
    
    new carid = GetFreeVehicleSlot();
    carData[carid][model] = modelid;
    carData[carid][xspawn] = x;
    carData[carid][yspawn] = y;
    carData[carid][zspawn] = z;
    carData[carid][anglespawn] = angle;
    carData[carid][col1] = color1;
    carData[carid][col2] = color2;
    carData[carid][respawn] = respawntime;
    carData[carid][owner] = ownername;
    validcar[carid] = true;
    CreateVehicle(modelid, x, y, z, angle, color1, color2, respawntime);
    return carid;         
}

stock SaveVehicle(vehicle, filename[36])
{
    new iniid = ini_CreateIniFile(filename);
    ini_SetInt(iniid, "Model", carData[vehicle][model]);
    ini_SetFloat(iniid, "XSpawn", carData[vehicle][xspawn]);
    ini_CloseIni(iniid);
}

stock SaveAllVehicles()
{
    new saveindex = 0;
    new fname[36];
    for(new i = 0; i < MAX_VEHICLES; i ++)
    {
        if(validcar[i])
        {
            format(fname, sizeof(fname), "fvehicles/%d.ini", saveindex);  //You can also add a subfolder here<.
            SaveVehicle(i, fname);
            saveindex ++; 
        }
	}
}

stock LoadVehicle(vehicle, filename[36])
{
    new iniid = ini_OpenIni(filename);
    CreateVehicleEx(ini_GetInt(iniid, "Model"), ini_GetFloat(iniid, "XSpawn"), ...);
    ini_CloseIni(iniid);
}

stock LoadAllVehicles()
{
    new fname[36];
    new index = 0;
    format(fname, sizeof(fname), "%d.ini", index);
    while(fexist(fname))  
    {
        LoadVehicle(fname);
        index ++;
        format(fname, sizeof(fname), "%d.ini", index);
    }
}

public OnFilterScriptInit()
{
	printf("****************** CAR OWNERSHIP FILTERSCRIPT **********************************");
	return 1;
}

public OnFilterScriptExit()
{
   	printf("****************** CAR OWNERSHIP FILTERSCRIPT **********************************");
	return 1;
}





public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp("/buy", cmdtext, true, 10) == 0)
    {
        new NomedoComprador[MAX_PLAYER_NAME];
        new IdDoCarro = GetPlayerVehicleID(playerid);
        GetPlayerName(playerid, NomedoComprador, sizeof(NomedoComprador));
        if(IsPlayerInAnyVehicle(playerid))
        {
            carData[IdDoCarro][owner] = NomedoComprador;
            SaveAllVehicles();
            return 1;
        }
    }
    return 0;
}
Deu errors no comando la:
Quote:

C:\DOCUME~1\FELIPE~1\Desktop\SERVER~1\FILTER~1\OWN ERS~1.PWN(57) : error 017: undefined symbol "ini_CreateIniFile"
C:\DOCUME~1\FELIPE~1\Desktop\SERVER~1\FILTER~1\OWN ERS~1.PWN(5 : error 017: undefined symbol "ini_SetInt"
C:\DOCUME~1\FELIPE~1\Desktop\SERVER~1\FILTER~1\OWN ERS~1.PWN(59) : error 017: undefined symbol "ini_SetFloat"
C:\DOCUME~1\FELIPE~1\Desktop\SERVER~1\FILTER~1\OWN ERS~1.PWN(60) : error 017: undefined symbol "ini_CloseIni"
C:\DOCUME~1\FELIPE~1\Desktop\SERVER~1\FILTER~1\OWN ERS~1.PWN(57) : warning 204: symbol is assigned a value that is never used: "iniid"
C:\DOCUME~1\FELIPE~1\Desktop\SERVER~1\FILTER~1\OWN ERS~1.PWN(123) : error 047: array sizes do not match, or destination array is too small
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


5 Errors.

Reply


Messages In This Thread
[PEDIDO] sistema de carros - by blackwave - 01.12.2010, 02:02
Re: [PEDIDO] sistema de carros - by [Banido]HigorOliver - 01.12.2010, 11:13
Re: [PEDIDO] sistema de carros - by faeldk - 01.12.2010, 11:36
Re: [PEDIDO] sistema de carros - by blackwave - 01.12.2010, 11:47
Re: [PEDIDO] sistema de carros - by rjjj - 01.12.2010, 13:28
Re: [PEDIDO] sistema de carros - by blackwave - 01.12.2010, 14:05
Re: [PEDIDO] sistema de carros - by rjjj - 01.12.2010, 14:14
Re: [PEDIDO] sistema de carros - by blackwave - 01.12.2010, 14:18
Re: [PEDIDO] sistema de carros - by rjjj - 01.12.2010, 14:37
Re: [PEDIDO] sistema de carros - by blackwave - 01.12.2010, 14:45

Forum Jump:


Users browsing this thread: 1 Guest(s)