Help about onplayershootplayer - 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: Help about onplayershootplayer (
/showthread.php?tid=364986)
Help about onplayershootplayer -
BigBaws - 01.08.2012
Error : function heading differs from prototype
Line : public OnPlayerShootPlayer(Shooter,Target,Float:HealthLos t,Float:ArmourLost)
Код:
#include <a_samp>
#include <OPSP>
public OnPlayerShootPlayer(Shooter,Target,Float:HealthLost,Float:ArmourLost)
{
new Float:health, Float:armour;
GetPlayerHealth(Target,health);
GetPlayerArmour(Target,armour);
if(ArmourLost > 0.0) SetPlayerArmour(Target,floatadd(armour,ArmourLost));
if(HealthLost > 0.0) SetPlayerHealth(Target,floatadd(health,HealthLost));
new Damage;
switch(GetPlayerWeapon(Shooter))
{
case 24: Damage = 20;//case [weaponid]: Damage = [damage];
case 31,28: Damage = 25;//Tec9 & Micru-Uzi
case 29: Damage = 30;
case 0: Damage = 7;
case 22: Damage = 25;
case 23: Damage = 20;
case 5,3,6,7,2: Damage = 10;
case 4: Damage = 30;
case 25: Damage = 60;
case 30: Damage = 30;
case 33,34: Damage = 95;
}
armour = armour - Damage;
if(armour < 0.0)
{
health += armour;//Health will decrease because armour is negative. (a + (-b) = a - b)
if(health <= 0.0)
{
health = 0.0;
}
armour = 0.0;
}
SetPlayerHealth(Target, health);
SetPlayerArmour(Target, armour);
new msg[128],name1[24],name2[24];
format(msg,sizeof(msg)," * %s shot %s(Dmg: %f HP and %f Armour)!",name1,name2,HealthLost,ArmourLost);
SendClientMessage(Target,0xFFFFFFFF,msg);
SendClientMessage(Shooter,0xFFFFFFFF,msg);
return 1;
}
Re: Help about onplayershootplayer -
Kindred - 01.08.2012
Is that defined in another include?
Is it defined twice?
Are the parameters wrong then when it was called by native?
Like this:
pawn Код:
forward Example(playerid, vehicleid);
public Example(playerid, vehicleid, othershit) //See, othersshit isn't in the forward, hence forth it is wrong
{
Re : Help about onplayershootplayer -
BigBaws - 01.08.2012
its from this Filterscript :
http://forum.sa-mp.com/showthread.ph...=bullet+damage
Re: Help about onplayershootplayer -
Kindred - 01.08.2012
Since you are including OPSP, why are you redefining it in the script? ((looks like you are doing that))
If you redefined it, remove it.