Help me please
#1

HELLO!
I made a SAMP SERVER FOR THE METHOD OF COUNTER-STRIKE BUT AM LESS NEED HELP! Only if you are pretty good in the script!!
I want to know if I put a TEXT DRAW Somewhere in the corner of the screen showing how many people died AND HOW TO COUNTER THE TERRORIST!
EXAMPLE: to put something gTeam the public OnPlayerDeath (playerid, killerid, reason) and put a team if terrorists killed automatically grow 1 to counter!! similar clock on the server
Can you help? plizz answer!

I put it on GM! please if possible can you put here?
Код:
#include <a_samp>

// This is a comment
// uncomment the line below if you want to write a filterscript
//#define FILTERSCRIPT


#define COLOR_GREY 0xAFAFAFAA
#define COLOR_BLUE 0x95DFECFF
#define COLOR_RED 0xFF6A6AFF
#define COLOR_DIS_RED 0xFF0000FF
#define COLOR_CON_GREEN 0x00FF00FF
#define COLOR_WHITE 0xFFFFFFFF
#define COLOR_GREEN 0x33AA33AA
#define TEAM_TERRORIST 0
#define TEAM_COUNTER-TERRORIST 1

new Text:Time;
new DMTime;

static gTeam[MAX_PLAYERS];
new gPlayerClass[MAX_PLAYERS];

forward DMTimer(playerid);
forward ExitTheGameMode();
main()
{
	print("\n----------------------------------");
	print(" Fy_ISLAND");
	print("----------------------------------\n");
}

public OnGameModeInit()
{
SetGameModeText("FY_ISLAND2");
SetTeamCount(2);
ShowNameTags(1);
ShowPlayerMarkers(1);
SetWorldTime(12);
SetWeather(0);
UsePlayerPedAnims();
DMTime = 600;
SetTimer("DMTimer", 999, 1);

AddPlayerClass(122,4123.687500,-1796.568359,20.953302,267.0468,30,330,24,333,27,440); // T-Spawn
AddPlayerClass(285,4110.012695,-2191.723144,16.816013,95.6678,31,330,22,333,27,440); // CT-Spawn

CreateObject(4847, 4044.329834, -1956.134277, 7.150619, 0.0000, 0.0000, 0.0000);
CreateObject(4847, 4046.480713, -2157.919922, 6.550389, 0.0000, 0.0000, 180.0000);
CreateObject(17026, 4226.355957, -1937.719604, 10.621250, 0.0000, 0.0000, 135.5317);
CreateObject(17026, 4226.263672, -1981.062622, 4.778326, 344.5301, 357.4217, 144.1261);
CreateObject(17026, 4232.819824, -2025.158691, 0.630713, 0.0000, 0.0000, 135.5317);
CreateObject(17026, 4230.580078, -2068.560791, -1.290023, 0.0000, 0.0000, 135.5317);
CreateObject(17026, 4231.225586, -2113.794678, -2.405209, 9.4538, 0.0000, 135.5317);
CreateObject(17026, 4234.042969, -2148.920898, 4.589685, 17.1887, 2.5783, 158.0317);
CreateObject(17026, 4233.770996, -2189.588623, 9.371040, 17.1887, 2.5783, 135.5317);
CreateObject(18226, 4180.995605, -2216.711182, 24.780561, 0.0000, 338.5141, 244.9991);
CreateObject(18226, 4101.991211, -2223.707520, 19.411463, 0.0000, 338.5141, 244.9991);
CreateObject(18226, 4018.204834, -2227.012451, 17.005550, 0.0000, 338.5141, 244.9991);
CreateObject(18226, 3935.727051, -2228.913818, 14.605568, 0.0000, 338.5141, 244.9991);
CreateObject(18226, 3870.889160, -2215.099609, 21.255550, 0.0000, 338.5141, 222.4990);
CreateObject(17026, 3871.431641, -2171.743652, 8.894635, 0.0000, 17.1887, 144.1261);
CreateObject(17026, 3868.138916, -2119.888916, -1.326066, 0.0000, 6.8755, 152.7205);
CreateObject(17026, 3863.083008, -2074.710205, -1.190938, 0.0000, 6.8755, 152.7205);
CreateObject(17026, 3863.345947, -2034.538574, -1.274486, 0.0000, 6.8755, 147.5639);
CreateObject(17026, 3864.198975, -1991.996826, -1.528839, 0.0000, 0.0000, 141.5478);
CreateObject(17026, 3863.498535, -1947.035400, 5.562697, 0.0000, 351.4056, 140.6884);
CreateObject(896, 3865.076416, -1915.260498, 19.865637, 0.0000, 0.0000, 337.5000);
CreateObject(791, 4181.376953, -2158.179443, 5.156118, 0.0000, 0.0000, 0.0000);
CreateObject(791, 4180.868164, -2137.035400, -2.861555, 0.0000, 0.0000, 0.0000);
CreateObject(791, 4150.188965, -2171.243652, 8.527004, 0.0000, 0.0000, 0.0000);
CreateObject(791, 4140.398438, -2137.313232, -0.852477, 0.0000, 0.0000, 0.0000);
CreateObject(791, 4097.605957, -2129.566650, -3.020862, 0.0000, 0.0000, 0.0000);
CreateObject(791, 4033.260742, -2148.431396, -1.476789, 0.0000, 0.0000, 0.0000);
CreateObject(791, 3974.407959, -2141.497803, -1.169231, 0.0000, 0.0000, 0.0000);
CreateObject(791, 3928.875488, -2170.042480, 7.597763, 0.0000, 0.0000, 0.0000);
CreateObject(791, 3924.514893, -2136.186279, -3.503545, 0.0000, 0.0000, 0.0000);
CreateObject(791, 4089.663086, -2158.253418, 4.712389, 0.0000, 0.0000, 0.0000);
CreateObject(791, 4064.407715, -2132.200684, -2.959343, 0.0000, 0.0000, 0.0000);
CreateObject(791, 3995.673584, -2177.577393, 8.264608, 0.0000, 0.0000, 0.0000);
CreateObject(791, 4008.217529, -2134.565430, -2.987739, 0.0000, 0.0000, 0.0000);
CreateObject(10828, 4034.291992, -2108.037598, -1.415606, 0.0000, 0.0000, 270.0000);
CreateObject(10828, 4034.345215, -2074.363525, -1.384747, 0.0000, 0.0000, 270.0000);
CreateObject(10828, 4034.369873, -2040.769409, -1.011434, 0.0000, 0.0000, 270.0000);
CreateObject(10828, 4034.444580, -2007.377808, -1.011397, 0.0000, 0.0000, 270.0000);
CreateObject(9958, 3971.032959, -2092.580811, 5.494321, 0.0000, 0.0000, 90.0000);
CreateObject(9958, 3972.746338, -2062.192627, 5.271475, 0.0000, 0.0000, 90.0000);
CreateObject(10230, 4135.831543, -2056.579834, 7.201506, 0.0000, 0.0000, 180.0000);
CreateObject(10229, 4136.142578, -2055.294678, 5.919454, 0.0000, 0.0000, 180.0000);
CreateObject(10140, 4121.120117, -2055.534424, 7.255512, 0.0000, 0.0000, 180.0000);
CreateObject(10226, 4091.571777, -2056.896240, 8.808491, 0.0000, 0.0000, 189.0761);
CreateObject(9245, 3925.264893, -1988.410400, 11.090734, 0.0000, 0.0000, 0.0000);
CreateObject(1461, 4035.486816, -1991.538574, 2.949013, 0.0000, 0.0000, 270.0000);
CreateObject(3279, 3920.930908, -1987.453857, 4.299163, 0.0000, 0.0000, 90.0000);
CreateObject(3279, 4199.305176, -1989.857056, 1.330736, 0.0000, 0.0000, 93.9193);
CreateObject(3885, 3920.428711, -1955.497559, 9.680905, 0.0000, 0.0000, 337.5000);
CreateObject(3885, 3929.930420, -1955.801392, 9.738517, 0.0000, 0.0000, 337.5000);
CreateObject(16093, 3888.528564, -1922.925049, 16.247093, 0.0000, 0.0000, 358.3585);
CreateObject(16093, 3899.265137, -1923.666504, 16.247082, 0.0000, 0.0000, 358.3585);
CreateObject(16093, 3909.875977, -1924.221558, 16.197090, 0.0000, 0.0000, 358.3585);
CreateObject(791, 4180.916016, -1957.636719, 3.708058, 0.0000, 0.0000, 0.0000);
CreateObject(791, 3906.111328, -1937.282471, 10.684977, 0.0000, 0.0000, 0.0000);
CreateObject(791, 3896.537598, -1975.433594, 0.305133, 0.0000, 0.0000, 0.0000);
CreateObject(791, 3959.660400, -1967.849243, 1.842071, 0.0000, 0.0000, 0.0000);
CreateObject(791, 3962.667969, -1922.246948, 12.010956, 0.0000, 0.0000, 0.0000);
CreateObject(791, 4002.802490, -1936.713867, 9.265400, 0.0000, 0.0000, 0.0000);
CreateObject(791, 4068.517822, -1919.623291, 13.561008, 0.0000, 0.0000, 0.0000);
CreateObject(791, 4087.111328, -1962.638672, 3.627613, 0.0000, 0.0000, 0.0000);
CreateObject(791, 4041.831299, -1957.864990, 4.819653, 0.0000, 0.0000, 0.0000);
CreateObject(791, 4138.039551, -1929.767944, 10.300917, 0.0000, 0.0000, 0.0000);
CreateObject(791, 4138.042969, -1966.180298, 2.995664, 0.0000, 0.0000, 0.0000);
CreateObject(17026, 3885.445068, -1904.476929, 13.771278, 0.0000, 6.8755, 62.7205);
CreateObject(17026, 3930.945801, -1902.097656, 12.821270, 0.0000, 6.8755, 62.7205);
CreateObject(17026, 4192.222656, -1913.537598, 13.971237, 0.0000, 6.8755, 62.7205);
CreateObject(8148, 4154.412598, -1907.088623, 18.892281, 0.0000, 0.0000, 270.0000);
CreateObject(8148, 3968.436279, -1906.826050, 19.225691, 0.0000, 0.0000, 270.0000);
CreateObject(973, 4064.915283, -1906.222168, 17.264879, 0.0000, 0.0000, 0.0000);
CreateObject(973, 4055.589600, -1906.227295, 17.264879, 0.0000, 0.0000, 0.0000);
CreateObject(973, 4052.439941, -1906.220825, 17.253750, 0.0000, 0.0000, 0.0000);
CreateObject(8148, 4160.104492, -1819.683838, 19.525686, 0.0000, 0.0000, 0.0000);
CreateObject(4867, 4065.480469, -1815.017334, 16.346157, 0.0000, 0.0000, 0.0000);
CreateObject(8210, 4160.568359, -1879.424194, 19.447184, 0.0000, 0.0000, 270.0000);
CreateObject(8210, 4160.503418, -1711.178589, 19.447182, 0.0000, 0.0000, 270.0000);
CreateObject(8150, 4097.165527, -1726.053711, 19.447186, 0.0000, 0.0000, 0.0000);
CreateObject(8210, 4006.388428, -1725.520020, 19.172188, 0.0000, 0.0000, 0.0000);
CreateObject(8149, 3977.067871, -1835.272095, 19.447184, 0.0000, 0.0000, 0.0000);
CreateObject(8210, 3981.384521, -1730.223145, 19.447184, 0.0000, 0.0000, 81.4057);
CreateObject(11088, 4130.210938, -1770.258301, 23.103041, 0.0000, 0.0000, 168.7500);
CreateObject(11428, 4096.372559, -1749.743652, 22.249626, 0.0000, 0.0000, 303.7500);
CreateObject(12805, 4025.618896, -1753.747192, 30.172388, 0.0000, 0.0000, 180.0000);
CreateObject(16364, 4061.707031, -2015.782715, 2.899456, 0.0000, 359.1406, 90.0000);
CreateObject(967, 4071.254883, -1902.978882, 16.346157, 0.0000, 0.0000, 90.0000);
CreateObject(967, 4047.683594, -1903.056641, 16.346157, 0.0000, 0.0000, 270.0000);
CreateObject(5132, 4140.030762, -1772.619751, 19.346724, 0.0000, 0.0000, 258.7500);
CreateObject(5259, 4146.062500, -1747.780151, 19.259817, 0.0000, 0.0000, 0.0000);
CreateObject(7025, 3990.017090, -1825.137085, 19.773937, 0.0000, 0.0000, 0.0000);
CreateObject(7025, 3990.380371, -1814.859863, 19.773937, 0.0000, 0.0000, 0.0000);
CreateObject(7102, 4123.950195, -1840.305908, 19.773922, 0.0000, 0.0000, 270.0000);
CreateObject(7515, 4142.184082, -2055.198242, 12.326448, 0.0000, 0.0000, 0.0000);
CreateObject(5259, 4108.145508, -2049.749023, 8.216736, 0.0000, 0.0000, 0.0000);
CreateObject(8886, 4107.771973, -2060.289307, 9.769702, 0.0000, 0.0000, 270.0000);
CreateObject(3214, 3994.082275, -1802.127075, 25.335693, 0.0000, 0.0000, 90.0000);
CreateObject(3255, 3986.263672, -1849.318481, 17.326157, 0.0000, 0.0000, 0.0000);
CreateObject(3256, 4108.405762, -1768.671021, 18.028511, 0.0000, 0.0000, 0.0000);
CreateObject(3257, 4033.604248, -1808.064453, 16.421638, 0.0000, 0.0000, 303.7500);
CreateObject(3287, 4018.156982, -1843.171631, 21.085203, 0.0000, 0.0000, 0.0000);
CreateObject(3287, 4024.914551, -1843.118652, 21.085203, 0.0000, 0.0000, 0.0000);
CreateObject(3287, 4031.246582, -1843.200439, 21.085203, 0.0000, 0.0000, 0.0000);
CreateObject(3287, 4031.231201, -1852.102661, 21.085203, 0.0000, 0.0000, 0.0000);
CreateObject(3287, 4024.706055, -1852.333374, 21.085203, 0.0000, 0.0000, 0.0000);
CreateObject(3287, 4018.082764, -1852.521973, 21.085203, 0.0000, 0.0000, 0.0000);
CreateObject(3427, 4089.643555, -1778.377686, 16.652445, 0.0000, 0.0000, 0.0000);
CreateObject(3631, 4134.308105, -1796.296509, 17.142275, 0.0000, 0.0000, 78.7500);
CreateObject(3631, 4132.354492, -1795.922485, 17.142275, 0.0000, 0.0000, 78.7500);
CreateObject(3631, 4133.732422, -1796.185669, 18.225069, 0.0000, 0.0000, 78.7500);
CreateObject(3636, 4133.514648, -1862.696167, 23.723005, 0.0000, 0.0000, 168.7500);
CreateObject(3637, 4120.589355, -1805.803467, 24.432274, 0.0000, 0.0000, 180.0000);
CreateObject(3673, 4120.506348, -1890.407837, 40.346603, 0.0000, 0.0000, 180.0000);
CreateObject(3675, 4125.301758, -1877.889526, 18.677357, 0.0000, 96.2569, 247.8185);
CreateObject(3675, 4125.618164, -1884.025269, 18.652361, 0.0000, 96.2569, 61.7250);
CreateObject(6928, 4067.439209, -1816.976440, 40.191120, 0.0000, 0.0000, 0.0000);
CreateObject(12986, 4020.466553, -1826.490601, 17.868788, 0.0000, 0.0000, 270.0000);
CreateObject(16076, 4107.599609, -1842.467529, 21.034111, 0.0000, 0.0000, 270.0000);
CreateObject(960, 4072.960693, -1842.154297, 16.727947, 0.0000, 0.0000, 0.0000);
CreateObject(960, 4070.317139, -1840.500488, 16.727947, 0.0000, 0.0000, 0.0000);
CreateObject(960, 4070.281494, -1842.387695, 16.727947, 0.0000, 0.0000, 0.0000);
CreateObject(960, 4072.278076, -1846.401733, 16.727947, 0.0000, 0.0000, 0.0000);
CreateObject(960, 4074.798584, -1844.170654, 16.727947, 0.0000, 0.0000, 0.0000);
CreateObject(960, 4073.710205, -1838.907227, 16.727947, 0.0000, 0.0000, 0.0000);
CreateObject(5291, 4019.095947, -1890.825195, 24.564371, 0.0000, 0.0000, 281.2500);

return 1;
}

public OnGameModeExit()
{
	return 1;
}

TimeConvert(seconds) {
new tmp[256];
new minutes = floatround(seconds/60);
seconds -= minutes*60;
format(tmp, sizeof(tmp), "%d:%02d", minutes, seconds);
return tmp;
}

public OnPlayerRequestClass(playerid, classid)
{

    SetPlayerClass(playerid, classid);
    gPlayerClass[playerid] = classid;
    ResetPlayerMoney(playerid);

    switch (classid)
		{
      case 0:
         {
         GameTextForPlayer(playerid, "~n~~n~~n~~r~TERRORIST / DEFENCE", 500, 3);

         SetPlayerPos(playerid, 4091.819580,-2055.213378,19.287443);
	       SetPlayerFacingAngle(playerid, 90.0);
	       SetPlayerCameraPos(playerid, 4089.819580,-2055.213378,19.287443);
      	 SetPlayerCameraLookAt(playerid, 4091.819580,-2055.213378,19.287443);
         }
      case 1:
         {
         GameTextForPlayer(playerid, "~n~~n~~n~~b~COUNTER-TERRORIST / ATTACKERS", 500, 3);

         SetPlayerPos(playerid, 4091.819580,-2055.213378,19.287443);
	       SetPlayerFacingAngle(playerid, 90.0);
	       SetPlayerCameraPos(playerid, 4089.819580,-2055.213378,19.287443);
      	 SetPlayerCameraLookAt(playerid, 4091.819580,-2055.213378,19.287443);
         }
}
    return 1;
}

SetPlayerClass(playerid, classid) {
if(classid == 0 ) {
gTeam[playerid] = TEAM_TERRORIST;
} else if(classid == 1 ) {
gTeam[playerid] = TEAM_COUNTER-TERRORIST;
}
}

public OnPlayerRequestSpawn(playerid)
{
	return 1;
}

public OnPlayerConnect(playerid)
{
  SetPlayerColor(playerid, COLOR_GREY); // Set the player's color to inactive
	return 1;
}

public OnPlayerDisconnect(playerid, reason)
{
	return 1;
}

public OnPlayerSpawn(playerid)
{
  SetPlayerInterior(playerid,0);
  if(gTeam[playerid] == TEAM_TERRORIST) {
  SetPlayerColor(playerid,COLOR_RED);
	SetPlayerHealth(playerid,100);
	SetPlayerArmour(playerid,50);
	GivePlayerWeapon(playerid, 16, 10);
  }
  else if(gTeam[playerid] == TEAM_COUNTER-TERRORIST) {
  SetPlayerColor(playerid,COLOR_BLUE);
  SetPlayerHealth(playerid,100);
  SetPlayerArmour(playerid,50);
  GivePlayerWeapon(playerid, 16, 10);
  }
  return 1;
}

public OnPlayerDeath(playerid, killerid, reason)
{
  SendDeathMessage(killerid, playerid, reason);
  ResetPlayerWeapons(playerid);
  GivePlayerMoney(killerid, 1000);
  GivePlayerMoney(playerid, -1000);
  SetPlayerScore(killerid,GetPlayerScore(killerid)+1);
	return 1;
}
forward spawn(playerid);
public spawn(playerid)
{
TogglePlayerSpectating(playerid, 0);
}

public OnVehicleSpawn(vehicleid)
{
	return 1;
}

public OnVehicleDeath(vehicleid, killerid)
{
	return 1;
}

public OnPlayerText(playerid, text[])
{
	return 1;
}

public OnPlayerPrivmsg(playerid, recieverid, text[])
{
	return 1;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
	if (strcmp("/mycommand", cmdtext, true, 10) == 0)
	{
		// Do something here
		return 1;
	}
	return 0;
}

public OnPlayerInfoChange(playerid)
{
	return 1;
}

public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
	return 1;
}

public OnPlayerExitVehicle(playerid, vehicleid)
{
	return 1;
}

public OnPlayerStateChange(playerid, newstate, oldstate)
{
	return 1;
}

public OnPlayerEnterCheckpoint(playerid)
{
	return 1;
}

public OnPlayerLeaveCheckpoint(playerid)
{
	return 1;
}

public OnPlayerEnterRaceCheckpoint(playerid)
{
	return 1;
}

public OnPlayerLeaveRaceCheckpoint(playerid)
{
	return 1;
}

public OnRconCommand(cmd[])
{
	return 1;
}

public OnObjectMoved(objectid)
{
	return 1;
}

public OnPlayerObjectMoved(playerid, objectid)
{
	return 1;
}

public OnPlayerPickUpPickup(playerid, pickupid)
{
	return 1;
}

public OnPlayerSelectedMenuRow(playerid, row)
{
	return 1;
}

public OnPlayerExitedMenu(playerid)
{
	return 1;
}
public DMTimer()
{
  DMTime --;
  new tmp[256];
  TextDrawDestroy(Text:Time);
  format(tmp, sizeof tmp, "%s", TimeConvert(DMTime));

  Time = TextDrawCreate(300.0, 10.0, tmp);
  TextDrawUseBox(Text:Time, 1);
  TextDrawTextSize(Text:Time, 350.0, 30.0);
  TextDrawSetShadow(Text:Time, 0);
  TextDrawSetOutline(Text:Time, 1);
  TextDrawShowForAll(Text:Time);

  if (DMTime == 0)
  {
  for( new playerid = 0; playerid < MAX_PLAYERS; playerid ++ )
  {
  TogglePlayerControllable(playerid, 0);
  }
  GameTextForAll("~g~ The round is over!", 3000, 5);
  SetTimer("ExitTheGameMode", 8000, 0);
  }
  return 1;
}
public ExitTheGameMode()
{
    SendRconCommand("gmx");
}
Thanks

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)