(Difficult Question)
#1

hi, everyone I try to script a GM with bases which can conquered! And nearly everything is running perfectly but there is one problem because I wanna make a basesystem where there is a certain time that runs down (countdown) and after this countdown the following variables will set.
pawn Код:
CONQUERED_BASE_GASSTATION = 1;// for Team 1
CONQUERED_BASE_GASSTATION = 2;// for Team 2
here my code:
pawn Код:
new CONQUERED_BASE_GASSTATION;
pawn Код:
SetTimer("BASE_CHECK", 100, true);
pawn Код:
public BASE_CHECK(BASE_CHECK_ID)
{
for(new i; i<GetMaxPlayers(); i++)
{
if(!IsPlayerInAnyVehicle(i))
{
    if(BASE_CHECK_IsPlayerInBASE(i,BASE_GASSTATION))
    {
        if(gTeam[i] == TEAM_1)
        {
            if((CONQUERED_BASE_GASSTATION==0)||(CONQUERED_BASE_GASSTATION==2))
                {
                CONQUERED_BASE_BAUPLATZ = 1;
                SendClientMessageToAll(COLOR_RED,"CONQUERED_BASE_GASSTATION by Team 1");
                Update3DTextLabelText(TEXTLABEL_GASSTATION ,COLOR_BLUE, "GASSTATION");
                }
            else if(CONQUERED_BASE_GASSTATION ==1)
                {
                SendClientMessage(i,COLOR_RED,"Already Conquered!");
                }
        }
        else if(gTeam[i] == TEAM_2)
        {
            if((CONQUERED_BASE_GASSTATION ==0)||(CONQUERED_BASE_GASSTATION ==1))
                {
                CONQUERED_BASE_GASSTATION = 2;
                SendClientMessageToAll(COLOR_RED,"CONQUERED_BASE_GASSTATION by Team 2");
                Update3DTextLabelText(TEXTLABEL_GASSTATION ,COLOR_RED, "GASSTATION");
                }
            else if(CONQUERED_BASE_GASSTATION ==2)
                {
                SendClientMessage(i,COLOR_RED,"Already Conquered!");
                }
        }
        else SendClientMessagel(i,COLOR_RED,"VIEWER Can't Conquer Bases!");
    }
    else
    {
    }
}
}
}
ok hope someone can help me
It's a basal question because if i fix this problem i think my GM is finished.
I know that isn't a simple question so i hope anyone will take a look at this
Reply
#2

hm.. maybe you give this snipped a try:
pawn Код:
public BASE_CHECK(BASE_CHECK_ID)
{
    for(new i; i<GetMaxPlayers(); i++)
    {
        if(!IsPlayerInAnyVehicle(i))
        {
            if(BASE_CHECK_IsPlayerInBASE(i,BASE_GASSTATION))
            {
                if(gTeam[i]==0) return SendClientMessagel(i,COLOR_RED,"VIEWER Can't Conquer Bases!");
                if(CONQUERED_BASE_GASSTATION==gTeam[i]) return SendClientMessage(i,COLOR_RED,"Already Conquered!");

//              CONQUERED_BASE_BAUPLATZ=gTeam[i];//der bauplatz ist nie benutzt. habs mal durch gasstation ersetzt. stimmts so?
                CONQUERED_BASE_GASSTATION=gTeam[i];
                new string[64];
                format(string,sizeof(string),"CONQUERED_BASE_GASSTATION by Team %d",gTeam[i]);
                SendClientMessageToAll(COLOR_RED,string);
                Update3DTextLabelText(TEXTLABEL_GASSTATION ,COLOR_BLUE, "GASSTATION");
                return 1;
            }
        }
    }
    return 1;
}
...and as usual, some algorithmic changes 4 free inclusive
Reply
#3

thanks for the reply
and how can i set a countdown (timer).
I'm trying to explain the scenario:
If one member or more of a team is at the certain point (like pickup or something) it will set an personal [i] Timer. Once there are no teammembers at this certain point the timer will be killed. But if one of them is still at the point during the Countdown(Timer) has count down (= 0) the global not personal Variable CONQUERED_BASE_GASSTATION will set the value of the Team like:
pawn Код:
CONQUERED_BASE_GASSTATION = 1; //here for team 1
(THE Question: How can i fix this with the timer? ) hope for replies
Reply
#4

ok i think i got what u want: a "u need to stay 10 seconds at this point to capture this base. 9 seconds left..."
i will script it in my gamemode, but i will handle it different this time, how about this idea:
the more players are staying in the CP, the faster taking over the base would be? its even easier to script instead a cunstom timer for each player imo
Reply
#5

can u explain me how i can use this or send me a pice of your script ? because i just tried it but it doesn't work lol (1 Month unsolved)
pls.
Reply
#6

babul u mean a system like battlefield? has?
Reply
#7

iam not babul but it should be like battlefield2 lol
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)