PDA

View Full Version : Need help with checkpoint(Area51 GM)


bhuvanesh
02/08/2012, 05:15 PM
Hello guys,
I have problem with Checkpoint in my GM.The GM has two parts break in and break out.In break in the attackers have to break into area51 base and in the break out mod the attackers have to break out from the base.

Break-In:
Skin 121 will get a checkpoint in area 51.Once he is in the checkpoint the gates of area51 are breached and the checkpoint is to be set to all the players in the team.

My Problem:
Once I enter the checkpoint to breach the gates it sets the checkpoint but only for that particular point of time once the player enter that checkpoint the checkpoint disappears and once again when I spawn with the same skin I am prompted to breach the gates again to get the checkpoint.

Script:

public OnPlayerEnterCheckpoint(playerid)
{
check=check+1;
if(GetPlayerSkin(playerid)==121)
{
GameTextForAll("~b~Gates ~w~are ~p~breached",1000,3);
MoveObject(gate1,220,1875.5999755859,13.8999996185 3,0.010);
MoveObject(gate2,207.39999389648,1875.5999755859,1 3.89999961853,0.010);
DisablePlayerCheckpoint(playerid);
gObjectiveRed=playerid;
}
if(gTeam[playerid]==Attackers)
{
for(check=0;check<=1;check++)
{
SetPlayerRaceCheckpoint(playerid,0,268.5445,1883.7 351,-30.0938,268.5445,1883.7351,-30.0938,1.3665);
}
}
}

Misiur
02/08/2012, 05:26 PM
Hey OP, I don't know what's causing your problem but look at this:
for(check=0;check<=1;check++)
{
SetPlayerRaceCheckpoint(playerid,0,268.5445,1883.7 351,-30.0938,268.5445,1883.7351,-30.0938,1.3665);
}
This piece of code looks a little retarded. What do you even need this loop for? Simply use
SetPlayerRaceCheckpoint(playerid,0,268.5445,1883.7 351,-30.0938,268.5445,1883.7351,-30.0938,1.3665);

bhuvanesh
02/08/2012, 05:37 PM
I want the Checkpoint to appear for 10 times only to Team Attackres.And once Attackers enter the check point over a 10 times attacker win else defenders win.