05.11.2015, 15:22
(
Последний раз редактировалось jeffery30162; 05.11.2015 в 16:06.
)
Put this at top of script: these are the global values:
these are the textdraws:
timer:
this is the timer:
basically, set the timer to run infinite for 1 second. Every time the timer runs It is counted. You want to run the game for 5 minutes, which is 300 seconds. so the timer will run 300 times. When it runs 300 times it will stop the timer. You also wanted a textdraw to show for all at 4:50, so 300 seconds - 10 seconds = 290 seconds. When the timer reaches that 290 it will compare the number of kills each team has then set the textdraw to the winning teams text, then it will display the textdraw.
Hope this helped, was unable to test, kinda threw this together becuase Im currently in a physics class.
ugh the samp website was down again......... sorry it took so long
Код:
new Text:greenheader; new Text:blueheader; new Text:greenkills; new Text:bluekills; new greenkillcount; new bluekillcount; new gametimer; new gametimeint; new Text:winner;
Код:
greenheader = TextDrawCreate(515,280,"HOBO :");// blueheader = TextDrawCreate(515,320,"CLOWN :");// greenkills = TextDrawCreate(515,300," ");// bluekills = TextDrawCreate(515,340," ");// winner = TextDrawCreate(x,y,"");// Replace values with whatever
Код:
gametimer = SetTimer("TextDrawUpdate",1000,true); //1 second timer
Код:
forward TextDrawUpdate(); public TextDrawUpdate() { if(gametimeint==300) // 300 seconds in 5 minutes { gametimeint=0; KillTimer(gametimer); } else { gametimeint++; // adds 1 every time the timer runs if(gametimeint==290) // 290 seconds = 4:50 { if(greenkillcount>bluekillcount){TextDrawSetString(winner,"The Winner Is The Green Team");} if(greenkillcount<bluekillcount){TextDrawSetString(winner,"The Winner Is The Blue Team");} TextDrawShowForAll(winner); } new str1[50],str2[50]; //format killcounters format(str1,sizeof(str1),"%i",greenkillcount); format(str2,sizeof(str2),"%i",bluekillcount); //set the empty textdraw's TextDrawSetString(greenkills,str1); TextDrawSetString(bluekills,str2); //show textdraw here so that it will update TextDrawShowForAll(greenkills); TextDrawShowForAll(bluekills); TextDrawShowForAll(greenheader); TextDrawShowForAll(blueheader); } return 1; }
Hope this helped, was unable to test, kinda threw this together becuase Im currently in a physics class.
ugh the samp website was down again......... sorry it took so long