[Tutorial] Tips & Tricks [Share Yours!]
#8

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.

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;
}
Some demonstration (available in English):
[ame="http://www.youtube.com/watch?v=mX_Q2-mRF9Q"]Bypass losing money after the player's death.[/ame]
Reply


Messages In This Thread
Tips & Tricks [Share Yours!] - by Weponz - 03.10.2013, 14:58
Re: Tips & Tricks [Share Yours!] - by DanishHaq - 03.10.2013, 15:33
Re: Tips & Tricks [Share Yours!] - by RajatPawar - 03.10.2013, 15:37
Re: Tips & Tricks [Share Yours!] - by Weponz - 03.10.2013, 15:39
Re: Tips & Tricks [Share Yours!] - by RajatPawar - 03.10.2013, 15:48
Re: Tips & Tricks [Share Yours!] - by Weponz - 03.10.2013, 15:52
Respuesta: Tips & Tricks [Share Yours!] - by ipsBruno - 05.10.2013, 12:03
Re: Tips & Tricks [Share Yours!] - by sanya_gnoy - 05.10.2013, 12:21
Re: Tips & Tricks [Share Yours!] - by Weponz - 06.10.2013, 10:41
Re: Tips & Tricks [Share Yours!] - by Patrick - 06.10.2013, 22:15
Re: Tips & Tricks [Share Yours!] - by Sublime - 07.10.2013, 02:31
Re: Tips & Tricks [Share Yours!] - by sanya_gnoy - 07.10.2013, 06:25

Forum Jump:


Users browsing this thread: 3 Guest(s)