[HELP] Capture the point - 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: [HELP] Capture the point (
/showthread.php?tid=126073)
[HELP] Capture the point -
Flake. - 06.02.2010
my script has 3 teams
TEAM_Rumania
TEAM_USA
TEAM_Rusia and i want to make a capture the checkpoint thing so when the player from any of those teams enters they need to stay in there for 5 seconds then it adds +1 to there team score that i wanted to be displayed via textdraw on the screen always updating and when the limit of 3 wins has been the gamemode changes to the next gamemode
can anyone help please
Re: [HELP] Capture the point -
Flake. - 06.02.2010
Bump, anyone?
Re: [HELP] Capture the point -
BlackFoX - 06.02.2010
pawn Code:
new playa_time[MAX_PLAYERS]; // Time for Player
SetTimer("player_timer",1000,1); // Add this to OnGameModeInit
// Example...
public player_timer()
{
for(new i = 0;i<MAX_PLAYERS;i++)
{
if(!IsPlayerConnected(i) || IsPlayerNPC(i) || !IsPlayerInRangeOfPoint(i,Rad,X,Y,Z) || playa_time[i]>=5){playa_time[i] = 0;continue;} // Reset Time and Continue
new _send[32]; // String Array
playa_time[i]++; // Count Up Timer
format(_send,sizeof _send,"Stay here %d Sec.",5-playa_time[i]); // Format Message
GameTextForPlayer(i,_send,1000,3); // Show Message
if(playa_time[i]>=5)
{
// Do Something...
}
}
return 1;
}