27.01.2012, 14:16
how to make when player kill in dm player spawn in dm and when type leavedm player leave dm
public OnPlayerDeath(playerid, killerid, reason)
{
if(IsPlayerInRangeOfPoint(playerid, Float:range,Float:x,Float:y,Float:z))
{
SetPlayerPos(playerid, yourpositions);
}
return 1;
}
// 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
it will not work. When a player dies he can't spawn.
pawn Код:
|