Hallo!
Ich habe ein kleines "tag-matchiges" Problem mit meiner stock Funktion "SetPlayerFacingAngleToPlayer" in meinem Wiederbelebungssystem.
Hier die Funktion.
[pwn=1145]stock SetPlayerFacingAngleToPlayer(playerid, targetid)
{
new Float:p[3], t[3];
GetPlayerPos(playerid, p[0], p[1], p[2]);
GetPlayerPos(targetid, t[0], t[1], t[2]);
new Float:a = 180.0-atan2(p[0]-t[0], p[1]-t[1]);
SetPlayerFacingAngle(playerid, a);
}[/pwn]
Hier die Verwendung bei Betätigung der Taste H.
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if(newkeys & KEY_CTRL_BACK) //H
{
new closestID = GetClosestPlayer(playerid, 1.0);
if(IsPlayerDead[closestID])
{
if(!Rezzing[playerid] && GetPlayerState(playerid) == PLAYER_STATE_ONFOOT)
{
PlayersRezzingPlayer[closestID]++;
SetPlayerFacingAngleToPlayer(playerid, closestID);
Rezzing[playerid] = true;
BeingRezzed[closestID] = true;
}
else if(Rezzing[playerid] && GetPlayerState(playerid) == PLAYER_STATE_ONFOOT)
{
ClearAnimations(playerid);
Rezzing[playerid] = false;
if(PlayersRezzingPlayer[closestID] == 0) BeingRezzed[closestID] = false;
}
}
else return 1;
}
return BO_OnPlayerKeyStateChange(playerid, newkeys, oldkeys);
}
forward BO_OnPlayerKeyStateChange(playerid, newkeys, oldkeys);
#if defined _ALS_OnPlayerKeyStateChange
#undef OnPlayerKeyStateChange
#else
#define _ALS_OnPlayerKeyStateChange
#endif
#define OnPlayerKeyStateChange BO_OnPlayerKeyStateChange
Errormeldungen
(1149) : warning 213: tag mismatch
(1149) : warning 213: tag mismatch
(1149) : warning 213: tag mismatch