Respawn
#1

Ok,

Trying to do deathmatch's when they player dies they respawn there,

This is what I have so far,

pawn Код:
if(!strcmp(cmdtext, "/hell", true))
{
  new dname[MAX_PLAYER_NAME];
  new dstring[256];
  new helldm == 1; // The variable
  new rand = random(sizeof(BRandomSpawns));
  GetPlayerName(playerid, dname, sizeof(dname));
  format(dstring, sizeof(dstring), "%s Has Joined The DeathMatch(Ghost Town Of Hell)", dname);
  SendClientMessageToAll(0xFFFFAEFF, dstring);
  SetPlayerPos(playerid,BRandomSpawns[rand][0],BRandomSpawns[rand][1],BRandomSpawns[rand][2]);
  SetPlayerHealth(playerid, 100.00);
  SetPlayerArmour(playerid, 100.00);
  GivePlayerWeapon(playerid, 6, 500);
  GivePlayerWeapon(playerid, 26, 500);
  GivePlayerWeapon(playerid, 32, 500);
  GivePlayerWeapon(playerid, 41, 500);
  return 1;
}
@ onplayerconnect

pawn Код:
public OnPlayerConnect(playerid)
{
    helldm == 0;
    return 1;
}
@ onplayerdeath

pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
    if(helldm == 1)
    {
    SetPlayerPos(playerid,BRandomSpawns[rand][0],BRandomSpawns[rand][1],BRandomSpawns[rand][2]);
    }
    return 1;
}

I have no idea what I done wrong, any suggestions.

Also I no my
pawn Код:
new dstring[256];
the string is big but anyway.
Reply
#2

Any solutions I just can't figure it out
Reply
#3

Remember ? You die (not respawn in the start) then you are on the ground for maybe 3 seconds. but the position sets before you respawn at your start. This function needs to be at OnPlayerSpawn, not OnPlayerDeath
Reply
#4

Quote:
Originally Posted by ronyx69
Remember ? You die (not respawn in the start) then you are on the ground for maybe 3 seconds. but the position sets before you respawn at your start. This function needs to be at OnPlayerSpawn, not OnPlayerDeath
I fixed it for him via msn.
Reply
#5

Quote:
Originally Posted by Norn
Quote:
Originally Posted by ronyx69
Remember ? You die (not respawn in the start) then you are on the ground for maybe 3 seconds. but the position sets before you respawn at your start. This function needs to be at OnPlayerSpawn, not OnPlayerDeath
I fixed it for him via msn.
Hehe thnx anyways :P
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)