dm script ??
#2

With only one per-player global variable you can do all the work. Let me show how that would happen:

pawn Код:
// top of script
new Dming[MAX_PLAYERS];
// We gonna set the value of this variable to 1 when a player joins a dm, and to 0 when a player leaves a dm.
// As I said above we will set it to 1 while in dm, so whenever you initialize a player for dm, put this:
Dming[playerid] = 1; // which tells the script that "playerid" is in a dm
// now you can use OnPlayerSpawn to respawn a player ('dm-er') to the dm arena after death
public OnPlayerSpawn(playerid)
{
    if(Dming[playerid] == 1) // if was in a dm (This won't work if you set Dming to 0 under OnPlayerDeath)
    {
        // Respawn
    }
    return 1;
}

public OnPlayerConnect(playerid)
{
    Dming[playerid] = 0; // when a player connects set it to 0 (To avoid ids conflicts)
    return 1;
}
// And in your leavedm command remember to set Dming to 0
Dming[playerid] = 0; // out of dm
Reply


Messages In This Thread
dm script ?? - by NuLIO - 02.08.2012, 01:05
Re: dm script ?? - by [KHK]Khalid - 02.08.2012, 01:23
Re: dm script ?? - by NuLIO - 02.08.2012, 01:30
Re: dm script ?? - by [KHK]Khalid - 02.08.2012, 01:43
Re: dm script ?? - by NuLIO - 02.08.2012, 02:23
Re: dm script ?? - by [KHK]Khalid - 02.08.2012, 02:31
Re: dm script ?? - by NuLIO - 02.08.2012, 03:14
Re: dm script ?? - by [KHK]Khalid - 02.08.2012, 03:30
Re: dm script ?? - by NuLIO - 02.08.2012, 03:38
Re: dm script ?? - by [KHK]Khalid - 02.08.2012, 04:14

Forum Jump:


Users browsing this thread: 7 Guest(s)