[Ajuda] Morrer em Gangzone
#1

Eae galera, eu criei uma gangzone que serб o local de dm, e gostaria que quando o player morresse dentro dessa бrea ele desse respawn nessa бrea msm, o meu code:

Код:
new SpawnBloqueado;

public OnPlayerSpawn(playerid)
{
	if(SpawnBloqueado == 1)
	{
    	        new Random = random(sizeof(RandomSpawns));
                SetPlayerInterior(playerid, 0);
		SetPlayerPos(playerid, RandomSpawns[Random][0], RandomSpawns[Random][1],RandomSpawns[Random][2]);
    	        SetPlayerFacingAngle(playerid, RandomSpawns[Random][3]);
	}
	return 1;
}

public OnPlayerDeath(playerid, killerid, reason)
{
    if(IsPlayerInDM(playerid))
    {
        SpawnBloqueado[playerid] = 1;
    }
	return 1;
}

IsPlayerInDM(playerid)
{
	new Float:x,Float:y,Float:z;
    GetPlayerPos(playerid, x, y, z);
    if(x >= -484.7343 && y >= 2301.6531 && x <= -313.4499&& y <= 2176.6023) return 1;
    else return 0;
}
Reply
#2

Vocк pode fazer assim:

Код:
new bool:PlayerDM[MAX_PLAYERS]; //no topo

public OnPlayerDeath(playerid, killerid, reason)
{
    if (IsPlayerInRangeOfPoint(playerid, range, X, Y, Z)){PlayerDM[playerid] = true;}
    return 1;
}

public OnPlayerSpawn(playerid)
{
	if(PlayerDM[playerid] == true)
	{
        new Random = random(sizeof(RandomSpawns));
        SetPlayerInterior(playerid, 0);
		SetPlayerPos(playerid, RandomSpawns[Random][0], RandomSpawns[Random][1],RandomSpawns[Random][2]);
        SetPlayerFacingAngle(playerid, RandomSpawns[Random][3]);
        PlayerDM[playerid] = false;
	}
	return 1;
}
Reply
#3

Obrigado pela ajuda iTakelot, mas estб dando esse Warning:

warning 213: tag mismatch

Linha:

PlayerDM[playerid] = 1;
Reply
#4

PlayerDM[playerid] = true;
Reply
#5

iTakelot, funcionou, obrigado mano +rep
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)