simple code doesn't shows effect
#1

This is my onplayerdeath:
Код:
public OnPlayerDeath(playerid, killerid, reason)
{
  GameTextForPlayer(playerid,"~r~Wasted",1500,0);

	if(IsInGunGame[playerid] == 1)
	{
	
	IsInGunGame[playerid] = 1;
	if(killerid != INVALID_PLAYER_ID)
	{
	new rank[MAX_PLAYERS];
	
  KillScore[killerid]++;
  
 	if(KillScore[killerid] == 2)
	{
	rank[killerid] = 1;
	ResetPlayerWeapons(killerid);
	GivePlayerWeapon(killerid,24,1000);
	SendClientMessage(killerid,COLOR_RED,"You Are On Level 1 = Desert Eagle");
	}
	else if(KillScore[killerid] == 4)
  {
	rank[killerid] = 2;
	ResetPlayerWeapons(killerid);
	GivePlayerWeapon(killerid,32,1000);
	SendClientMessage(killerid,COLOR_RED,"You Are On Level 2 = Tec 9");
	}
	else if(KillScore[killerid] == 6)
	{
	rank[killerid] = 3;
	ResetPlayerWeapons(killerid);
	GivePlayerWeapon(killerid,28,1000);
	SendClientMessage(killerid,COLOR_RED,"You Are On Level 3 = Uzi");
	}
	else if(KillScore[killerid] == 8)
	{
	rank[killerid] = 4;
	ResetPlayerWeapons(killerid);
	GivePlayerWeapon(killerid,29,1000);
	SendClientMessage(killerid,COLOR_RED,"You Are On Level 4 = SMG");
	}
	else if(KillScore[killerid] == 10)
	{
	rank[killerid] = 5;
	ResetPlayerWeapons(killerid);
	GivePlayerWeapon(killerid,30,1000);
	SendClientMessage(killerid,COLOR_RED,"You Are On Level 5 = Ak 47");
	}
	else if(KillScore[killerid] == 12)
	{
  rank[killerid] = 6;
	ResetPlayerWeapons(killerid);
	GivePlayerWeapon(killerid,33,1000);
	SendClientMessage(killerid,COLOR_RED,"You Are On Level 6 = Country Rifle");
	}
  else if(KillScore[killerid] == 14)
	{
	rank[killerid] = 7;
	ResetPlayerWeapons(killerid);
	GivePlayerWeapon(killerid,34,1000);
	SendClientMessage(killerid,COLOR_RED,"You Are On Level 7 = Sniper Rifle");
	}
	else if(KillScore[killerid] == 16)
	{
  rank[killerid] = 8;
	ResetPlayerWeapons(killerid);
	GivePlayerWeapon(killerid,35,1000);
	SendClientMessage(killerid,COLOR_RED,"You Are On Level 8 = Rocket Launcher");
	}
	else if(KillScore[killerid] == 18)
	{
	rank[killerid] = 9;
	ResetPlayerWeapons(killerid);
	GivePlayerWeapon(killerid,36,1000);
	SendClientMessage(killerid,COLOR_RED,"You Are On Level 9 = HS Rocket Launcher");
	}
	else if(KillScore[killerid] == 20)
	{
	rank[killerid] = 10;
  ResetPlayerWeapons(killerid);
	GivePlayerWeapon(killerid,38,1000);
	SendClientMessage(killerid,COLOR_RED,"You Are On Level 10 = MiniGun");
	}
	else if(KillScore[killerid] == 22)
	{
	rank[killerid] = 11;
	ResetPlayerWeapons(killerid);
	GivePlayerWeapon(killerid,40,0);
	GivePlayerWeapon(killerid,39,1000);
	SendClientMessage(killerid,COLOR_RED,"You Are On Level 11 = C4");
	}
	else if(KillScore[killerid] == 24)
	{
	rank[killerid] = 12;
	ResetPlayerWeapons(killerid);
	GivePlayerWeapon(killerid,37,1000);
	SendClientMessage(killerid,COLOR_RED,"You Are On Level 12 = FlameThrower");
	}
  else if(KillScore[killerid] >= 26)
	{
	rank[killerid] = 13;
	ResetPlayerWeapons(killerid);
	GivePlayerWeapon(killerid,4,0);
	SendClientMessage(killerid,COLOR_RED,"You Are On The Last level = Knife!");
	}
	}
	
	
	if(playerid != INVALID_PLAYER_ID)
	{
	new rank[MAX_PLAYERS];
	DeathScore[playerid]++;
	
	if(KillScore[playerid] == 0)
	{
	GivePlayerWeapon(playerid,22,1000);
	SendClientMessage(playerid,COLOR_RED,"You Are On Standart Level = Double Pistols");
	}
	if(KillScore[playerid] == 2)
	{
	rank[playerid] = 1;
	ResetPlayerWeapons(playerid);
	GivePlayerWeapon(playerid,24,1000);
	SendClientMessage(playerid,COLOR_RED,"You Are On Level 1 = Desert Eagle");
	}
	else if(KillScore[playerid] == 4)
  {
	rank[playerid] = 2;
	ResetPlayerWeapons(playerid);
	GivePlayerWeapon(playerid,32,1000);
	SendClientMessage(playerid,COLOR_RED,"You Are On Level 2 = Tec 9");
	}
	else if(KillScore[playerid] == 6)
	{
	rank[playerid] = 3;
	ResetPlayerWeapons(playerid);
	GivePlayerWeapon(playerid,28,1000);
	SendClientMessage(playerid,COLOR_RED,"You Are On Level 3 = Uzi");
	}
	else if(KillScore[playerid] == 8)
	{
	rank[playerid] = 4;
	ResetPlayerWeapons(playerid);
	GivePlayerWeapon(playerid,29,1000);
	SendClientMessage(playerid,COLOR_RED,"You Are On Level 4 = SMG");
	}
	else if(KillScore[playerid] == 10)
	{
	rank[playerid] = 5;
	ResetPlayerWeapons(playerid);
	GivePlayerWeapon(playerid,30,1000);
	SendClientMessage(playerid,COLOR_RED,"You Are On Level 5 = Ak 47");
	}
	else if(KillScore[playerid] == 12)
	{
  rank[playerid] = 6;
	ResetPlayerWeapons(playerid);
	GivePlayerWeapon(playerid,33,1000);
	SendClientMessage(playerid,COLOR_RED,"You Are On Level 6 = Country Rifle");
	}
  else if(KillScore[playerid] == 14)
	{
	rank[playerid] = 7;
	ResetPlayerWeapons(playerid);
	GivePlayerWeapon(playerid,34,1000);
	SendClientMessage(playerid,COLOR_RED,"You Are On Level 7 = Sniper Rifle");
	}
	else if(KillScore[playerid] == 16)
	{
  rank[playerid] = 8;
	ResetPlayerWeapons(playerid);
	GivePlayerWeapon(playerid,35,1000);
	SendClientMessage(playerid,COLOR_RED,"You Are On Level 8 = Rocket Launcher");
	}
	else if(KillScore[playerid] == 18)
	{
	rank[playerid] = 9;
	ResetPlayerWeapons(playerid);
	GivePlayerWeapon(playerid,36,1000);
	SendClientMessage(playerid,COLOR_RED,"You Are On Level 9 = HS Rocket Launcher");
	}
	else if(KillScore[playerid] == 20)
	{
	rank[playerid] = 10;
  ResetPlayerWeapons(playerid);
	GivePlayerWeapon(playerid,38,1000);
	SendClientMessage(playerid,COLOR_RED,"You Are On Level 10 = MiniGun");
	}
	else if(KillScore[playerid] == 22)
	{
	rank[playerid] = 11;
	ResetPlayerWeapons(playerid);
	GivePlayerWeapon(playerid,40,0);
	GivePlayerWeapon(playerid,39,1000);
	SendClientMessage(playerid,COLOR_RED,"You Are On Level 11 = C4");
	}
	else if(KillScore[playerid] == 24)
	{
	rank[playerid] = 12;
	ResetPlayerWeapons(playerid);
	GivePlayerWeapon(playerid,37,1000);
	SendClientMessage(playerid,COLOR_RED,"You Are On Level 12 = FlameThrower");
	}
  else if(KillScore[playerid] >= 26)
	{
	rank[playerid] = 13;
	ResetPlayerWeapons(playerid);
	GivePlayerWeapon(playerid,4,0);
	SendClientMessage(playerid,COLOR_RED,"You Are On The Last level = Knife!");
	}
	}
	return 1;
	}
	
	else if(IsInGunGame[playerid] == 0)
	{
	IsInGunGame[playerid] = 0;

  KillScore[killerid]++;
	DeathScore[playerid]++;
  PlayerInfo[playerid][pDeaths]++;
  PlayerInfo[killerid][pKills]++;
  
	SendDeathMessage(killerid, playerid, reason);
	GetPlayerName(playerid,name2,sizeof(name2));
  format(string,sizeof(string),"%s died",name2);
  SendClientMessageToAll(COLOR_RED,string);
  	GivePlayerMoney(killerid,500);
	GivePlayerMoney(playerid,-1);
	
  new kills = PlayerInfo[playerid][pKills];
  SetPlayerScore(playerid, kills);
	
	GSpawn[playerid] = 0;
  BSpawn[playerid] = 0;
  VSpawn[playerid] = 0;
  ASpawn[playerid] = 0;
  CSpawn[playerid] = 0;
  PSpawn[playerid] = 0;
  
  	Grove[playerid] = 0;
	Ballas[playerid] = 0;
  Vagos[playerid] = 0;
  Aztecas[playerid] = 0;
  Cop[playerid] = 0;
  Punk[playerid] = 0;
  
  PlayerDied[playerid] = 1;
  return 1;
	}
	return 1;
}
The
Код:
PlayerDied[playerid] = 1;
doesn't show the effect I want...

I added PlayerDied on Player spawn, to spawn a player on hospital if he dies
but it doesn't seems to work
Reply
#2

You have
Код:
PlayerDied[playerid] = 1;
under:
Код:
if(killerid != INVALID_PLAYER_ID)
{
So that means that PlayerDied only will be called when there is a killerid.
(correct me if i'm wrong, because this script has a real bad indentation, so i can't realy see on which ''if()'' it is.
If you still have got any problems, then ''debug'' it, and look where it stops.
Reply
#3

i putted the:
Код:
PlayerDied[playerid] = 1;
On The top of OnPlayerDeath like this:
Код:
public OnPlayerDeath(playerid, killerid, reason)
{
  GameTextForPlayer(playerid,"~r~Wasted",1500,0);
  PlayerDied[playerid] = 1;
  
	if(IsInGunGame[playerid] == 1)
	{
	
	IsInGunGame[playerid] = 1;
	if(killerid != INVALID_PLAYER_ID)
	{
	new rank[MAX_PLAYERS];
	
  KillScore[killerid]++;
  
 	if(KillScore[killerid] == 2)
	{
	rank[killerid] = 1;
	ResetPlayerWeapons(killerid);
	GivePlayerWeapon(killerid,24,1000);
	SendClientMessage(killerid,COLOR_RED,"You Are On Level 1 = Desert Eagle");
	}
	else if(KillScore[killerid] == 4)
  {
	rank[killerid] = 2;
	ResetPlayerWeapons(killerid);
	GivePlayerWeapon(killerid,32,1000);
	SendClientMessage(killerid,COLOR_RED,"You Are On Level 2 = Tec 9");
	}
	else if(KillScore[killerid] == 6)
	{
	rank[killerid] = 3;
	ResetPlayerWeapons(killerid);
	GivePlayerWeapon(killerid,28,1000);
	SendClientMessage(killerid,COLOR_RED,"You Are On Level 3 = Uzi");
	}
	else if(KillScore[killerid] == 8)
	{
	rank[killerid] = 4;
	ResetPlayerWeapons(killerid);
	GivePlayerWeapon(killerid,29,1000);
	SendClientMessage(killerid,COLOR_RED,"You Are On Level 4 = SMG");
	}
	else if(KillScore[killerid] == 10)
	{
	rank[killerid] = 5;
	ResetPlayerWeapons(killerid);
	GivePlayerWeapon(killerid,30,1000);
	SendClientMessage(killerid,COLOR_RED,"You Are On Level 5 = Ak 47");
	}
	else if(KillScore[killerid] == 12)
	{
  rank[killerid] = 6;
	ResetPlayerWeapons(killerid);
	GivePlayerWeapon(killerid,33,1000);
	SendClientMessage(killerid,COLOR_RED,"You Are On Level 6 = Country Rifle");
	}
  else if(KillScore[killerid] == 14)
	{
	rank[killerid] = 7;
	ResetPlayerWeapons(killerid);
	GivePlayerWeapon(killerid,34,1000);
	SendClientMessage(killerid,COLOR_RED,"You Are On Level 7 = Sniper Rifle");
	}
	else if(KillScore[killerid] == 16)
	{
  rank[killerid] = 8;
	ResetPlayerWeapons(killerid);
	GivePlayerWeapon(killerid,35,1000);
	SendClientMessage(killerid,COLOR_RED,"You Are On Level 8 = Rocket Launcher");
	}
	else if(KillScore[killerid] == 18)
	{
	rank[killerid] = 9;
	ResetPlayerWeapons(killerid);
	GivePlayerWeapon(killerid,36,1000);
	SendClientMessage(killerid,COLOR_RED,"You Are On Level 9 = HS Rocket Launcher");
	}
	else if(KillScore[killerid] == 20)
	{
	rank[killerid] = 10;
  ResetPlayerWeapons(killerid);
	GivePlayerWeapon(killerid,38,1000);
	SendClientMessage(killerid,COLOR_RED,"You Are On Level 10 = MiniGun");
	}
	else if(KillScore[killerid] == 22)
	{
	rank[killerid] = 11;
	ResetPlayerWeapons(killerid);
	GivePlayerWeapon(killerid,40,0);
	GivePlayerWeapon(killerid,39,1000);
	SendClientMessage(killerid,COLOR_RED,"You Are On Level 11 = C4");
	}
	else if(KillScore[killerid] == 24)
	{
	rank[killerid] = 12;
	ResetPlayerWeapons(killerid);
	GivePlayerWeapon(killerid,37,1000);
	SendClientMessage(killerid,COLOR_RED,"You Are On Level 12 = FlameThrower");
	}
  else if(KillScore[killerid] >= 26)
	{
	rank[killerid] = 13;
	ResetPlayerWeapons(killerid);
	GivePlayerWeapon(killerid,4,0);
	SendClientMessage(killerid,COLOR_RED,"You Are On The Last level = Knife!");
	}
	}
	
	
	if(playerid != INVALID_PLAYER_ID)
	{
	new rank[MAX_PLAYERS];
	DeathScore[playerid]++;
	
	if(KillScore[playerid] == 0)
	{
	GivePlayerWeapon(playerid,22,1000);
	SendClientMessage(playerid,COLOR_RED,"You Are On Standart Level = Double Pistols");
	}
	if(KillScore[playerid] == 2)
	{
	rank[playerid] = 1;
	ResetPlayerWeapons(playerid);
	GivePlayerWeapon(playerid,24,1000);
	SendClientMessage(playerid,COLOR_RED,"You Are On Level 1 = Desert Eagle");
	}
	else if(KillScore[playerid] == 4)
  {
	rank[playerid] = 2;
	ResetPlayerWeapons(playerid);
	GivePlayerWeapon(playerid,32,1000);
	SendClientMessage(playerid,COLOR_RED,"You Are On Level 2 = Tec 9");
	}
	else if(KillScore[playerid] == 6)
	{
	rank[playerid] = 3;
	ResetPlayerWeapons(playerid);
	GivePlayerWeapon(playerid,28,1000);
	SendClientMessage(playerid,COLOR_RED,"You Are On Level 3 = Uzi");
	}
	else if(KillScore[playerid] == 8)
	{
	rank[playerid] = 4;
	ResetPlayerWeapons(playerid);
	GivePlayerWeapon(playerid,29,1000);
	SendClientMessage(playerid,COLOR_RED,"You Are On Level 4 = SMG");
	}
	else if(KillScore[playerid] == 10)
	{
	rank[playerid] = 5;
	ResetPlayerWeapons(playerid);
	GivePlayerWeapon(playerid,30,1000);
	SendClientMessage(playerid,COLOR_RED,"You Are On Level 5 = Ak 47");
	}
	else if(KillScore[playerid] == 12)
	{
  rank[playerid] = 6;
	ResetPlayerWeapons(playerid);
	GivePlayerWeapon(playerid,33,1000);
	SendClientMessage(playerid,COLOR_RED,"You Are On Level 6 = Country Rifle");
	}
  else if(KillScore[playerid] == 14)
	{
	rank[playerid] = 7;
	ResetPlayerWeapons(playerid);
	GivePlayerWeapon(playerid,34,1000);
	SendClientMessage(playerid,COLOR_RED,"You Are On Level 7 = Sniper Rifle");
	}
	else if(KillScore[playerid] == 16)
	{
  rank[playerid] = 8;
	ResetPlayerWeapons(playerid);
	GivePlayerWeapon(playerid,35,1000);
	SendClientMessage(playerid,COLOR_RED,"You Are On Level 8 = Rocket Launcher");
	}
	else if(KillScore[playerid] == 18)
	{
	rank[playerid] = 9;
	ResetPlayerWeapons(playerid);
	GivePlayerWeapon(playerid,36,1000);
	SendClientMessage(playerid,COLOR_RED,"You Are On Level 9 = HS Rocket Launcher");
	}
	else if(KillScore[playerid] == 20)
	{
	rank[playerid] = 10;
  ResetPlayerWeapons(playerid);
	GivePlayerWeapon(playerid,38,1000);
	SendClientMessage(playerid,COLOR_RED,"You Are On Level 10 = MiniGun");
	}
	else if(KillScore[playerid] == 22)
	{
	rank[playerid] = 11;
	ResetPlayerWeapons(playerid);
	GivePlayerWeapon(playerid,40,0);
	GivePlayerWeapon(playerid,39,1000);
	SendClientMessage(playerid,COLOR_RED,"You Are On Level 11 = C4");
	}
	else if(KillScore[playerid] == 24)
	{
	rank[playerid] = 12;
	ResetPlayerWeapons(playerid);
	GivePlayerWeapon(playerid,37,1000);
	SendClientMessage(playerid,COLOR_RED,"You Are On Level 12 = FlameThrower");
	}
  else if(KillScore[playerid] >= 26)
	{
	rank[playerid] = 13;
	ResetPlayerWeapons(playerid);
	GivePlayerWeapon(playerid,4,0);
	SendClientMessage(playerid,COLOR_RED,"You Are On The Last level = Knife!");
	}
	}

	return 1;
	}
	
	else if(IsInGunGame[playerid] == 0)
	{
	IsInGunGame[playerid] = 0;

  KillScore[killerid]++;
	DeathScore[playerid]++;
  PlayerInfo[playerid][pDeaths]++;
  PlayerInfo[killerid][pKills]++;
  
	SendDeathMessage(killerid, playerid, reason);
	GetPlayerName(playerid,name2,sizeof(name2));
  format(string,sizeof(string),"%s died",name2);
  SendClientMessageToAll(COLOR_RED,string);
  	GivePlayerMoney(killerid,500);
	GivePlayerMoney(playerid,-1);
	
  new kills = PlayerInfo[playerid][pKills];
  SetPlayerScore(playerid, kills);
	
	GSpawn[playerid] = 0;
  BSpawn[playerid] = 0;
  VSpawn[playerid] = 0;
  ASpawn[playerid] = 0;
  CSpawn[playerid] = 0;
  PSpawn[playerid] = 0;
  
  	Grove[playerid] = 0;
	Ballas[playerid] = 0;
  Vagos[playerid] = 0;
  Aztecas[playerid] = 0;
  Cop[playerid] = 0;
  Punk[playerid] = 0;
  return 1;
	}
	return 1;
}
and now it works o.O =/

PS: Brackets are choosen correctly.. if not, it would've shown me
warnings,i think ^^
Reply
#4

Quote:
Originally Posted by Bearfist
i putted the:
Код:
PlayerDied[playerid] = 1;
On The top of OnPlayerDeath like this:
Код:
public OnPlayerDeath(playerid, killerid, reason)
{
  GameTextForPlayer(playerid,"~r~Wasted",1500,0);
  PlayerDied[playerid] = 1;
  
	if(IsInGunGame[playerid] == 1)
	{
	
	IsInGunGame[playerid] = 1;
	if(killerid != INVALID_PLAYER_ID)
	{
	new rank[MAX_PLAYERS];
	
  KillScore[killerid]++;
  
 	if(KillScore[killerid] == 2)
	{
	rank[killerid] = 1;
	ResetPlayerWeapons(killerid);
	GivePlayerWeapon(killerid,24,1000);
	SendClientMessage(killerid,COLOR_RED,"You Are On Level 1 = Desert Eagle");
	}
	else if(KillScore[killerid] == 4)
  {
	rank[killerid] = 2;
	ResetPlayerWeapons(killerid);
	GivePlayerWeapon(killerid,32,1000);
	SendClientMessage(killerid,COLOR_RED,"You Are On Level 2 = Tec 9");
	}
	else if(KillScore[killerid] == 6)
	{
	rank[killerid] = 3;
	ResetPlayerWeapons(killerid);
	GivePlayerWeapon(killerid,28,1000);
	SendClientMessage(killerid,COLOR_RED,"You Are On Level 3 = Uzi");
	}
	else if(KillScore[killerid] == 8)
	{
	rank[killerid] = 4;
	ResetPlayerWeapons(killerid);
	GivePlayerWeapon(killerid,29,1000);
	SendClientMessage(killerid,COLOR_RED,"You Are On Level 4 = SMG");
	}
	else if(KillScore[killerid] == 10)
	{
	rank[killerid] = 5;
	ResetPlayerWeapons(killerid);
	GivePlayerWeapon(killerid,30,1000);
	SendClientMessage(killerid,COLOR_RED,"You Are On Level 5 = Ak 47");
	}
	else if(KillScore[killerid] == 12)
	{
  rank[killerid] = 6;
	ResetPlayerWeapons(killerid);
	GivePlayerWeapon(killerid,33,1000);
	SendClientMessage(killerid,COLOR_RED,"You Are On Level 6 = Country Rifle");
	}
  else if(KillScore[killerid] == 14)
	{
	rank[killerid] = 7;
	ResetPlayerWeapons(killerid);
	GivePlayerWeapon(killerid,34,1000);
	SendClientMessage(killerid,COLOR_RED,"You Are On Level 7 = Sniper Rifle");
	}
	else if(KillScore[killerid] == 16)
	{
  rank[killerid] = 8;
	ResetPlayerWeapons(killerid);
	GivePlayerWeapon(killerid,35,1000);
	SendClientMessage(killerid,COLOR_RED,"You Are On Level 8 = Rocket Launcher");
	}
	else if(KillScore[killerid] == 18)
	{
	rank[killerid] = 9;
	ResetPlayerWeapons(killerid);
	GivePlayerWeapon(killerid,36,1000);
	SendClientMessage(killerid,COLOR_RED,"You Are On Level 9 = HS Rocket Launcher");
	}
	else if(KillScore[killerid] == 20)
	{
	rank[killerid] = 10;
  ResetPlayerWeapons(killerid);
	GivePlayerWeapon(killerid,38,1000);
	SendClientMessage(killerid,COLOR_RED,"You Are On Level 10 = MiniGun");
	}
	else if(KillScore[killerid] == 22)
	{
	rank[killerid] = 11;
	ResetPlayerWeapons(killerid);
	GivePlayerWeapon(killerid,40,0);
	GivePlayerWeapon(killerid,39,1000);
	SendClientMessage(killerid,COLOR_RED,"You Are On Level 11 = C4");
	}
	else if(KillScore[killerid] == 24)
	{
	rank[killerid] = 12;
	ResetPlayerWeapons(killerid);
	GivePlayerWeapon(killerid,37,1000);
	SendClientMessage(killerid,COLOR_RED,"You Are On Level 12 = FlameThrower");
	}
  else if(KillScore[killerid] >= 26)
	{
	rank[killerid] = 13;
	ResetPlayerWeapons(killerid);
	GivePlayerWeapon(killerid,4,0);
	SendClientMessage(killerid,COLOR_RED,"You Are On The Last level = Knife!");
	}
	}
	
	
	if(playerid != INVALID_PLAYER_ID)
	{
	new rank[MAX_PLAYERS];
	DeathScore[playerid]++;
	
	if(KillScore[playerid] == 0)
	{
	GivePlayerWeapon(playerid,22,1000);
	SendClientMessage(playerid,COLOR_RED,"You Are On Standart Level = Double Pistols");
	}
	if(KillScore[playerid] == 2)
	{
	rank[playerid] = 1;
	ResetPlayerWeapons(playerid);
	GivePlayerWeapon(playerid,24,1000);
	SendClientMessage(playerid,COLOR_RED,"You Are On Level 1 = Desert Eagle");
	}
	else if(KillScore[playerid] == 4)
  {
	rank[playerid] = 2;
	ResetPlayerWeapons(playerid);
	GivePlayerWeapon(playerid,32,1000);
	SendClientMessage(playerid,COLOR_RED,"You Are On Level 2 = Tec 9");
	}
	else if(KillScore[playerid] == 6)
	{
	rank[playerid] = 3;
	ResetPlayerWeapons(playerid);
	GivePlayerWeapon(playerid,28,1000);
	SendClientMessage(playerid,COLOR_RED,"You Are On Level 3 = Uzi");
	}
	else if(KillScore[playerid] == 8)
	{
	rank[playerid] = 4;
	ResetPlayerWeapons(playerid);
	GivePlayerWeapon(playerid,29,1000);
	SendClientMessage(playerid,COLOR_RED,"You Are On Level 4 = SMG");
	}
	else if(KillScore[playerid] == 10)
	{
	rank[playerid] = 5;
	ResetPlayerWeapons(playerid);
	GivePlayerWeapon(playerid,30,1000);
	SendClientMessage(playerid,COLOR_RED,"You Are On Level 5 = Ak 47");
	}
	else if(KillScore[playerid] == 12)
	{
  rank[playerid] = 6;
	ResetPlayerWeapons(playerid);
	GivePlayerWeapon(playerid,33,1000);
	SendClientMessage(playerid,COLOR_RED,"You Are On Level 6 = Country Rifle");
	}
  else if(KillScore[playerid] == 14)
	{
	rank[playerid] = 7;
	ResetPlayerWeapons(playerid);
	GivePlayerWeapon(playerid,34,1000);
	SendClientMessage(playerid,COLOR_RED,"You Are On Level 7 = Sniper Rifle");
	}
	else if(KillScore[playerid] == 16)
	{
  rank[playerid] = 8;
	ResetPlayerWeapons(playerid);
	GivePlayerWeapon(playerid,35,1000);
	SendClientMessage(playerid,COLOR_RED,"You Are On Level 8 = Rocket Launcher");
	}
	else if(KillScore[playerid] == 18)
	{
	rank[playerid] = 9;
	ResetPlayerWeapons(playerid);
	GivePlayerWeapon(playerid,36,1000);
	SendClientMessage(playerid,COLOR_RED,"You Are On Level 9 = HS Rocket Launcher");
	}
	else if(KillScore[playerid] == 20)
	{
	rank[playerid] = 10;
  ResetPlayerWeapons(playerid);
	GivePlayerWeapon(playerid,38,1000);
	SendClientMessage(playerid,COLOR_RED,"You Are On Level 10 = MiniGun");
	}
	else if(KillScore[playerid] == 22)
	{
	rank[playerid] = 11;
	ResetPlayerWeapons(playerid);
	GivePlayerWeapon(playerid,40,0);
	GivePlayerWeapon(playerid,39,1000);
	SendClientMessage(playerid,COLOR_RED,"You Are On Level 11 = C4");
	}
	else if(KillScore[playerid] == 24)
	{
	rank[playerid] = 12;
	ResetPlayerWeapons(playerid);
	GivePlayerWeapon(playerid,37,1000);
	SendClientMessage(playerid,COLOR_RED,"You Are On Level 12 = FlameThrower");
	}
  else if(KillScore[playerid] >= 26)
	{
	rank[playerid] = 13;
	ResetPlayerWeapons(playerid);
	GivePlayerWeapon(playerid,4,0);
	SendClientMessage(playerid,COLOR_RED,"You Are On The Last level = Knife!");
	}
	}

	return 1;
	}
	
	else if(IsInGunGame[playerid] == 0)
	{
	IsInGunGame[playerid] = 0;

  KillScore[killerid]++;
	DeathScore[playerid]++;
  PlayerInfo[playerid][pDeaths]++;
  PlayerInfo[killerid][pKills]++;
  
	SendDeathMessage(killerid, playerid, reason);
	GetPlayerName(playerid,name2,sizeof(name2));
  format(string,sizeof(string),"%s died",name2);
  SendClientMessageToAll(COLOR_RED,string);
 	GivePlayerMoney(killerid,500);
	GivePlayerMoney(playerid,-1);
	
  new kills = PlayerInfo[playerid][pKills];
  SetPlayerScore(playerid, kills);
	
	GSpawn[playerid] = 0;
  BSpawn[playerid] = 0;
  VSpawn[playerid] = 0;
  ASpawn[playerid] = 0;
  CSpawn[playerid] = 0;
  PSpawn[playerid] = 0;
  
 	Grove[playerid] = 0;
	Ballas[playerid] = 0;
  Vagos[playerid] = 0;
  Aztecas[playerid] = 0;
  Cop[playerid] = 0;
  Punk[playerid] = 0;
  return 1;
	}
	return 1;
}
and now it works o.O =/

PS: Brackets are choosen correctly.. if not, it would've shown me
warnings,i think ^^
Yes and no, it would show you warnings if you do it wrong, you just dont have any indention which makes no warning, but not nice to see.
Reply
#5

It so formated, because i putted from my script normally it is indentioned
...
and else when not the function would work, or not ?!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)