error 029: invalid expression, assumed zero and more errors, I can not seem to get them
#1

the errors are these:



Код HTML:
error 029: invalid expression, assumed zero
warning 215: expression has no effect
error 001: expected token: ";", but found ")"
error 029: invalid expression, assumed zero
fatal error 107: too many error messages on one line
The line you are talking about is the first one below, see the complete code:

PHP код:
  if(issuerid != INVALID_PLAYER_ID && weaponid == 34 && bodypart == && Arena2[playerid] == && Arena[playerid] == && mortohs[playerid] == false)
   {
      
SetPlayerHealth(playerid0.0);
      new 
strm[100], killer[MAX_PLAYER_NAME], killed[MAX_PLAYER_NAME];
      
GetPlayerName(issuerid,killer,sizeof(killer));
      
GetPlayerName(playerid,killer,sizeof(killer));
      
format(strm,sizeof(strm),"{09FF00}HeadShot: {FF0000}%s {09FF00}gave one HeadShot in {FF0000}%s",killer,killed);
      
SendClientMessageToAll(-1,strm);
      
mortohs[playerid] = true;
  } 
Reply
#2

If I understand correctly, the line with the errors is the if(...) line? If not, which line is it?

If yes, are you sure the lines before it are correct? Check to see if you didn't forget any semicolons (these things ; ) at the end of them. Show us them if you don't see anything.

Also, your code has problems.
It should be

Код:
GetPlayerName(issuerid,killer,sizeof(killer));
GetPlayerName(playerid,killed,sizeof(killed));
Also, increase the strm string size to about 120 as players with long names won't fit in your string.
Reply
#3

yes, it's the first line.

the back line is:

PHP код:
if(NoEvent[playerid] == 1)if(EventActive == && NoEvent[issuerid] == && EventOHK == true && GetPlayerWeapon(issuerid) > 1SetPlayerHealth(playerid,0.0);
    
DamageTick[playerid] = TickCounter;
    } 
Reply
#4

Give us the full code, your indentation is horrible
Reply
#5

Unfortunately there is no way to pass the whole code, because there are some 20,000 already made, I think it would not be cool.

But I believe you can do from the part where you started making the lines that the error line connects:

PHP код:
public OnPlayerTakeDamage(playeridissueridFloatamountweaponid)
{
    if(
issuerid != INVALID_PLAYER_ID)
    {
    new 
string[20];
    
format(stringsizeof(string), "~s~-~r~%.0f"amount);
    
GameTextForPlayer(playeridstring10006);
    
GameTextForPlayer(issuerid string10005);
    
PlayerPlaySound(issuerid 178020.00.00.0);
//===============================
    //SNIPER SNP2 ONE SHOT
    
if(SNP2[playerid] == true && Arena[playerid] == && GetPlayerWeapon(issuerid) == 34SetPlayerHealth(playerid,0.0);
    
//Event no damage
    
if(NoEvent[playerid] == 1)if(EventActive == && NoEvent[issuerid] == && Eventnodamage == trueSetPlayerHealth(issuerid,0.0);
    
//EventOHK
    
if(NoEvent[playerid] == 1)if(EventActive == && NoEvent[issuerid] == && EventOHK == true && GetPlayerWeapon(issuerid) > 1SetPlayerHealth(playerid,0.0)
    
DamageTick[playerid] = TickCounter;
    }
   if(
issuerid != INVALID_PLAYER_ID && weaponid == 34 && bodypart == && Arena2[playerid] == && Arena[playerid] == && mortohs[playerid] == false)
   {
      
SetPlayerHealth(playerid0.0);
      new 
strm[100], killer[MAX_PLAYER_NAME], killed[MAX_PLAYER_NAME];
      
GetPlayerName(issuerid,killer,sizeof(killer));
      
GetPlayerName(playerid,killed,sizeof(killed));
      
format(strm,sizeof(strm),"{09FF00}HeadShot: {FF0000}%s {09FF00}gave one HeadShot in {FF0000}%s",killer,killed);
      
SendClientMessageToAll(-1,strm);
      
mortohs[playerid] = true;
  }
return 
1;

If you find errors in English, please ignore, I'm not fluent in English
Reply
#6

Код:
public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid) 
{ 
    if(issuerid != INVALID_PLAYER_ID) 
    { 
    new string[20]; 
    format(string, sizeof(string), "~s~-~r~%.0f", amount); 
    GameTextForPlayer(playerid, string, 1000, 6); 
    GameTextForPlayer(issuerid , string, 1000, 5); 
    PlayerPlaySound(issuerid , 17802, 0.0, 0.0, 0.0); 
//=============================== 

    //SNIPER SNP2 ONE SHOT 
    if(SNP2[playerid] == true && Arena[playerid] == 1 && GetPlayerWeapon(issuerid) == 34)SetPlayerHealth(playerid,0.0); 
 
    //Event no damage 
    if(NoEvent[playerid] == 1)if(EventActive == 1 && NoEvent[issuerid] == 1 && Eventnodamage == true)SetPlayerHealth(issuerid,0.0); 
   
    //EventOHK 
    if(NoEvent[playerid] == 1)if(EventActive == 1 && NoEvent[issuerid] == 1 && EventOHK == true && 
    GetPlayerWeapon(issuerid) > 1) SetPlayerHealth(playerid,0.0); 
    DamageTick[playerid] = TickCounter; 
 
    } 

   if(issuerid != INVALID_PLAYER_ID & & weaponid == 34 && bodypart == 9 && Arena2[playerid] == 0 && Arena[playerid] == 0 && mortohs[playerid] == false) 
   { 
      SetPlayerHealth(playerid, 0.0); 
      new strm[100], killer[MAX_PLAYER_NAME], killed[MAX_PLAYER_NAME]; 
      GetPlayerName(issuerid,killer,sizeof(killer)); 
      GetPlayerName(playerid,killed,sizeof(killed)); 
      format(strm,sizeof(strm),"{09FF00}HeadShot: {FF0000}%s {09FF00}gave one HeadShot in {FF0000}%s",killer,killed); 
      SendClientMessageToAll(-1,strm); 
      mortohs[playerid] = true; 
  } 

return 1; 
}
try this
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)