function heading differs from prototype
#1

code:

Код:
3518public OnPlayerShootPlayer(Shooter,Target,Float:HealthLost,Float:ArmourLost)
3519{
3520	new string[128];
3521	if(GetPlayerWeapon(Shooter) == 34 && PlayerInfo[Shooter][pScope] && Hitman[Shooter] == Target)
3522	{
3523		SetPlayerHealth(Target, 0);
3524		if(Hitman[Shooter] == Target)
3525		{
3526		    format(string, sizeof(string), " You have been critically injured by a hitman and lost $%d.", 3527PlayerInfo[Target][pContract]);3527
3528		    SendClientMessage(Target, COLOR_YELLOW, string);
3529		    format(string, sizeof(string), "Hitman %s has fulfilled the contract on %s's head and collected $%d.", 3530GetPlayerNameEx(Shooter), GetPlayerNameEx(Target), PlayerInfo[Target][pContract]);
3531			SendHitmanMessage(COLOR_YELLOW, string);
3532			GiveSafeMoney(Target, -PlayerInfo[Target][pContract]);
3533			GiveSafeMoney(Shooter, PlayerInfo[Target][pContract]);
3534			PlayerInfo[Target][pContract] = 0;
3535			format(PlayerInfo[Target][pContract], 32, "");
3536			Hitman[Shooter] = INVALID_PLAYER_ID;
3537			PlayerInfo[Shooter][pCSuccess] ++;
3539		}
3540		PlayerInfo[Shooter][pScope] --;
3541	}
3542	return 1;
3543}
errors:
(3519) : error 025: function heading differs from prototype
Reply
#2

There is no reason to use OnPlayerShootPlayer. It is a third-party function, made before the OnPlayerGiveDamage and OnPlayerTakeDamage native functions. Use them instead.

https://sampwiki.blast.hk/wiki/OnPlayerGiveDamage
https://sampwiki.blast.hk/wiki/OnPlayerTakeDamage
Reply
#3

Thanks lad this can be closed
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)