Rejoining the dm zone..
#1

Im working on setting up dm zones for my GM im working on and ive pretty much got it working fine except for when players who are in a dm zone die, they have to rejoin the dm. How can i make it so they rejoin without retyping the command?

Quote:

if(strcmp(cmdtext, "/islanddm", true)==0)
{
SetPlayerInterior(playerid, 0);
new rand = random(sizeof(gRandomPlayerSpawns));
SetPlayerPos(playerid, islanddmspawns[rand][0], islanddmspawns[rand][1], islanddmspawns[rand][2]);
SetPlayerFacingAngle(playerid, 0.0);
GivePlayerWeapon(playerid,46,1);
SendClientMessage(playerid, COLOR_BLUE, "DEATHMATCH ISLAND");
DMZone[playerid] = 1;
return 1;

Thats only what i have so far..
Reply
#2

pawn Код:
public OnPlayerSpawn(playerid){
  if(DMZone[playerid] = 1){
    OnPlayerCommandText(playerid,"/islanddm");
    return true;
  }
  return true;
}
Reply
#3

thank-you very much yezizhu
Reply
#4

i tried that and it didnt auctually work.. i also set it up with this at "onplayerspawn"

Quote:

if(DMZone[playerid] >= 1)
{
new rand = random(sizeof(islanddmspawns));
SetPlayerPos(playerid, islanddmspawns[rand][0], islanddmspawns[rand][1], islanddmspawns[rand][2]);
return 1;
}

if(DMZone[playerid] >= 2)
{
new rand = random(sizeof(planningdeptdm));
SetPlayerPos(playerid, planningdeptdm[rand][0], planningdeptdm[rand][1], planningdeptdm[rand][2]);
return 1;
}

if(DMZone[playerid] >= 3)
{
new rand = random(sizeof(flamethrowerdm));
SetPlayerPos(playerid, flamethrowerdm[rand][0], flamethrowerdm[rand][1], flamethrowerdm[rand][2]);
return 1;
}

yet that doesnt work either.

would anyone now how to get this working properly? i would appreciate any feedback on this subject.
Reply
#5

Try
pawn Код:
switch(DMZone[playerid]){
  case 0:{
    SendClientMessage(playerid,color,"no dm");
  }
  case 1:{
    //bla....
  }
  case 2:{
    //bla....
  }
  case 3:{
    //bla....
  }
}
return true;
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)