Jump to content

Mariusik

Membru
  • Posts

    11
  • Joined

  • Last visited

  • Days Won

    1

Posts posted by Mariusik

  1. 9 hours ago, WopsS said:

    Verificarea asta

    
    strmatch(vInfo[i][vOwner], GetName(playerid))

    ce iti returneaza? Nu stiu functia asta si nici nu imi aduc aminte sa fie in SA-MP, dar foloseste strcmp.

    Iti verifica daca ai masina personala sau, nu ai masina personala.

  2. Pai problema este, daca dau /v imi zice ca nu am masina personala, asta se intampla dupa relog sau inainte de relog, dupa relog orice ar fi apare acel text.

    comada:

    CMD:v(playerid, params[])
    {
    	if(GetVehNumber(playerid) == 0)
    	{
    		return SCM(playerid, COLOR_SERVER, "EROARE: Nu ai masina personala.");
    	}
    	else
    	{
    		new var[512], szTitle[256];
    		format(szTitle, sizeof(szTitle), "Garajul lui %s (%d sloturi)", GetName(playerid), PlayerData[playerid][pVehKeys]);
    		for(new i = 1; i <= Total_Veh_Created; i++)
    		{
    			if(strmatch(vInfo[i][vOwner], GetName(playerid)))
    			{	
    				if(IsVehSpawned(i) == 1) format(gString, sizeof(gString), "Masina\tStatus\n{FFFFFF}%s\t{33AA33}Spawnat\n", VehicleNames[vInfo[i][vModel] - 400]);
    				else format(gString, sizeof(gString), "Masina\tStatus\n{FFFFFF}%s\t{33AA33}Despawnat\n", VehicleNames[vInfo[i][vModel] - 400]);
    				strcat(var, gString);
    			}
    		}
    		SPD(playerid, DIALOG_VEHICLES, DIALOG_STYLE_TABLIST_HEADERS, szTitle, var, "Selecteaza", "Anuleaza");
    	}
    	return 1;
    }

    Functia, care cred ca are problema:

    function GetVehNumber(playerid)
    {
    	new nr = 0;
    	for(new i = 1; i <= Total_Veh_Created; i++) if(strmatch(vInfo[i][vOwner], GetName(playerid)) && !vInfo[i][vType]) nr ++;
    	return nr;
    }

     

  3. Just now, WopsS said:

    Poti sa ne zici cum?

    Am adaugat:

    			Total_Veh_Created = vInfo[id][vCarID];
    			new cCar = CreateVehicle(vInfo[Total_Veh_Created][vModel], vInfo[Total_Veh_Created][vPosX], vInfo[Total_Veh_Created][vPosY], vInfo[Total_Veh_Created][vPosZ], vInfo[Total_Veh_Created][vPosA], vInfo[Total_Veh_Created][vColor1], vInfo[Total_Veh_Created][vColor2], 500000);
    			OwnedVeh(cCar) = Total_Veh_Created;

     

    • Upvote 1
  4. 4 minutes ago, WopsS said:

    Are legatura. @Banditul are dreptate, le incarca in memorie dar nu le creeaza pe server.

    function SpawnVeh(playerid, vehicle)
    {
        new carid = CreateVehicle(vInfo[vehicle][vModel], vInfo[vehicle][vPosX], vInfo[vehicle][vPosY], vInfo[vehicle][vPosZ], vInfo[vehicle][vPosA], vInfo[vehicle][vColor1], vInfo[vehicle][vColor2], 500000);
        SetVehicleNumberPlate(carid, vInfo[vehicle][vPlate]);
        ChangeVehiclePaintjob(carid, vInfo[vehicle][vPaintJ]);
        SetVehicleParamsEx(carid,VEHICLE_PARAMS_OFF,VEHICLE_PARAMS_OFF,alarm,doors,bonnet,boot,objective);
        vInfo[vehicle][vSpawned] = 1;
        vUpdate(vehicle, vSpawnedx);
        OwnedVeh(carid) = vehicle;
    //    Fuel[carid] = vInfo[OwnedVeh(carid)][vFuel];
    //    ModVehicle(carid);
        return 1;
    }

    am asta in gamemode

  5. 36 minutes ago, WopsS said:

    Vad ca in consola apare nr de masini din mysql, dar nu o spawuneaza, oare dc?

    function LoadVehicles()
    {
    	new row_count;
    
    	if(!cache_get_row_count(row_count))
    	{
    		new id = 0;
    		for(new i = 0; i < row_count; i++)
    		{
    			id++;
    			cache_get_value_name_int(i, "CarID", vInfo[id][vCarID]);
    			cache_get_value_name_int(i, "Model", vInfo[id][vModel]);
    			cache_get_value_name_int(i, "Color1", vInfo[id][vColor1]);
    			cache_get_value_name_int(i, "Color2", vInfo[id][vColor2]);
    			cache_get_value_name_int(i, "Price", vInfo[id][vPrice]);
    			cache_get_value_name(i, "Owner", vInfo[id][vOwner]);
    			cache_get_value_name_float(i, "vPosX", vInfo[id][vPosX]);
    			cache_get_value_name_float(i, "vPosY", vInfo[id][vPosY]);
    			cache_get_value_name_float(i, "vPosZ", vInfo[id][vPosZ]);
    			cache_get_value_name_float(i, "vPosA", vInfo[id][vPosA]);
    			cache_get_value_name(i, "Plate", vInfo[id][vPlate]);
    			cache_get_value_name_int(i, "PaintJ", vInfo[id][vPaintJ]);
    			cache_get_value_name_int(i, "Locked", vInfo[id][vLocked]);
    			cache_get_value_name_int(i, "Spawned", vInfo[id][vSpawned]);
    			cache_get_value_name_int(i, "Destroyed", vInfo[id][vDestroyed]);
    			cache_get_value_name_float(i, "Km", vInfo[id][vKm]);
    			cache_get_value_name_int(i, "Neon", vInfo[id][vNeon]);
    			cache_get_value_name_int(i, "Fuel", vInfo[id][vFuel]);
    			cache_get_value_name_int(i, "Type", vInfo[id][vType]);
    			cache_get_value_name_int(i, "vMod1", vInfo[id][mod1]);
    			cache_get_value_name_int(i, "vMod2", vInfo[id][mod2]);
    			cache_get_value_name_int(i, "vMod3", vInfo[id][mod3]);
    			cache_get_value_name_int(i, "vMod4", vInfo[id][mod4]);
    			cache_get_value_name_int(i, "vMod5", vInfo[id][mod5]);
    			cache_get_value_name_int(i, "vMod6", vInfo[id][mod6]);
    			cache_get_value_name_int(i, "vMod7", vInfo[id][mod7]);
    			cache_get_value_name_int(i, "vMod8", vInfo[id][mod8]);
    			cache_get_value_name_int(i, "vMod9", vInfo[id][mod9]);
    			cache_get_value_name_int(i, "vMod10", vInfo[id][mod10]);
    			cache_get_value_name_int(i, "vMod11", vInfo[id][mod11]);
    			cache_get_value_name_int(i, "vMod12", vInfo[id][mod12]);
    			cache_get_value_name_int(i, "vMod13", vInfo[id][mod13]);
    			cache_get_value_name_int(i, "vMod14", vInfo[id][mod14]);
    			cache_get_value_name_int(i, "vMod15", vInfo[id][mod15]);
    			cache_get_value_name_int(i, "vMod16", vInfo[id][mod16]);
    			cache_get_value_name_int(i, "vMod17", vInfo[id][mod17]);
    			
    			Total_Veh_Created = vInfo[id][vCarID];
    		}
    	}
    	for(new i = 1; i < MAX_VEHICLES; i++) OwnedVeh(i) = 0;
    	printf("Vehicles: %d", row_count);
    	return 1;
    }

     

  6. Am facut un sistem de tutveh, pentru versiunea de mysql R40, dar problema e ca dupa ce dau rr la server nu se incarca masinile

    la OnGameModeInit

    	mysql_format(handle, gQuery, sizeof(gQuery), "SELECT * FROM `vehicles`");
    	mysql_pquery(handle, gQuery, "LoadVehicles", "i");
    function LoadVehicles()
    {
    	new id = 0;
    	id++;
    	cache_get_value_name_int(0, "CarID", vInfo[id][vCarID]);
    	cache_get_value_name_int(0, "Model", vInfo[id][vModel]);
    	cache_get_value_name_int(0, "Color1", vInfo[id][vColor1]);
    	cache_get_value_name_int(0, "Color2", vInfo[id][vColor2]);
    	cache_get_value_name_int(0, "Price", vInfo[id][vPrice]);
    	cache_get_value_name(0, "Owner", vInfo[id][vOwner]);
    	cache_get_value_name_float(0, "vPosX", vInfo[id][vPosX]);
    	cache_get_value_name_float(0, "vPosY", vInfo[id][vPosY]);
    	cache_get_value_name_float(0, "vPosZ", vInfo[id][vPosZ]);
    	cache_get_value_name_float(0, "vPosA", vInfo[id][vPosA]);
        cache_get_value_name(0, "Plate", vInfo[id][vPlate]);
    	cache_get_value_name_int(0, "PaintJ", vInfo[id][vPaintJ]);
    	cache_get_value_name_int(0, "Locked", vInfo[id][vLocked]);
    	cache_get_value_name_int(0, "Spawned", vInfo[id][vSpawned]);
    	cache_get_value_name_int(0, "Destroyed", vInfo[id][vDestroyed]);
    	cache_get_value_name_float(0, "Km", vInfo[id][vKm]);
    	cache_get_value_name_int(0, "Neon", vInfo[id][vNeon]);
    	cache_get_value_name_int(0, "Fuel", vInfo[id][vFuel]);
    	cache_get_value_name_int(0, "Type", vInfo[id][vType]);
    	cache_get_value_name_int(0, "vMod1", vInfo[id][mod1]);
    	cache_get_value_name_int(0, "vMod2", vInfo[id][mod2]);
    	cache_get_value_name_int(0, "vMod3", vInfo[id][mod3]);
    	cache_get_value_name_int(0, "vMod4", vInfo[id][mod4]);
    	cache_get_value_name_int(0, "vMod5", vInfo[id][mod5]);
    	cache_get_value_name_int(0, "vMod6", vInfo[id][mod6]);
    	cache_get_value_name_int(0, "vMod7", vInfo[id][mod7]);
    	cache_get_value_name_int(0, "vMod8", vInfo[id][mod8]);
    	cache_get_value_name_int(0, "vMod9", vInfo[id][mod9]);
    	cache_get_value_name_int(0, "vMod10", vInfo[id][mod10]);
    	cache_get_value_name_int(0, "vMod11", vInfo[id][mod11]);
    	cache_get_value_name_int(0, "vMod12", vInfo[id][mod12]);
    	cache_get_value_name_int(0, "vMod13", vInfo[id][mod13]);
    	cache_get_value_name_int(0, "vMod14", vInfo[id][mod14]);
    	cache_get_value_name_int(0, "vMod15", vInfo[id][mod15]);
    	cache_get_value_name_int(0, "vMod16", vInfo[id][mod16]);
    	cache_get_value_name_int(0, "vMod17", vInfo[id][mod17]);
    
    	Total_Veh_Created = vInfo[id][vCarID];
    	for(new i = 1; i < MAX_VEHICLES; i++) OwnedVeh(i) = 0;
    	return 1;
    }

    Ce nu am facut bine

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.