dm spawn
#1

how to make when player kill in dm player spawn in dm and when type leavedm player leave dm
Reply
#2

maybe you can use something of when a player is in range of point of where your DM is that it gets spawned at the spot where you want it to spawn.. something like this:
pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
    if(IsPlayerInRangeOfPoint(playerid, Float:range,Float:x,Float:y,Float:z))
    {
        SetPlayerPos(playerid, yourpositions);
    }
    return 1;
}
for more info about the isplayerinrangeofpoint go to this:
https://sampwiki.blast.hk/wiki/IsPlayerInRangeOfPoint

i hope i helped you a bit

greets niels
Reply
#3

thxx for help
Reply
#4

np i always want to help ppl if i can XD BTW: tell me if it works XD i am not sure
Reply
#5

it will not work. When a player dies he can't spawn.
pawn Код:
// At The Top
new
    IsPlayerInDM[ MAX_PLAYERS ];

// On you command to enter DM
    IsPlayerInDM[ playerid ] = 1;

// OnPlayerSpawn Callback
if( IsPlayerInDM[ playerid ] == 1)
{
    SetPlayerPos(...); // DM's Coordinates
}

// On command to leave DM
    IsPlayerInDM = 0;
    SetPlayerPos(...); // somewhere else
Reply
#6

thxx afor help
Reply
#7

Why it doesnґt it work?
Reply
#8

Quote:
Originally Posted by Konstantinos
Посмотреть сообщение
it will not work. When a player dies he can't spawn.
pawn Код:
// At The Top
new
    IsPlayerInDM[ MAX_PLAYERS ];

// On you command to enter DM
    IsPlayerInDM[ playerid ] = 1;

// OnPlayerSpawn Callback
if( IsPlayerInDM[ playerid ] == 1)
{
    SetPlayerPos(...); // DM's Coordinates
}

// On command to leave DM
    IsPlayerInDM = 0;
    SetPlayerPos(...); // somewhere else
How can i make this work for multiple dm zones?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)