Territory Problem
#1

Hey I made a territory script which works fine. However there is a problem. When the command to start the war is used then everyone in the server AT THAT TIME can see it but people joining cannot. Its the same when you use the command then relog. Can anyone help me?

pawn Код:
command(startwar, playerid, params[])
{
    if( PlayerInfo[playerid][Admin] >= 2)
    {
        SetGangCheckpoint();
        GangZoneShowForAll(WepDepZone, COLOUR_GREY);
    }
    return 1;
}
Thats the command to start the war.
Reply
#2

You've got it so only Level2+ admins can see it?
Reply
#3

No, thats what level you have to be to use the command
Reply
#4

Sorry for the double post but i really need this fixed. like i said it works but when you relog the checkpoints gone along with the grey gangzone.
Reply
#5

Could you explain agian what you want ?

And post SetGangCheckpoint.
Reply
#6

Hi thanks for responding.

I want it to save when a team captures the territory. It works when you are in game, so for example I do /startwar and the checkpoint appears. Then Grove captures it and the gangzone turns green. However if I leave the game and join again it's as if the admin never done /startwar in the first place. There is not even a gangzone.

pawn Код:
stock SetGangCheckpoint()
{
    new id = random(1);
   
    switch(id)
    {
    case 0: SetCheckpointForAll(CP_WEPDEP, 883.0366, -1242.1566, 15.9840, 50) || SendClientMessageToAll(COLOUR_ALERT, "ALERT: The Weapon Depot is available for capture!" );
    }
}
(It's early in development so there is only one capture point atm)
Reply
#7

You need a flag

pawn Код:
new bool: war = false;
pawn Код:
//In your command, if you start the war
    war = true;
pawn Код:
//OnPlayerConnect
    if(war == true) {
        SetPlayerCheckpoint(...);
        GangZoneShowForPlayer(...);
    }
pawn Код:
//and whenever the war ends
    war = false;
And good luck with your mode
Reply
#8

Thanks for the response.

So if there is a capture point already on the map how could you define the current capture point for the player connecting?
Reply
#9

Just save the point in the variable

pawn Код:
new capPoint = -1; // just in invalid number
pawn Код:
stock SetGangCheckpoint()
{
    capPoint = random(1);
   
    switch(capPoint)
    {
        case 0: {
            SetCheckpointForAll(CP_WEPDEP, 883.0366, -1242.1566, 15.9840, 50);
            SendClientMessageToAll(COLOUR_ALERT, "ALERT: The Weapon Depot is available for capture!");
        }
    }
}
pawn Код:
//OnPlayerConnect
    if(capPoint != -1) {
        switch(capPoint) {
            case 0: {
                SetPlayerCheckpoint(...);
                SendClientMessage(...);
            }
        }
        GangZoneShowForPlayer(...);
    }
pawn Код:
//and whenever the war ends
    capPoint = -1
Reply
#10

pawn Код:
new bool: GreenZone = false;
pawn Код:
//OnPlayerSpawn
    if(GreenZone == true) {
        GangZoneShowForPlayer(...);
    }
pawn Код:
//Put this in where the gangzone changes to Green

GreenZone = true;
That's using Nero's idea which will work.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)