Death inside Interior
#1

When I enter a interior, everything is fine but when I kill myself in it and I respawn all Textdraws, Vehicles,... disappear. I have no idea why. I've set a command on death to change interior and virtual world but still not working.


Код:
ocmd:enterlspdoutside(playerid,params[])
{
	if(IsPlayerInRangeOfPoint(playerid,3,1554.9562,-1675.6578,16.1953))
	{	
	SetPlayerVirtualWorld(playerid,5);
	SetPlayerInterior(playerid,6);
	SetPlayerPos(playerid,246.783996,63.900199,1003.640625);
	}
	return 1;
}
Код:
public OnPlayerDeath(playerid, killerid, reason)
{
	SetPlayerVirtualWorld(playerid,0);
	SetPlayerInterior(playerid,0);
        return 1;
}
Reply
#2

Do you have any filterscripts? if so, can you post their onplayerdeath's here?
Reply
#3

Im not using any filterscripts. Thats my code.

Код:
public OnPlayerDeath(playerid, killerid, reason)
{

     //WANTED LEVEL STARS
    //PLAYER SUICIDE WANTED
	if(killerid == INVALID_PLAYER_ID)
	{
	    return SetPlayerWanted(playerid, 0);
	}
	//KILL PLAYER

	SetPlayerWanted(playerid, 0);
	SetPlayerWanted(killerid, pWanted[playerid] + 1);
        ResetPlayerWeapons(playerid);


	//NORMAL DEATH MESSAGE//
	GameTextForPlayer(playerid, "~r~Wasted", 5000, 2);
	SendDeathMessage(killerid,playerid,reason); //Enable Killfeed
	SendClientMessage(playerid,COLOR_RED,"You died. You will respawn immediately.");
	SetPlayerVirtualWorld(playerid,0);
	SetPlayerInterior(playerid,0);
	return 1;
}
Reply
#4

Im not sure maybe it has something to do with my SetSpawnInfo. I can't really figure it out
Reply
#5

You have to set his VW and Interior to 0 In OnPlayerSpawn because it's called after death.
Reply
#6

public onplayerspawn(playerid)

PHP код:
SetPlayerVirtualWorld(playerid,0); 
Try this.
Reply
#7

Quote:
Originally Posted by Hunud
Посмотреть сообщение
You have to set his VW and Interior to 0 In OnPlayerSpawn because it's called after death.
Quote:
Originally Posted by RODELA
Посмотреть сообщение
public onplayerspawn(playerid)

PHP код:
SetPlayerVirtualWorld(playerid,0); 
Try this.
Yes now its working fine. I thought OnPlayerDeath will call the function.
Reply
#8

Quote:
Originally Posted by Spectat0rDE
Посмотреть сообщение
Yes now its working fine. I thought OnPlayerDeath will call the function.
Glad it's working.
Reply
#9

Quote:
Originally Posted by RODELA
Посмотреть сообщение
public onplayerspawn(playerid)

PHP код:
SetPlayerVirtualWorld(playerid,0); 
Try this.
Add this under a condition that it should reset the player's VW if he has spawned from death. Otherwise if you have different interiors, it wont work for you. and all players will come to same interior due to same VW.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)