function heading differs from prototype - 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: function heading differs from prototype (
/showthread.php?tid=499611)
function heading differs from prototype -
OllyBrock - 08.03.2014
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
Re: function heading differs from prototype -
arakuta - 08.03.2014
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
Re: function heading differs from prototype -
OllyBrock - 08.03.2014
Thanks lad this can be closed