05.10.2013, 12:21
(
Last edited by sanya_gnoy; 07/10/2013 at 06:25 AM.
)
Tip/Trick Title: Bypass losing money after the player's death.
Tip/Trick Description: To ignore the loss of the money after the death of the player by using SpawnPlayer(playerid). In this case, reset the animation.
Some demonstration (available in English):
[ame="http://www.youtube.com/watch?v=mX_Q2-mRF9Q"]Bypass losing money after the player's death.[/ame]
Tip/Trick Description: To ignore the loss of the money after the death of the player by using SpawnPlayer(playerid). In this case, reset the animation.
pawn Code:
//enum to record the variables in
enum pInfo
{
Float:pPosX,
Float:pPosY,
Float:pPosZ,
Float:pPosR,
}
new PlayerInfo[MAX_PLAYERS][pInfo];
//actually function
public OnPlayerDeath(playerid, killerid, reason)
{
GetPlayerPos(playerid, PlayerInfo[playerid][pPosX], PlayerInfo[playerid][pPosY], PlayerInfo[playerid][pPosZ]);
GetPlayerFacingAngle(playerid, PlayerInfo[playerid][pPosR]);
//Respawn at the place of death
SetSpawnInfo(playerid, 0, PlayerInfo[playerid][pSkin], PlayerInfo[playerid][pPosX], PlayerInfo[playerid][pPosY], PlayerInfo[playerid][pPosZ], PlayerInfo[playerid][pPosR], 0, 0, 0, 0, 0, 0);
SpawnPlayer(playerid);
return 1;
}
[ame="http://www.youtube.com/watch?v=mX_Q2-mRF9Q"]Bypass losing money after the player's death.[/ame]