Battle Arena!

Started by Gito Baloch, Feb 28, 2020, 07:40 AM

Previous topic - Next topic

Gito Baloch

function battletimer(playerid) {
    local player = FindPlayer(playerid);
    if (!player) return;
    player.Pos = Vector(-540.772, 792.789, 195.213);
    Message(">> BATTLE AREA << " + Player.Name + " has entered the battle area (/battle)")
    player.World = 50;
}


    if (cmd == "battle") {
        MessagePlayer(">> You have to wait 3 seconds to enter in /battle area",player );
        NewTimer("battletimer", 3000, 1, player.ID)
    }

CREDITS: Alecumadalin32 modified my me ;D
Programming is the language I speak, the world I shape, and the future I code

Sebastian

Why to wait 3 seconds, but more important why so many querysql calling?  You can use only one for updating all the data.
(Won't ask why you saving player data there)

Gito Baloch

fixed. (removed saving spawnloc there.)
Programming is the language I speak, the world I shape, and the future I code

Gito Baloch

? ? ? ye u have to wait for 3seconds to enter in battle area.
Programming is the language I speak, the world I shape, and the future I code

AroliS^

#4
Have you thought about onPlayerSpawn?


battle <- array(100,false);

function battletimer(playerid) {
    local player = FindPlayer(playerid);
    if (!player) return;
    battle[ playerid ] = true;
    player.Pos = Vector(-540.772, 792.789, 195.213);
    Message(">> BATTLE AREA << " + Player.Name + " has entered the battle area (/battle)")
    player.World = 50;
}


    if (cmd == "battle") {
       if ( battle == true ) MessagePlayer(">>Your already in battle.",player);
       else
       {
            MessagePlayer(">> You have to wait 3 seconds to enter in /battle area",player );
            NewTimer("battletimer", 3000, 1, player.ID)
        }
    }

onPlayerSpawn <- function(player)
{
   if ( battle[ player.ID ] == true )
   {
       player.Pos = Vector(-540.772, 792.789, 195.213);
   }
}

Lemme love ya

Gito Baloch

Programming is the language I speak, the world I shape, and the future I code