Checkpoint problem?? - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Checkpoint problem?? (
/showthread.php?tid=123239)
Checkpoint problem?? -
-Rebel Son- - 24.01.2010
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;
}
Re: Checkpoint problem?? -
LuxurioN™ - 24.01.2010
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;
}
}
Re: Checkpoint problem?? -
-Rebel Son- - 24.01.2010
yeah it works, but i cant get ongamemodexit to work.
they touch it, but it doesnt restart :S
Re: Checkpoint problem?? -
LuxurioN™ - 24.01.2010
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;
}
}
Re: Checkpoint problem?? -
-Rebel Son- - 24.01.2010
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!