Help about onplayershootplayer
#1

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;
}
Reply
#2

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
{
Reply
#3

its from this Filterscript :
http://forum.sa-mp.com/showthread.ph...=bullet+damage
Reply
#4

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.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)