SA-MP Forums Archive
Rejoining the dm zone.. - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Rejoining the dm zone.. (/showthread.php?tid=89604)



Rejoining the dm zone.. - chaosnz - 03.08.2009

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..


Re: Rejoining the dm zone.. - yezizhu - 03.08.2009

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



Re: Rejoining the dm zone.. - chaosnz - 03.08.2009

thank-you very much yezizhu


Re: Rejoining the dm zone.. - chaosnz - 04.08.2009

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.


Re: Rejoining the dm zone.. - yezizhu - 04.08.2009

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