Jump to content
  • 0

Problema Insurance car


Question

Posted

Salut am si eu o mica problema cand bubui masina nu imi creste insul dc?

public OnVehicleDeath(vehicleid)
{
     new engine,lights,alarm,doors,bonnet,boot,objective;
     vehEngine[vehicleid] = 0;
    GetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,boot,objective);
     SetVehicleParamsEx(vehicleid,VEHICLE_PARAMS_OFF,lights,alarm,doors,bonnet,boot,objective);
    if(IsAnOwnableCar(vehicleid))
     {
        foreach(new i : Player)
        {
            for(new v; v < MAX_PERSONAL_VEHICLES; v++)
            {
                if(PlayerInfo[pCarID][v] == vehicleid)
                {
                    PlayerInfo[pCarHP][v] = 1000.0;
                    if(PlayerInfo[pCarIns][v] != 0)
                    {
                        PlayerInfo[pCarIns][v]--;
                    }
                    cUpdate(i, v, cInsurancecarx);
                    cUpdate(i, v, cKMx);
                    cUpdate(i, v, cHPx);
                }
            }
        }
     }
     if(Destroycar == 1)
     {
        if(Carspawn[vehicleid] != 0)
        {
            DestroyVehicle(Carspawn[vehicleid]);
            Carspawn[vehicleid] = 0;
        }
    }
    StopAudioStreamForPlayersInCar(vehicleid);
     return 1;
}

Recommended Posts

  • 0
Posted (edited)
Acum 26 minute, Exaton a spus:

Salut am si eu o mica problema cand bubui masina nu imi creste insul dc?

public OnVehicleDeath(vehicleid)
{
     new engine,lights,alarm,doors,bonnet,boot,objective;
     vehEngine[vehicleid] = 0;
    GetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,boot,objective);
     SetVehicleParamsEx(vehicleid,VEHICLE_PARAMS_OFF,lights,alarm,doors,bonnet,boot,objective);
    if(IsAnOwnableCar(vehicleid))
     {
        foreach(new i : Player)
        {
            for(new v; v < MAX_PERSONAL_VEHICLES; v++)
            {
                if(PlayerInfo[pCarID][v] == vehicleid)
                {
                    PlayerInfo[pCarHP][v] = 1000.0;
                    if(PlayerInfo[pCarIns][v] != 0)
                    {
                        PlayerInfo[pCarIns][v]--;
                    }
                    cUpdate(i, v, cInsurancecarx);
                    cUpdate(i, v, cKMx);
                    cUpdate(i, v, cHPx);
                }
            }
        }
     }
     if(Destroycar == 1)
     {
        if(Carspawn[vehicleid] != 0)
        {
            DestroyVehicle(Carspawn[vehicleid]);
            Carspawn[vehicleid] = 0;
        }
    }
    StopAudioStreamForPlayersInCar(vehicleid);
     return 1;
}

La

cUpdate(i, v, cInsurancecarx);
cUpdate(i, v, cKMx);
cUpdate(i, v, cHPx);
 
incearca
 

CarInfo[v][cInsurancecar]--;
cUpdate(v, cInsurancecarx);
cUpdate(v, cKMx);
cUpdate(v, cHPx);

Edited by StR_Marian

Ce inseamna cuvantul "Unic" este atunci cand Chestia / Obiectul / Idea / etc... nu exista in alta parte.

Copii, nu mai veniti cu vorbe de "Am gamemode unic", nu exista asa ceva, la ora actuala totul este pe net.

Aveti grija pe cine ajutati, majoritatea sunt caini.

  • 0
Posted
Acum 1 oră, StR_Marian a spus:

La

cUpdate(i, v, cInsurancecarx);
cUpdate(i, v, cKMx);
cUpdate(i, v, cHPx);
 
incearca
 

CarInfo[v][cInsurancecar]--;
cUpdate(v, cInsurancecarx);
cUpdate(v, cKMx);
cUpdate(v, cHPx);

nu mrg

  • 0
Posted
Acum 6 minute, Iobit a spus:

Pentru ca valoarea nu se duce in baza de date, am patit si eu asa ceva.  

 

si ce fac ajutama te rog frumos

  • 0
Posted

pune la public OnVehicleDeath(vehicleid)     urmatoarele 

 

     new engine,lights,alarm,doors,bonnet,boot,objective;
     vehEngine[vehicleid] = 0;
    GetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,boot,objective);
     SetVehicleParamsEx(vehicleid,VEHICLE_PARAMS_OFF,lights,alarm,doors,bonnet,boot,objective);
    if(IsAnOwnableCar(vehicleid))
     {
        foreach(new i : Player)
        {
            for(new v; v < MAX_PERSONAL_VEHICLES; v++)
            {
                if(PlayerInfo[pCarID][v] == vehicleid)
                {
                    PlayerInfo[pCarHP][v] = 1000.0;
                    if(PlayerInfo[pCarIns][v] != 0)
                    {
                        PlayerInfo[pCarIns][v]--;
                    }
                    cUpdate(i, v, cInsurancecarx);
                    cUpdate(i, v, cKMx);
                    cUpdate(i, v, cHPx);
                }
            }
        }
     }

  • 0
Posted
Chiar acum, Iobit a spus:

pune la public OnVehicleDeath(vehicleid)     urmatoarele 

 

     new engine,lights,alarm,doors,bonnet,boot,objective;
     vehEngine[vehicleid] = 0;
    GetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,boot,objective);
     SetVehicleParamsEx(vehicleid,VEHICLE_PARAMS_OFF,lights,alarm,doors,bonnet,boot,objective);
    if(IsAnOwnableCar(vehicleid))
     {
        foreach(new i : Player)
        {
            for(new v; v < MAX_PERSONAL_VEHICLES; v++)
            {
                if(PlayerInfo[pCarID][v] == vehicleid)
                {
                    PlayerInfo[pCarHP][v] = 1000.0;
                    if(PlayerInfo[pCarIns][v] != 0)
                    {
                        PlayerInfo[pCarIns][v]--;
                    }
                    cUpdate(i, v, cInsurancecarx);
                    cUpdate(i, v, cKMx);
                    cUpdate(i, v, cHPx);
                }
            }
        }
     }

sa le inlocuiesc?

  • 0
Posted
Acum 5 minute, Iobit a spus:

da

imi da error
error 032: array index out of bounds (variable "PlayerInfo")
error 032: array index out of bounds (variable "PlayerInfo")
warning 213: tag mismatch
 error 032: array index out of bounds (variable "PlayerInfo")
 error 032: array index out of bounds (variable "PlayerInfo")

dc?

 

  • 0
Posted
Acum 1 minut, Iobit a spus:

Defineste PlayerInfo

asa? 

new engine,lights,alarm,doors,bonnet,boot,objective,PlayerInfo;

  • 0
Posted (edited)
Acum 2 ore, Exaton a spus:

imi da error
error 032: array index out of bounds (variable "PlayerInfo")
error 032: array index out of bounds (variable "PlayerInfo")
warning 213: tag mismatch
 error 032: array index out of bounds (variable "PlayerInfo")
 error 032: array index out of bounds (variable "PlayerInfo")

dc?

 

Acesezi o valoare de pe un "loc" care nu e definit, gen playerinfo e pana la 1000 si tu accesezi 1001

Edited by valivaly96
  • 0
Posted
Chiar acum, valivaly96 a spus:

Acesi un "indice" care nu se afla. gen playerinfo e pana la 1000 si tu accesezi 1001

dara cum pot sa fac ca sa mearga? 

  • 0
Posted
Chiar acum, valivaly96 a spus:

Cum ai definit PlayerInfo?

new engine,lights,alarm,doors,bonnet,boot,objective,PlayerInfo;

  • 0
Posted
Acum 13 ore, valivaly96 a spus:

pai trebuie sa fie legat de un enum acest playerinfo nu cum il ai tu.

si cum o fac ajutama te rog

  • 0
Posted
Acum 2 ore, Gabriel_Badea_17 a spus:

Ia din alt gamemode aceste date si le inlocuiesti pe gm-ul tau mai simplu

am incercat dar nu mrg e gm galaxy-arena

  • Like 1
  • 0
Posted

Încearcă :

 

public OnVehicleDeath(vehicleid)
{
 	new engine,lights,alarm,doors,bonnet,boot,objective;
 	vehEngine[vehicleid] = 0;
	GetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,boot,objective);
 	SetVehicleParamsEx(vehicleid,VEHICLE_PARAMS_OFF,lights,alarm,doors,bonnet,boot,objective);
    if(IsAnOwnableCar(vehicleid))
 	{
		foreach(new i : Player)
		{
			for(new v; v < MAX_PERSONAL_VEHICLES; v++)
			{
				if(PlayerInfo[i][pCarID][v] == vehicleid)
				{
					PlayerInfo[i][pCarHP][v] = 1000.0;
					if(PlayerInfo[i][pCarIns][v] != 0)
					{
						PlayerInfo[i][pCarIns][v]--;
					}
					cUpdate(i, v, cInsurancecarx);
					cUpdate(i, v, cKMx);
					cUpdate(i, v, cHPx);
				}
			}
		}
 	}
 	if(Destroycar == 1)
 	{
		if(Carspawn[vehicleid] != 0)
		{
			DestroyVehicle(Carspawn[vehicleid]);
			Carspawn[vehicleid] = 0;
		}
	}
	StopAudioStreamForPlayersInCar(vehicleid);
 	return 1;
}

 

Spoiler

Gang Gang

 

 

  • 0
Posted

tot

Acum 5 minute, SilviuInfinite a spus:

Încearcă :

 


public OnVehicleDeath(vehicleid)
{
 	new engine,lights,alarm,doors,bonnet,boot,objective;
 	vehEngine[vehicleid] = 0;
	GetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,boot,objective);
 	SetVehicleParamsEx(vehicleid,VEHICLE_PARAMS_OFF,lights,alarm,doors,bonnet,boot,objective);
    if(IsAnOwnableCar(vehicleid))
 	{
		foreach(new i : Player)
		{
			for(new v; v < MAX_PERSONAL_VEHICLES; v++)
			{
				if(PlayerInfo[i][pCarID][v] == vehicleid)
				{
					PlayerInfo[i][pCarHP][v] = 1000.0;
					if(PlayerInfo[i][pCarIns][v] != 0)
					{
						PlayerInfo[i][pCarIns][v]--;
					}
					cUpdate(i, v, cInsurancecarx);
					cUpdate(i, v, cKMx);
					cUpdate(i, v, cHPx);
				}
			}
		}
 	}
 	if(Destroycar == 1)
 	{
		if(Carspawn[vehicleid] != 0)
		{
			DestroyVehicle(Carspawn[vehicleid]);
			Carspawn[vehicleid] = 0;
		}
	}
	StopAudioStreamForPlayersInCar(vehicleid);
 	return 1;
}

 

tot asa sau poate nu are insul legatura cu asta dar cam putin cred

  • 0
Posted
Acum 2 ore, Exaton a spus:

tot

tot asa sau poate nu are insul legatura cu asta dar cam putin cred

rescrie sistemul

  • 0
Posted
Acum 34 minute, Gabriel_Badea_17 a spus:

rescrie sistemul

am incercat dar imi date eroare si era la fel

  • 0
Posted
On 2/26/2018 at 10:25 AM, Exaton said:

Salut am si eu o mica problema cand bubui masina nu imi creste insul dc?

public OnVehicleDeath(vehicleid)
{
     new engine,lights,alarm,doors,bonnet,boot,objective;
     vehEngine[vehicleid] = 0;
    GetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,boot,objective);
     SetVehicleParamsEx(vehicleid,VEHICLE_PARAMS_OFF,lights,alarm,doors,bonnet,boot,objective);
    if(IsAnOwnableCar(vehicleid))
     {
        foreach(new i : Player)
        {
            for(new v; v < MAX_PERSONAL_VEHICLES; v++)
            {
                if(PlayerInfo[pCarID][v] == vehicleid)
                {
                    PlayerInfo[pCarHP][v] = 1000.0;
                    if(PlayerInfo[pCarIns][v] != 0)
                    {
                        PlayerInfo[pCarIns][v]--;
                    }
                    cUpdate(i, v, cInsurancecarx);
                    cUpdate(i, v, cKMx);
                    cUpdate(i, v, cHPx);
                }
            }
        }
     }
     if(Destroycar == 1)
     {
        if(Carspawn[vehicleid] != 0)
        {
            DestroyVehicle(Carspawn[vehicleid]);
            Carspawn[vehicleid] = 0;
        }
    }
    StopAudioStreamForPlayersInCar(vehicleid);
     return 1;
}

Din ce vad punctele de asigurare ar trebuii sa scada, tu te referi ca nu creste pretul unui punct de asugurare banuiesc, nu stiu exact cum ai tu, eu de exemplu am pCarInsPrice, dupa modelul asta PlayerInfo[pCarIns][v]--; banuiesc ca ai putea pune ceva gen PlayerInfo[pCarInsPrice][v] += suma_cu_care_creste; si sa faci un update in baza de date cUpdate(playerid, v, cInscarpricex);, prin urmare va arata ceva de genul 

public OnVehicleDeath(vehicleid)
{
     new engine,lights,alarm,doors,bonnet,boot,objective;
     vehEngine[vehicleid] = 0;
    GetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,boot,objective);
     SetVehicleParamsEx(vehicleid,VEHICLE_PARAMS_OFF,lights,alarm,doors,bonnet,boot,objective);
    if(IsAnOwnableCar(vehicleid))
     {
        foreach(new i : Player)
        {
            for(new v; v < MAX_PERSONAL_VEHICLES; v++)
            {
                if(PlayerInfo[pCarID][v] == vehicleid)
                {
                    PlayerInfo[pCarHP][v] = 1000.0;
                    if(PlayerInfo[pCarIns][v] != 0)
                    {
                        PlayerInfo[pCarIns][v]--;
                    }

                    PlayerInfo[pCarInsPrice][v]+=50;

                    cUpdate(playerid, v, cInscarpricex);
                    cUpdate(i, v, cInsurancecarx);
                    cUpdate(i, v, cKMx);
                    cUpdate(i, v, cHPx);
                }
            }
        }
     }
     if(Destroycar == 1)
     {
        if(Carspawn[vehicleid] != 0)
        {
            DestroyVehicle(Carspawn[vehicleid]);
            Carspawn[vehicleid] = 0;
        }
    }
    StopAudioStreamForPlayersInCar(vehicleid);
     return 1;
}

  • 0
Posted
Acum 22 ore, Ionut_WS a spus:

Din ce vad punctele de asigurare ar trebuii sa scada, tu te referi ca nu creste pretul unui punct de asugurare banuiesc, nu stiu exact cum ai tu, eu de exemplu am pCarInsPrice, dupa modelul asta PlayerInfo[pCarIns][v]--; banuiesc ca ai putea pune ceva gen PlayerInfo[pCarInsPrice][v] += suma_cu_care_creste; si sa faci un update in baza de date cUpdate(playerid, v, cInscarpricex);, prin urmare va arata ceva de genul 

public OnVehicleDeath(vehicleid)
{
     new engine,lights,alarm,doors,bonnet,boot,objective;
     vehEngine[vehicleid] = 0;
    GetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,boot,objective);
     SetVehicleParamsEx(vehicleid,VEHICLE_PARAMS_OFF,lights,alarm,doors,bonnet,boot,objective);
    if(IsAnOwnableCar(vehicleid))
     {
        foreach(new i : Player)
        {
            for(new v; v < MAX_PERSONAL_VEHICLES; v++)
            {
                if(PlayerInfo[pCarID][v] == vehicleid)
                {
                    PlayerInfo[pCarHP][v] = 1000.0;
                    if(PlayerInfo[pCarIns][v] != 0)
                    {
                        PlayerInfo[pCarIns][v]--;
                    }

                    PlayerInfo[pCarInsPrice][v]+=50;

                    cUpdate(playerid, v, cInscarpricex);
                    cUpdate(i, v, cInsurancecarx);
                    cUpdate(i, v, cKMx);
                    cUpdate(i, v, cHPx);
                }
            }
        }
     }
     if(Destroycar == 1)
     {
        if(Carspawn[vehicleid] != 0)
        {
            DestroyVehicle(Carspawn[vehicleid]);
            Carspawn[vehicleid] = 0;
        }
    }
    StopAudioStreamForPlayersInCar(vehicleid);
     return 1;
}

ma ajutat miritaxd mersi oricum

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • 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.