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


Messages In This Thread
Respawn - by Nimphious - 21.02.2009, 06:23
Re: Respawn - by Nimphious - 21.02.2009, 07:31
Re: Respawn - by ronyx69 - 21.02.2009, 08:07
Re: Respawn - by Norn - 21.02.2009, 08:08
Re: Respawn - by Nimphious - 21.02.2009, 08:14

Forum Jump:


Users browsing this thread: 2 Guest(s)