2 warnings
#1

C:\Users\brian d to the j\Desktop\workin on parno\pTc0.1x.pwn(34 : warning 225: unreachable code
C:\Users\brian d to the j\Desktop\workin on parno\pTc0.1x.pwn(806) : warning 217: loose indentation

Код:
348public OnPlayerDeath(playerid, killerid, reason)
349{
350 	if(killerid == INVALID_PLAYER_ID) {
    SendDeathMessage(INVALID_PLAYER_ID,playerid,reason);
	}
	else
	{
  		SendDeathMessage(killerid,playerid,reason);
}
	return 1;


	if(PlayerDied[playerid] == true)
	{
	PlayerDied[playerid] = false;
 	if(KillerID[playerid] != INVALID_PLAYER_ID)
	TogglePlayerSpectating(playerid,1);
	PlayerSpectatePlayer(playerid,killerid);
	SetTimerEx("spawn",10000,1, "i", playerid);
 	}
	else
	{
	TogglePlayerSpectating(playerid, 0);
}
	return 1;
}
and this
Код:
IsPlayerInInvalidNosVehicle(playerid,vehicleid){

	 new InvalidNosVehicles[MAX_INVALID_NOS_VEHICLES] ={
	581,523,462,521,463,522,461,448,468,586,
	509,481,510,472,473,493,595,484,430,453,
	452,446,454,590,569,537,538,570,449,
406  };
407
408	vehicleid = GetPlayerVehicleID(playerid);

	if(IsPlayerInVehicle(playerid,vehicleid)){
	for(new i = 0; i < MAX_INVALID_NOS_VEHICLES; i++){
	if(GetVehicleModel(vehicleid) == InvalidNosVehicles[i]){
	return true;
			}
		}
	}
	return false;
}
Reply
#2

pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
  if(killerid == INVALID_PLAYER_ID)
  {
    SendDeathMessage(INVALID_PLAYER_ID,playerid,reason);
  }
  else
  {
    SendDeathMessage(killerid,playerid,reason);
  }
  if(PlayerDied[playerid] == true)
  {
    PlayerDied[playerid] = false;
    if(KillerID[playerid] != INVALID_PLAYER_ID)
    TogglePlayerSpectating(playerid,1);
    PlayerSpectatePlayer(playerid,killerid);
    SetTimerEx("spawn",10000,1, "i", playerid);
  }
  else
  {
    TogglePlayerSpectating(playerid, 0);
  }
  return 1;
}
Indent
Reply
#3

thanks man and i hav tried to indent the other one in many ways but carnt
Reply
#4

Are both errors fixed or you still have the Unreachable code warning ?
Reply
#5

no the bottom one is still wrong

thanks
Reply
#6

Quote:
Originally Posted by dlegend
no the bottom one is still wrong

thanks
Can we see more code then just that?
Reply
#7

Код:
IsPlayerInInvalidNosVehicle(playerid,vehicleid){

	new InvalidNosVehicles[MAX_INVALID_NOS_VEHICLES] ={
	581,523,462,521,463,522,461,448,468,586,
	509,481,510,472,473,493,595,484,430,453,
	452,446,454,590,569,537,538,570,449,
  };

806	vehicleid = GetPlayerVehicleID(playerid);

	if(IsPlayerInVehicle(playerid,vehicleid)){
	for(new i = 0; i < MAX_INVALID_NOS_VEHICLES; i++){
	if(GetVehicleModel(vehicleid) == InvalidNosVehicles[i]){
	return true;
			}
		}
	}
	return false;
}
Reply
#8

Give me the 10-15 lines over the line of error (warning)
Reply
#9

Код:
798 IsPlayerInInvalidNosVehicle(playerid,vehicleid){
799
800	new InvalidNosVehicles[MAX_INVALID_NOS_VEHICLES] ={
801	581,523,462,521,463,522,461,448,468,586,
802	509,481,510,472,473,493,595,484,430,453,
803	452,446,454,590,569,537,538,570,449,
804  };
805
806	vehicleid = GetPlayerVehicleID(playerid);
807
808	if(IsPlayerInVehicle(playerid,vehicleid)){
809	for(new i = 0; i < MAX_INVALID_NOS_VEHICLES; i++){
810	if(GetVehicleModel(vehicleid) == InvalidNosVehicles[i]){
811	return true;
812			}
113		}
114	}
115	return false;
}
error is on 806 loose indent
Reply
#10

dude, this is a easy prob to fix!!!! Just put a tab on the 806 line. watch...
Код:
798 IsPlayerInInvalidNosVehicle(playerid,vehicleid){
799
800	new InvalidNosVehicles[MAX_INVALID_NOS_VEHICLES] ={
801	581,523,462,521,463,522,461,448,468,586,
802	509,481,510,472,473,493,595,484,430,453,
803	452,446,454,590,569,537,538,570,449,
804  };
805
806	     vehicleid = GetPlayerVehicleID(playerid);
807
808	if(IsPlayerInVehicle(playerid,vehicleid)){
809	for(new i = 0; i < MAX_INVALID_NOS_VEHICLES; i++){
810	if(GetVehicleModel(vehicleid) == InvalidNosVehicles[i]){
811	return true;
812			}
113		}
114	}
115	return false;
}
should work!!!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)