My Script-Addons for Godfather (some changes and other gamemodes will also work)
#3



Code:
Paintball with fog & different weapons
I changed the paintball system of the Gamemode..
Now you can start paintball (as owner) with /startpaintball.
You can choose different weapons with /paintballweapon
And you can turn on/off the fog machines with /paintballfog


new PaintballWeapon = 29;
new pb1, pb2, pb3, pb4, pb5, pb6, pb7, pb8, pb9, pb10, pb11, pb12, pb13, pb14, PaintballLights;


Code:
 	if(strcmp(cmd,"/startpaintball",true)==0)
	{
	  if(IsPlayerConnected(playerid) && PlayerInfo[playerid][pPbiskey] == 110)
	  {
			if(PaintballRound != 1 && StartingPaintballRound != 1)
			{
				StartingPaintballRound = 1;
	 			SetTimer("PreparePaintball", 25000, 0);
			}
		}
		else
		{
		  SendClientMessage(playerid, COLOR_GRAD2,"You are not the Paintball owner!");
		}
		return 1;
	}

	if (strcmp(cmd, "/paintballweapon", true) == 0)
	{
	  if(IsPlayerConnected(playerid) && PlayerInfo[playerid][pPbiskey] == 110)
		{
			new gunid[16];
			tmp = strtok(cmdtext, idx);
			if(!strlen(tmp))
			{
				format(string, sizeof(string), "USAGE: /paintballweapon [weapon]");
				SendClientMessage(playerid, COLOR_GRAD2, string);
				SendClientMessage(playerid, COLOR_GRAD2, "Available weapons: mp5, m4, shotgun, deagle, sniper");
				return 1;
			}
			strmid(gunid, tmp, 0, strlen(cmdtext), 255);
			if(strcmp(gunid, "mp5", true, strlen(gunid)) == 0)
			{
				SendClientMessage(playerid, COLOR_GRAD6, "New Weapon: mp5");
				PaintballWeapon = 29;
			}
			if(strcmp(gunid, "m4", true, strlen(gunid)) == 0)
			{
				SendClientMessage(playerid, COLOR_GRAD6, "New Weapon: m4");
				PaintballWeapon = 31;
			}
			if(strcmp(gunid, "shotgun", true, strlen(gunid)) == 0)
			{
				SendClientMessage(playerid, COLOR_GRAD6, "New Weapon: shotgun");
				PaintballWeapon = 25;
			}
			if(strcmp(gunid, "deagle", true, strlen(gunid)) == 0)
			{
				SendClientMessage(playerid, COLOR_GRAD6, "New Weapon: deagle");
				PaintballWeapon = 24;
			}
			if(strcmp(gunid, "sniper", true, strlen(gunid)) == 0)
			{
				SendClientMessage(playerid, COLOR_GRAD6, "New Weapon: sniper");
				PaintballWeapon = 34;
			}
		}
		return 1;
	}

	if(strcmp(cmd, "/paintballfog", true) == 0)
	{
	  if(IsPlayerConnected(playerid) && PlayerInfo[playerid][pPbiskey] == 110)
	  {
			tmp = strtok(cmdtext, idx);
			if(!strlen(tmp))
			{
				SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /paintballfog [on/off (1/0)])");
				return 1;
			}
			new lights;
			lights = strval(tmp);
			if(lights == 0) { PaintballLights = 0; SendClientMessage(playerid, COLOR_GRAD2, "Lights deactivated"); }
			else { PaintballLights = 1; SendClientMessage(playerid, COLOR_GRAD2, "Lights activated"); }
		}
		return 1;
	}
Code:
public PreparePaintball()
{
	SBizzInfo[10][sbLocked] = 1;
  for(new i = 0; i < MAX_PLAYERS; i++)
	{
	  if(IsPlayerConnected(i))
	  {
	    if(PlayerPaintballing[i] != 0)
	    {
	      SendClientMessage(i, COLOR_YELLOW, "Paintball Match will start in 20 seconds.");
	    }
		}
	}
	if(PaintballLights == 1)
	{
	  pb1 = CreateStreamObject(2780, -424.4894,2244.1006,41.0297, 0.0, 0.0, 0.0, 200.0); //nebelwerfer
	  pb2 = CreateStreamObject(2780, -444.2784,2229.9668,41.0297, 0.0, 0.0, 0.0, 200.0);
	  pb3 = CreateStreamObject(2780, -412.7010,2236.1665,41.0297, 0.0, 0.0, 0.0, 200.0);
	  pb4 = CreateStreamObject(2780, -395.0357,2222.0054,41.0297, 0.0, 0.0, 0.0, 200.0);
	  pb5 = CreateStreamObject(2780, -391.2655,2245.9839,41.0864, 0.0, 0.0, 0.0, 200.0);
	  pb6 = CreateStreamObject(2780, -379.0988,2250.5029,41.0847, 0.0, 0.0, 0.0, 200.0);
	  pb7 = CreateStreamObject(2780, -372.8440,2231.3389,41.0844, 0.0, 0.0, 0.0, 200.0);
	  pb8 = CreateStreamObject(2780, -355.1347,2210.4773,41.0844, 0.0, 0.0, 0.0, 200.0);
	  pb9 = CreateStreamObject(2780, -379.2328,2213.9641,41.0937, 0.0, 0.0, 0.0, 200.0);
	  pb10 = CreateStreamObject(2780, -379.0988,2250.5029,40.8847, 0.0, 0.0, 0.0, 200.0);
	  pb11 = CreateStreamObject(2780, -360.6726,2246.6438,41.0844, 0.0, 0.0, 0.0, 200.0);
	  pb12 = CreateStreamObject(2780, -416.7401,2199.7825,41.0297, 0.0, 0.0, 0.0, 200.0);
	  pb13 = CreateStreamObject(2780, -435.0857,2211.9426,41.0297, 0.0, 0.0, 0.0, 200.0);
	  pb14 = CreateStreamObject(2780, -399.0452,2264.4978,40.4586, 0.0, 0.0, 0.0, 200.0);
	}
 	SetTimer("StartPaintball", 20000, 0);
	return 1;
}
public StartPaintball()
{
	
	PaintballRound = 1;
	StartingPaintballRound = 0;
	PaintballWinner = 999;
	PaintballWinnerKills = 0;
	for(new i = 0; i < MAX_PLAYERS; i++)
	{
	  if(IsPlayerConnected(i))
	  {
	    if(PlayerPaintballing[i] != 0)
	    {
	      ResetPlayerWeapons(i);
	      GivePlayerWeapon(i, PaintballWeapon, 10000);
	      TogglePlayerControllable(i, 1);
	      SetPlayerArmour(i, 0);
	      SetPlayerHealth(i, 100);
	      SendClientMessage(i, COLOR_YELLOW, "Paintball Match started, 8 minutes left.");
	      PlayerPlaySound(i, 1057, 0.0, 0.0, 0.0);
	    }
	  }
	}
	SetTimer("PaintballEnded", 480000, 0);
	return 1;
}

public PaintballEnded()
{
	new string[256];
	new name[MAX_PLAYER_NAME];
  for(new i = 0; i < MAX_PLAYERS; i++)
	{
	  if(IsPlayerConnected(i))
	  {
	    if(PlayerPaintballing[i] != 0)
	    {
	      if(IsPlayerConnected(PaintballWinner))
	      {
	        GetPlayerName(PaintballWinner, name, sizeof(name));
	        format(string,sizeof(string), "** %s won the Paintball Match with %d kills **",name,PaintballWinnerKills);
	        SendClientMessage(i, COLOR_WHITE, string);
	      }
	      ResetPlayerWeapons(i);
	      PlayerPaintballing[i] = 0;
	      PlayerPaintballKills[i] = 0;
	      SetPlayerPos(i, SBizzInfo[10][sbEntranceX],SBizzInfo[10][sbEntranceY],SBizzInfo[10][sbEntranceZ]);
	    }
		}
	}
	AnnouncedPaintballRound = 0;
  PaintballRound = 0;
  if(PaintballLights == 1)
  {
		DestroyStreamObject(pb1); DestroyStreamObject(pb2); DestroyStreamObject(pb3);
		DestroyStreamObject(pb4); DestroyStreamObject(pb5); DestroyStreamObject(pb6);
		DestroyStreamObject(pb7); DestroyStreamObject(pb8); DestroyStreamObject(pb9);
		DestroyStreamObject(pb10); DestroyStreamObject(pb11); DestroyStreamObject(pb12);
		DestroyStreamObject(pb13); DestroyStreamObject(pb14);
  }
	return 1;
}
In SetPlayerSpawn delete the old paintball spawn

Code:
		if(PlayerPaintballing[playerid] != 0)
		{
		  ResetPlayerWeapons(playerid);
   		GivePlayerWeapon(playerid, PaintballWeapon, 999);
   		SetPlayerHealth(playerid, 100);
   		SetPlayerArmour(playerid, 0);
		  rand = random(sizeof(PaintballSpawns));
			SetPlayerPos(playerid, PaintballSpawns[rand][0], PaintballSpawns[rand][1], PaintballSpawns[rand][2]);
		  return 1;
		}

Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)