Death inside Interior -
Spectat0rDE - 05.06.2018
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;
}
Re: Death inside Interior -
jasperschellekens - 05.06.2018
Do you have any filterscripts? if so, can you post their onplayerdeath's here?
Re: Death inside Interior -
Spectat0rDE - 05.06.2018
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;
}
Re: Death inside Interior -
Spectat0rDE - 06.06.2018
Im not sure maybe it has something to do with my SetSpawnInfo. I can't really figure it out
Re: Death inside Interior -
Hunud - 06.06.2018
You have to set his VW and Interior to 0 In OnPlayerSpawn because it's called after death.
Re: Death inside Interior -
RODELA - 06.06.2018
public onplayerspawn(playerid)
PHP код:
SetPlayerVirtualWorld(playerid,0);
Try this.
Re: Death inside Interior -
Spectat0rDE - 06.06.2018
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.
Re: Death inside Interior -
RODELA - 06.06.2018
Quote:
Originally Posted by Spectat0rDE
Yes now its working fine. I thought OnPlayerDeath will call the function.
|
Glad it's working.
Re: Death inside Interior -
GTLS - 07.06.2018
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.