SA-MP Forums Archive
a_vshot error - +REP - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: a_vshot error - +REP (/showthread.php?tid=566959)



a_vshot error - +REP - PiLLoW - 09.03.2015

Quote:

C:\Users\server\Desktop\NVCNR\NVCNR-0.3z\pawno\include\a_vshot.inc(27 : error 017: undefined symbol "BULLET_HIT_TYPE_VEHICLE"


Код:
forward OnPlayerShootVehiclePart(playerid, weaponid, vehicleid,hittype);

public OnPlayerWeaponShot(playerid, weaponid, hittype, hitid, Float:fX, Float:fY, Float:fZ)
{
    switch(hittype)
    {
        case BULLET_HIT_TYPE_VEHICLE:
        {
            new Float:fSet[9];
			new modelid = GetVehicleModel(hitid);
			GetVehicleModelInfo(modelid, VEHICLE_MODEL_INFO_PETROLCAP,fSet[0], fSet[1], fSet[2]);
			GetVehicleModelInfo(modelid, VEHICLE_MODEL_INFO_WHEELSFRONT, fSet[3], fSet[4], fSet[5]);
            GetVehicleModelInfo(modelid, VEHICLE_MODEL_INFO_WHEELSREAR,  fSet[6], fSet[7], fSet[8]);
			if(fX >= VehicleShotInfo[modelid-400][VS_PetrolX]-0.15 && fX <= VehicleShotInfo[modelid-400][VS_PetrolX]+0.15 && fY >= VehicleShotInfo[modelid-400][VS_PetrolY]-0.15 && fY <= VehicleShotInfo[modelid-400][VS_PetrolY]+0.15 && fZ >= VehicleShotInfo[modelid-400][VS_PetrolZ]-0.15 && fZ <= VehicleShotInfo[modelid-400][VS_PetrolZ]+0.15)
			{
				if(EnablePetrolCapExplosionVar==1)
				{
					new Float:vPosx,Float:vPosy,Float:vPosz;
					GetVehiclePos(hitid, vPosx,vPosy,vPosz);
					CreateExplosion(vPosx,vPosy,vPosz, 3, 30.0);
					SetVehicleToRespawn(hitid);
				}
				CallLocalFunction("OnPlayerShootVehiclePart", "iiii", playerid, weaponid, hitid,BULLET_HIT_PETROL_TANK);
			}
			else if(fX >= fSet[3]-2.4 && fX <= fSet[3] && fY >= fSet[4]-0.4 && fY <= fSet[4]+0.4 && fZ >= fSet[5]-0.4 && fZ <= fSet[5]+0.4)
			{
				if(EnableWheelTirePopVar==1)
				{
					if(GetVehicleTireStatus(hitid,VEHICLE_LEFT_FRONT_WHEEL)==0)
					{
						SetVehicleTireStatus(hitid,VEHICLE_LEFT_FRONT_WHEEL);
					}
					//else SendClientMessage(playerid,-1,"This tire is already popped!");
				}
				CallLocalFunction("OnPlayerShootVehiclePart", "iiii", playerid, weaponid, hitid,BULLET_HIT_LEFT_FRONT_WHEEL);
			}
			else if(fX >= fSet[3]-0.4 && fX <= fSet[3]+0.4 && fY >= fSet[4]-0.4 && fY <= fSet[4]+0.4 && fZ >= fSet[5]-0.4 && fZ <= fSet[5]+0.4)
			{
				if(EnableWheelTirePopVar==1)
				{
					if(GetVehicleTireStatus(hitid,VEHICLE_RIGHT_FRONT_WHEEL)==0)
					{
						SetVehicleTireStatus(hitid,VEHICLE_RIGHT_FRONT_WHEEL);
					}
					//else SendClientMessage(playerid,-1,"This tire is already popped!");
				}
				CallLocalFunction("OnPlayerShootVehiclePart", "iiii", playerid, weaponid, hitid,BULLET_HIT_RIGHT_FRONT_WHEEL);
			}
			else if(fX >= fSet[6]-2.4 && fX <= fSet[6] && fY >= fSet[7]-0.4 && fY <= fSet[7]+0.4 && fZ >= fSet[8]-0.4 && fZ <= fSet[8]+0.4)
			{
				if(EnableWheelTirePopVar==1)
				{
					if(GetVehicleTireStatus(hitid,VEHICLE_LEFT_BACK_WHEEL)==0)
					{
						SetVehicleTireStatus(hitid,VEHICLE_LEFT_BACK_WHEEL);
					}
					//else SendClientMessage(playerid,-1,"This tire is already popped!");
				}
				CallLocalFunction("OnPlayerShootVehiclePart", "iiii", playerid, weaponid, hitid,BULLET_HIT_LEFT_BACK_WHEEL);
			}
			else if(fX >= fSet[6]-0.4 && fX <= fSet[6]+0.4 && fY >= fSet[7]-0.4 && fY <= fSet[7]+0.4 && fZ >= fSet[8]-0.4 && fZ <= fSet[8]+0.4)
			{
				if(EnableWheelTirePopVar==1)
				{
					if(GetVehicleTireStatus(hitid,VEHICLE_RIGHT_BACK_WHEEL)==0)
					{
						SetVehicleTireStatus(hitid,VEHICLE_RIGHT_BACK_WHEEL);
					}
					//else SendClientMessage(playerid,-1,"This tire is already popped!");
				}
				CallLocalFunction("OnPlayerShootVehiclePart", "iiii", playerid, weaponid, hitid,BULLET_HIT_RIGHT_BACK_WHEEL);
			}
			if(EnableVehicleDamageVar==1)
			{
				if(IsVehicleOccupied(hitid)==0)
				{
					new Float:vHP;
					GetVehicleHealth(hitid,vHP);
					SetVehicleHealth(hitid,vHP-WeaponShotInfo[GetPlayerWeapon(playerid)-22][WS_Damage]);
				}
			}
			CallLocalFunction("OnPlayerShootVehiclePart", "iiii", playerid, weaponid, hitid,BULLET_HIT_BODY);
        }
    }
	#if defined hook_OnPlayerWeaponShot
        hook_OnPlayerWeaponShot(playerid, weaponid, hittype, hitid, Float:fX, Float:fY, Float:fZ);
    #endif
	return 1;
}

#if defined _ALS_OnPlayerWeaponShot
    #undef OnPlayerWeaponShot  
#else
    #define _ALS_OnPlayerWeaponShot
#endif

#define OnPlayerWeaponShot hook_OnPlayerWeaponShot

#if defined hook_OnPlayerWeaponShot
    forward hook_OnPlayerWeaponShot(playerid, weaponid, hittype, hitid, Float:fX, Float:fY, Float:fZ);
#endif

public OnVehicleSpawn(vehicleid)
{
	VehicleTire[vehicleid][0]=0;
	VehicleTire[vehicleid][1]=0;
	VehicleTire[vehicleid][2]=0;
	VehicleTire[vehicleid][3]=0;
	#if defined hook_OnVehicleSpawn
        hook_OnVehicleSpawn(vehicleid);
    #endif
	return 1;
}



Respuesta: a_vshot error - +REP - JuanStone - 09.03.2015

Quote:
Originally Posted by Wiki-samp
Посмотреть сообщение
This callback was added in SA-MP 0.3z and will not work in earlier versions!
Perhaps this will be remedied by updating the include, this public was added in 0.3z if you use earlier versions tries to changing to includes 0.3z and perhaps is resolved.


Re: a_vshot error - +REP - Ritzy2K - 09.03.2015

did u download my NVCNR Edit man? if so, Pm me.. i can help.


Re: a_vshot error - +REP - PiLLoW - 09.03.2015

how about this sir

Quote:

C:\Users\server\Desktop\NVCNR\NVCNR-0.3x\gamemodes\NVCNR.pwn(18139) : error 025: function heading differs from prototype

Код:
public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid, bodypart)
{
	ShowBloodScreen(playerid,amount, 350);
	return 1;
}



Re: a_vshot error - +REP - CalvinC - 09.03.2015

Update your a_samp and YSI includes.


Respuesta: a_vshot error - +REP - JuanStone - 09.03.2015

Quote:
Originally Posted by PiIIoW
Посмотреть сообщение
how about this sir



Код:
public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid, bodypart)
{
	ShowBloodScreen(playerid,amount, 350);
	return 1;
}
The parameter "bodypart" was added in version 0.3z seems to be that you are using earlier versions, if you want to use this public delete the parameter "bodypart".


Re: a_vshot error - +REP - Ritzy2K - 09.03.2015

it completely compiles for me tho... if u want i can send u complete package on ********...(you are on my fb lol)...just hit me up at fb.


Re: a_vshot error - +REP - CalvinC - 09.03.2015

Quote:
Originally Posted by DopeX
Посмотреть сообщение
it completely compiles for me tho... if u want i can send u complete package on ********...(you are on my fb lol)...just hit me up at fb.
Still if he's using 0.3z functions in a 0.3x server, it wont work, there's a reason the compiler aborts instead of outputting a .amx file.


Re: a_vshot error - +REP - Ritzy2K - 09.03.2015

ikr...his compiler says...that he is using 0.3x...as above told about the body part param...but i was going to give him complete server package..