Checkpoint problem??
#1

I made a checkpoint for my objective mode, but i want to make it where it restarts the server when the correct team touch's it.

heres my code : i want it to stop team 1 from activating it. and only team 2 to activate it.

Код:
public OnPlayerEnterCheckpoint(playerid)
{
GetPlayerTeam(playerid);
if(gTeam[playerid] == 1)
{
SendClientMessage(playerid,COLOR_GREEN, "You are the rong team!");
}
else
{
GameTextForPlayer(playerid, "|PRISONERS WIN|", 2500, 5);
return 1;
}
Reply
#2

Try this (Not Tested):

pawn Код:
public OnPlayerEnterCheckpoint(playerid)
{
if(gTeam[playerid] == FIRST_TEAM) //EX: TEAM_GREEN
{
SendClientMessage(playerid,COLOR_GREEN, "You are the rong team!");
return;
}
else if(gTeam[playerid] == SECOND_TEAM) //EX: TEAM_BLUE
{
GameTextForPlayer(playerid, "|PRISONERS WIN|", 2500, 5);
//WIN FUNCTION... (Ex:GameModeExit();
return;
}
}
Reply
#3

yeah it works, but i cant get ongamemodexit to work.
they touch it, but it doesnt restart :S
Reply
#4

Use:
pawn Код:
public OnPlayerEnterCheckpoint(playerid)
{
if(gTeam[playerid] == FIRST_TEAM) //EX: TEAM_GREEN
{
SendClientMessage(playerid,COLOR_GREEN, "You are the rong team!");
return;
}
else if(gTeam[playerid] == SECOND_TEAM) //EX: TEAM_BLUE
{
GameTextForPlayer(playerid, "|PRISONERS WIN|", 2500, 5);
GameModeExit();
return;
}
}
Reply
#5

it works, i didnt put it in the right place, :P

One more question, How do it when a player dies, they are frozen, and then when all the teams players are frozen they loose?

like.. all of team a's players are frozen, team b wins the round!
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)