Ok, so it got it to at least start one match, having a problem setting the area when the player dies. This was my last attempt. Ive already tried using the function onPlayerDies() as well, instead of the player.hp part, neither worked at all. Any obvious thing Im missing?
PHP Code:
function onCreated() {
this.setshape(1, 32, 32);
}
function onActionWarpPlayer(pobj)
{
temp.player1 = pobj[0];
temp.player2 = pobj[1];
this.playerbattle = {player1, player2};
temp.pl1 = findplayerbycommunityname(player1);
temp.pl2 = findplayerbycommunityname(player2);
temp.dest = {"testtourny.nw", 20, 20};
pl1.setlevel2(dest[0], dest[1], dest[2]);
pl2.setlevel2(dest[0], dest[1], dest[2]);
player.chat = this.playerbattle;
}
function onActionWarpPlayert(){
temp.desta = {"testtourny.nw", 30, 30};
player.setlevel2(desta[0], desta[1], desta[2]);
}
function onActionSetMatchServer(match, vplayer, splayer) {
for (temp.i = 0; temp.i <= 10; temp.i++) {
if (match == i) makevar("this.sdematch" @ i) = {vplayer, splayer};
}
}
function onPlayerTouchsMe(){
temp.matchlist = "";
for (temp.i = 1; temp.i <= 10; temp.i ++)
{
matchlist @= "Match " @ i @ ": " @ this.(@"sdematch" @ i)[0] @ " vs. " @ this.(@"sdematch" @ i)[1] @ "#b";
}
say2(matchlist);
}
function onPlayerChats(){
if (player.account in serverr.sdeaccess)
{
if (player.chat.starts("setmatch")) {
temp.match = player.chat.tokenize()[1];
temp.vplayer = player.chat.tokenize()[2];
temp.splayer = player.chat.tokenize()[3];
triggeraction(this.x + 0.5, this.y + 0.5, "SetMatchServer", temp.match, temp.vplayer,temp.splayer);
}
if (player.chat.starts("startmatches")){
for (temp.i = 1; temp.i <= 10; temp.i++) {
this.whatmatch = {this.(@"sdematch" @ i)};
if (this.whatmatch == 0){
this.whatmatch ++;
}else{
triggeraction(this.x + 0.5, this.y + 0.5, "WarpPlayer", this.whatmatch);
}
}
}
}
}
//#CLIENTSIDE
function onCreated(){
if (player.hp <= 0){
if (player.account in this.playerbattle)
{
triggeraction(this.x + 0.5, this.y + 0.5, "WarpPlayert", "");
}
}
}