SA-MP Forums Archive
Not respawning in deathmatch - 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: Not respawning in deathmatch (/showthread.php?tid=405977)



Not respawning in deathmatch - nhunor58 - 08.01.2013

Hello all i made a minigun dm but when somebody dies there he is respawning in the city how can i fix that?
Here is the code:
pawn Код:
#include <a_samp>
      #define COLOR_GREEN 0x6AF7E1FF

        new DM[MAX_PLAYERS];
        new InMinigun[MAX_PLAYERS];

        public OnPlayerCommandText(playerid, cmdtext[])
        {
            if(!strcmp(cmdtext, "/minigun", true))
            {
                    new pname[MAX_PLAYER_NAME], string3[128];
                    DM[playerid] = 1;
                    InMinigun[playerid] = 1;
                    SetPlayerPos(playerid, 1303.0999755859, 2166.3999023438, 10.699999809265);
                    ResetPlayerWeapons(playerid);
                    GivePlayerWeapon(playerid,38 , 9999);
                    GameTextForPlayer(playerid,"~r~~h~WeLcOmE To MiNiGuN",3000,5);
                    GetPlayerName(playerid, pname, sizeof (pname));
                    format(string3, sizeof(string3),"%s HaS GoNe To MiNiGuN ~r~(/minigun)~p~", pname);
                    SendClientMessage(playerid, COLOR_GREEN, string3);
                    SetPlayerFacingAngle(playerid, 0.0);
                    SetPlayerInterior(playerid, 0);
                    SendClientMessage(playerid, 0x6AF7E1FF, " If you are caught fire zone STUNT These weapons MAKE JAIL / kick / ban permanently!");
                    SendClientMessage(playerid, COLOR_GREEN, "If you want to get out of DM use the command /exit!");
                    return 1;
            }
             if(!strcmp(cmdtext, "/exit", true))
             {
              SendClientMessage(playerid, -1, "Ai iesit din DM!");
              InMinigun[playerid] = 0;
              DM[playerid] = 0;
              return 1;
             }
            return 0;
        }

    public OnPlayerSpawn( playerid)
    {
    if( InMinigun[playerid] == 1 )
    {
    SetPlayerPos(playerid, 1303.0999755859, 2166.3999023438, 10.699999809265);
    }
    return 1;
    }



Re: Not respawning in deathmatch - Catalyst- - 08.01.2013

I'm guessing you have code after what you're showing in OnPlayerSpawn that's setting a player's position to a different location, so just return a value if the InMinigun variable equals to 1.

Example:
pawn Код:
if( InMinigun[playerid] == 1 )
{
    SetPlayerPos(playerid, 1303.10, 2166.40, 10.70);
    return 1;
}