OnPlayerDeath spawns at login location
#1

Now when the player dies it spawns at the location I put in and the he teleports again to the location he logged in

PHP код:
public OnPlayerDeath(playeridkilleridreason)
{
    
user.priesmirti[playerid] = GetPlayerMoney(playerid);
    
GivePlayerMoney(playerid, -GetPlayerMoney(playerid));
    
user.mires[playerid] = true;
    
SetTimerEx("mire"3000false,"i"playerid);
    return 
1;

PHP код:
public mire(playerid)
{
    
user.priesmirti[playerid] = 0;
    
GivePlayerMoney(playeriduser.priesmirti[playerid]);
    
SetPlayerFacingAngle(playerid182.0350);
    
SetPlayerPos(playerid, -2664.7725,635.7092,14.4531);
    return 
1;

any help?
Reply
#2

Quote:
Originally Posted by Kevinas100
Посмотреть сообщение
Now when the player dies it spawns at the location I put in and the he teleports again to the location he logged in

PHP код:
public OnPlayerDeath(playeridkilleridreason)
{
    
user.priesmirti[playerid] = GetPlayerMoney(playerid);
    
GivePlayerMoney(playerid, -GetPlayerMoney(playerid));
    
user.mires[playerid] = true;
    
SetTimerEx("mire"3000false,"i"playerid);
    return 
1;

PHP код:
public mire(playerid)
{
    
user.priesmirti[playerid] = 0;
    
GivePlayerMoney(playeriduser.priesmirti[playerid]);
    
SetPlayerFacingAngle(playerid182.0350);
    
SetPlayerPos(playerid, -2664.7725,635.7092,14.4531);
    return 
1;

any help?
Nenaudok "mire". Poziciją nustatyti turi po OnPlayerRequestClass.

Dont use "mire". Position you can set OnPlayerRequestClass.
Reply
#3

Quote:
Originally Posted by Heress
Посмотреть сообщение
Nenaudok "mire". Poziciją nustatyti turi po OnPlayerRequestClass.
neikeičia nieko ;/
Reply
#4

ar zaidejas atsidurs ligoninėje?

After death player will be in hospital?
Reply
#5

Код:
new dead_player_skin;
new bool:player_died[MAX_PLAYERS];
new bool:healing[MAX_PLAYERS];
Код:
public OnPlayerRequestClass(playerid, classid)
{
	if(player_dead[playerid] == true)
	{
	    if(healing[playerid] != true)
	    {
	     	SetPlayerHealth(playerid, 20.0);
	     	SetTimerEx("OnPlayerGydosi", 45000, false, "i", playerid);
	     	SetSpawnInfo(playerid, 0, dead_player_skin, x, y, z, r, 0, 0, 0, 0, 0, 0);
	     	SpawnPlayer(playerid);
	     	player_dead[playerid] = false;
	     	healing[playerid] = true;
		}
		else
		{
		    KillTimer(healing[playerid]);
 		SetPlayerHealth(playerid, 20.0);
	     	SetTimerEx("OnPlayerHealing", 45000, false, "i", playerid);
	     	SetSpawnInfo(playerid, 0, dead_player_skin, x, y, z, r, 0, 0, 0, 0, 0, 0);
	     	SpawnPlayer(playerid);
	     	player_dead[playerid] = false;
	     	healing[playerid] = true;
		}
            }
	}
	return 0;
}
Код:
public OnPlayerDeath(playerid, killerid, reason)
{
	player_died[playerid] = true;
	dead_player_skin = GetPlayerSkin(playerid);
	return 1;
}
Код:
public OnPlayerHealing(playerid)
{
	SetPlayerHealth(playerid, 100.0);
	SetPlayerPos(playerid, x, y, z);
	SetPlayerFacingAngle(playerid, angle);
	SendClientMessage(playerid, LIME, "You healthy");
	healing[playerid] = false;
	return 1;
}
Čia pilnai veikianti sistema su timer ligoninėje, Jei nebus laiko gydytis tai iљmik timer, iљtrink healing[MAX_PLAYERS] ir panaikink public OnPlayerHealingi bei koordinates susiћiūrėk

This is full working system with timer in hospital, if player heals with no time, delete timer and healing[MAX_PLAYERS] also delete public OnPlayerHealing and fix coordinates
Reply
#6

Quote:
Originally Posted by ******
Посмотреть сообщение
English only here.
sorry, i will edit to english
Reply


Forum Jump:


Users browsing this thread: 4 Guest(s)