Jump to content
  • 0

Problema Insurance car


Exaton

Question

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;
}

Link to comment
Share on other sites

Recommended Posts

  • 0
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.

Link to comment
Share on other sites

  • 0

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);
                }
            }
        }
     }

Link to comment
Share on other sites

  • 0
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?

Link to comment
Share on other sites

  • 0
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?

 

Link to comment
Share on other sites

  • 0
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
Link to comment
Share on other sites

  • 0

Î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

 

 

Link to comment
Share on other sites

  • 0

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

Link to comment
Share on other sites

  • 0
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;
}

Link to comment
Share on other sites

  • 0
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

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.