Player Death Spawn
#1

Hello again.
Ye ive got a 2. Problem....
I have got a script that saves and loads my positions when i join/Exit the Server.
And evertime ive died, it spawns me to the last Position (where ive left the Server).
Now ive edited it a Little bit but "IsPlayerDead" seems to have no function.. any help would be nice

PHP код:
new IsPlayerDeath[MAX_PLAYERS];
public 
OnPlayerSpawn(playerid)
{
    if(!
dini_Exists(FileStats(playerid)))
    {
        
SetPlayerPos(playerid,1081.1833,-1697.3507,13.5469);
        return 
1;
    }
    if(
IsPlayerDeath[playerid] == 1)
    {
        
GivePlayerMoney(playerid, -45);
        
SetPlayerPos(playerid,1172.7595,-1323.5958,15.4011);
        return 
1;
    }
    else
    
SetPlayerPos(playerid,positionx,positiony,positionz);
    return 
1;

Reply
#2

Show your OnPlayerDeath please.
Reply
#3

Theres nothing
Reply
#4

+ when ive died, it spawns me to the coordinations 0 0 0
Reply
#5

Quote:
Originally Posted by Pepino960
Посмотреть сообщение
+ when ive died, it spawns me to the coordinations 0 0 0
Then just create a callback,
pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
  SetPlayerPos(playerid, 1178.1852,-1323.3883,14.1076);
  GivePlayerMoney(playerid, -20);
  return 1;
}
Reply
#6

That wouldnt work because of the
PHP код:
SetPlayerPos(playerid,positionx,positiony,positionz); 
Reply
#7

Quote:
Originally Posted by Pepino960
Посмотреть сообщение
That wouldnt work because of the
PHP код:
SetPlayerPos(playerid,positionx,positiony,positionz); 
You stated above that after death you are spawned at 0,0,0?
Reply
#8

Umm my fault -.-'

Ive got OnPlayerSpawn above OnPlayerDeath :P
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)