[Solved]4 Errors!!!
#1

Here is the script...
Код:
public OnPlayerDeath(playerid, killerid, reason)
{
	SendDeathMessage(killerid, playerid, reason);
	
	if(!killerid = INVALID_PLAYER_ID); //Line 298 where the errors are...
	{
	  if(PlayerKills(playerid) >= 3 && PlayerKills[playerid] <= 14)  )
      	new PlayerName[MAX_PLAYER_NAME],
				string[128];
		 		GetPlayerName(playerid, PlayerName, sizeof(PlayerName));
		 		format(string, sizeof(string), "[Spree]%s killing spree is now over", PlayerName);
		 		SendClientMessageToAll(COLOR_YELLOW, string);
		 		GivePlayerMoney(killerid, 750);
      }
      if(PlayerKills[playerid] >= 15 && PlayerKills[playerid] <= 44) {
      	new PlayerName[MAX_PLAYER_NAME],
				string[128];
		 		GetPlayerName(playerid, PlayerName, sizeof(PlayerName));
		 		format(string, sizeof(string), "[Spree]%s killing spree is now over", PlayerName);
		 		SendClientMessageToAll(COLOR_YELLOW, string);
		 		GivePlayerMoney(killerid, 1500);
      }
      if(PlayerKills[playerid] >= 45) {
      	new PlayerName[MAX_PLAYER_NAME],
				string[128];
		 		GetPlayerName(playerid, PlayerName, sizeof(PlayerName));
		 		format(string, sizeof(string), "[Spree]%s killing spree is now over", PlayerName);
		 		SendClientMessageToAll(COLOR_YELLOW, string);
		 		GivePlayerMoney(killerid, 2500);
      }

        PlayerKills[playerid] = 0; //Set the murdered's kill count to 0
        PlayerKills[killerid]++; //Set the killer's kill count +1

        if(PlayerKills[killerid] == 3) {
        SendClientMessage(playerid, COLOR_YELLOW,"You are now on a killing spree!");
        new PlayerName[MAX_PLAYER_NAME],
			 	string[128];
			 	GetPlayerName(playerid, PlayerName, sizeof(PlayerName));
			 	format(string, sizeof(string), "[Spree]%s is now on a killing spree", PlayerName);
			 	SendClientMessageToAll(COLOR_YELLOW, string);
			 	GivePlayerMoney(playerid, 450);
        }
        if(PlayerKills[killerid] == 15) {
        SendClientMessage(playerid, COLOR_YELLOW,"You have gotten 15 kills! You have received a Minigun!");
        new PlayerName[MAX_PLAYER_NAME],
			 	string[128];
			 	GetPlayerName(playerid, PlayerName, sizeof(PlayerName));
			 	format(string, sizeof(string), "[Spree]%s has been awarded a Minigun for getting 15 kills!", PlayerName);
			 	SendClientMessageToAll(COLOR_YELLOW, string);
			 	GivePlayerWeapon(playerid, 38, 3000);
			 	GivePlayerMoney(playerid, 1500);
        }
        if(PlayerKills[killerid] == 45) {
				SendClientMessage(playerid, COLOR_YELLOW,"You have gotten 45 kills! You can now use /shop and /godcar!");
        new PlayerName[MAX_PLAYER_NAME],
			 	string[128];
			 	GetPlayerName(playerid, PlayerName, sizeof(PlayerName));
			 	format(string, sizeof(string), "[Spree]%s has gotten 45 kills and is now able to access /godcar and /shop", PlayerName);
			 	SendClientMessageToAll(COLOR_YELLOW, string);
			 	GivePlayerMoney(playerid, 2500);
        }
	return 1;
}
Here are the 4 errors...
Код:
\DEATHM~1.PWN(298) : warning 211: possibly unintended assignment
\DEATHM~1.PWN(298) : error 022: must be lvalue (non-constant)
\DEATHM~1.PWN(298) : warning 215: expression has no effect
\DEATHM~1.PWN(298) : error 001: expected token: ";", but found ")"
\DEATHM~1.PWN(298) : error 029: invalid expression, assumed zero
\DEATHM~1.PWN(298) : fatal error 107: too many error messages on one line
Im a newbie so I dont know what the problem is... Plz if you know what I have done wrong, plz tell me to correct it!
Reply
#2

try

Код:
public OnPlayerDeath(playerid, killerid, reason)
{
	SendDeathMessage(killerid, playerid, reason);
	
	if(!killerid = INVALID_PLAYER_ID);
	{
	  if(PlayerKills(playerid) >= 3 && PlayerKills[playerid] <= 14)  )
      	new PlayerName[MAX_PLAYER_NAME];
				string[128];
		 		GetPlayerName(playerid, PlayerName, sizeof(PlayerName));
		 		format(string, sizeof(string), "[Spree]%s killing spree is now over", PlayerName);
		 		SendClientMessageToAll(COLOR_YELLOW, string);
		 		GivePlayerMoney(killerid, 750);
      }
      if(PlayerKills[playerid] >= 15 && PlayerKills[playerid] <= 44) {
      	new PlayerName[MAX_PLAYER_NAME];
				string[128];
		 		GetPlayerName(playerid, PlayerName, sizeof(PlayerName));
		 		format(string, sizeof(string), "[Spree]%s killing spree is now over", PlayerName);
		 		SendClientMessageToAll(COLOR_YELLOW, string);
		 		GivePlayerMoney(killerid, 1500);
      }
      if(PlayerKills[playerid] >= 45) {
      	new PlayerName[MAX_PLAYER_NAME];
				string[128];
		 		GetPlayerName(playerid, PlayerName, sizeof(PlayerName));
		 		format(string, sizeof(string), "[Spree]%s killing spree is now over", PlayerName);
		 		SendClientMessageToAll(COLOR_YELLOW, string);
		 		GivePlayerMoney(killerid, 2500);
      }

        PlayerKills[playerid] = 0; //Set the murdered's kill count to 0
        PlayerKills[killerid]++; //Set the killer's kill count +1

        if(PlayerKills[killerid] == 3) {
        SendClientMessage(playerid, COLOR_YELLOW,"You are now on a killing spree!");
        new PlayerName[MAX_PLAYER_NAME];
			 	string[128];
			 	GetPlayerName(playerid, PlayerName, sizeof(PlayerName));
			 	format(string, sizeof(string), "[Spree]%s is now on a killing spree", PlayerName);
			 	SendClientMessageToAll(COLOR_YELLOW, string);
			 	GivePlayerMoney(playerid, 450);
        }
        if(PlayerKills[killerid] == 15) {
        SendClientMessage(playerid, COLOR_YELLOW,"You have gotten 15 kills! You have received a Minigun!");
        new PlayerName[MAX_PLAYER_NAME];
			 	string[128];
			 	GetPlayerName(playerid, PlayerName, sizeof(PlayerName));
			 	format(string, sizeof(string), "[Spree]%s has been awarded a Minigun for getting 15 kills!", PlayerName);
			 	SendClientMessageToAll(COLOR_YELLOW, string);
			 	GivePlayerWeapon(playerid, 38, 3000);
			 	GivePlayerMoney(playerid, 1500);
        }
        if(PlayerKills[killerid] == 45) {
				SendClientMessage(playerid, COLOR_YELLOW,"You have gotten 45 kills! You can now use /shop and /godcar!");
        new PlayerName[MAX_PLAYER_NAME];
			 	string[128];
			 	GetPlayerName(playerid, PlayerName, sizeof(PlayerName));
			 	format(string, sizeof(string), "[Spree]%s has gotten 45 kills and is now able to access /godcar and /shop", PlayerName);
			 	SendClientMessageToAll(COLOR_YELLOW, string);
			 	GivePlayerMoney(playerid, 2500);
        }
	return 1;
}
Reply
#3

Quote:
Originally Posted by Imran.Abbas[Agent
]
try

Код:
public OnPlayerDeath(playerid, killerid, reason)
{
	SendDeathMessage(killerid, playerid, reason);
	
	if(!killerid = INVALID_PLAYER_ID);
	{
	  if(PlayerKills(playerid) >= 3 && PlayerKills[playerid] <= 14) )
      	new PlayerName[MAX_PLAYER_NAME];
				string[128];
		 		GetPlayerName(playerid, PlayerName, sizeof(PlayerName));
		 		format(string, sizeof(string), "[Spree]%s killing spree is now over", PlayerName);
		 		SendClientMessageToAll(COLOR_YELLOW, string);
		 		GivePlayerMoney(killerid, 750);
      }
      if(PlayerKills[playerid] >= 15 && PlayerKills[playerid] <= 44) {
      	new PlayerName[MAX_PLAYER_NAME];
				string[128];
		 		GetPlayerName(playerid, PlayerName, sizeof(PlayerName));
		 		format(string, sizeof(string), "[Spree]%s killing spree is now over", PlayerName);
		 		SendClientMessageToAll(COLOR_YELLOW, string);
		 		GivePlayerMoney(killerid, 1500);
      }
      if(PlayerKills[playerid] >= 45) {
      	new PlayerName[MAX_PLAYER_NAME];
				string[128];
		 		GetPlayerName(playerid, PlayerName, sizeof(PlayerName));
		 		format(string, sizeof(string), "[Spree]%s killing spree is now over", PlayerName);
		 		SendClientMessageToAll(COLOR_YELLOW, string);
		 		GivePlayerMoney(killerid, 2500);
      }

        PlayerKills[playerid] = 0; //Set the murdered's kill count to 0
        PlayerKills[killerid]++; //Set the killer's kill count +1

        if(PlayerKills[killerid] == 3) {
        SendClientMessage(playerid, COLOR_YELLOW,"You are now on a killing spree!");
        new PlayerName[MAX_PLAYER_NAME];
			 	string[128];
			 	GetPlayerName(playerid, PlayerName, sizeof(PlayerName));
			 	format(string, sizeof(string), "[Spree]%s is now on a killing spree", PlayerName);
			 	SendClientMessageToAll(COLOR_YELLOW, string);
			 	GivePlayerMoney(playerid, 450);
        }
        if(PlayerKills[killerid] == 15) {
        SendClientMessage(playerid, COLOR_YELLOW,"You have gotten 15 kills! You have received a Minigun!");
        new PlayerName[MAX_PLAYER_NAME];
			 	string[128];
			 	GetPlayerName(playerid, PlayerName, sizeof(PlayerName));
			 	format(string, sizeof(string), "[Spree]%s has been awarded a Minigun for getting 15 kills!", PlayerName);
			 	SendClientMessageToAll(COLOR_YELLOW, string);
			 	GivePlayerWeapon(playerid, 38, 3000);
			 	GivePlayerMoney(playerid, 1500);
        }
        if(PlayerKills[killerid] == 45) {
				SendClientMessage(playerid, COLOR_YELLOW,"You have gotten 45 kills! You can now use /shop and /godcar!");
        new PlayerName[MAX_PLAYER_NAME];
			 	string[128];
			 	GetPlayerName(playerid, PlayerName, sizeof(PlayerName));
			 	format(string, sizeof(string), "[Spree]%s has gotten 45 kills and is now able to access /godcar and /shop", PlayerName);
			 	SendClientMessageToAll(COLOR_YELLOW, string);
			 	GivePlayerMoney(playerid, 2500);
        }
	return 1;
}
Same 4 errors Really need help!
Reply
#4

Whats on line "298"?
Reply
#5

Quote:
Originally Posted by Tigerbeast11
Quote:
Originally Posted by Imran.Abbas[Agent
]
try

Код:
public OnPlayerDeath(playerid, killerid, reason)
{
	SendDeathMessage(killerid, playerid, reason);
	
	if(!killerid = INVALID_PLAYER_ID);
	{
	  if(PlayerKills(playerid) >= 3 && PlayerKills[playerid] <= 14)  )
      	new PlayerName[MAX_PLAYER_NAME];
				string[128];
		 		GetPlayerName(playerid, PlayerName, sizeof(PlayerName));
		 		format(string, sizeof(string), "[Spree]%s killing spree is now over", PlayerName);
		 		SendClientMessageToAll(COLOR_YELLOW, string);
		 		GivePlayerMoney(killerid, 750);
      }
      if(PlayerKills[playerid] >= 15 && PlayerKills[playerid] <= 44) {
      	new PlayerName[MAX_PLAYER_NAME];
				string[128];
		 		GetPlayerName(playerid, PlayerName, sizeof(PlayerName));
		 		format(string, sizeof(string), "[Spree]%s killing spree is now over", PlayerName);
		 		SendClientMessageToAll(COLOR_YELLOW, string);
		 		GivePlayerMoney(killerid, 1500);
      }
      if(PlayerKills[playerid] >= 45) {
      	new PlayerName[MAX_PLAYER_NAME];
				string[128];
		 		GetPlayerName(playerid, PlayerName, sizeof(PlayerName));
		 		format(string, sizeof(string), "[Spree]%s killing spree is now over", PlayerName);
		 		SendClientMessageToAll(COLOR_YELLOW, string);
		 		GivePlayerMoney(killerid, 2500);
      }

        PlayerKills[playerid] = 0; //Set the murdered's kill count to 0
        PlayerKills[killerid]++; //Set the killer's kill count +1

        if(PlayerKills[killerid] == 3) {
        SendClientMessage(playerid, COLOR_YELLOW,"You are now on a killing spree!");
        new PlayerName[MAX_PLAYER_NAME];
			 	string[128];
			 	GetPlayerName(playerid, PlayerName, sizeof(PlayerName));
			 	format(string, sizeof(string), "[Spree]%s is now on a killing spree", PlayerName);
			 	SendClientMessageToAll(COLOR_YELLOW, string);
			 	GivePlayerMoney(playerid, 450);
        }
        if(PlayerKills[killerid] == 15) {
        SendClientMessage(playerid, COLOR_YELLOW,"You have gotten 15 kills! You have received a Minigun!");
        new PlayerName[MAX_PLAYER_NAME];
			 	string[128];
			 	GetPlayerName(playerid, PlayerName, sizeof(PlayerName));
			 	format(string, sizeof(string), "[Spree]%s has been awarded a Minigun for getting 15 kills!", PlayerName);
			 	SendClientMessageToAll(COLOR_YELLOW, string);
			 	GivePlayerWeapon(playerid, 38, 3000);
			 	GivePlayerMoney(playerid, 1500);
        }
        if(PlayerKills[killerid] == 45) {
				SendClientMessage(playerid, COLOR_YELLOW,"You have gotten 45 kills! You can now use /shop and /godcar!");
        new PlayerName[MAX_PLAYER_NAME];
			 	string[128];
			 	GetPlayerName(playerid, PlayerName, sizeof(PlayerName));
			 	format(string, sizeof(string), "[Spree]%s has gotten 45 kills and is now able to access /godcar and /shop", PlayerName);
			 	SendClientMessageToAll(COLOR_YELLOW, string);
			 	GivePlayerMoney(playerid, 2500);
        }
	return 1;
}
Same 4 errors Really need help!
Can you just post the script on pastebin and then remove it when it is fixed because you really aren't showing what's on line 298
Reply
#6

Quote:
Originally Posted by Compton's Eazy E
Whats on line "298"?
I dont know... Im a newbie

Its right in front of u
And by the way, i have defined the PlayerKills...
Reply
#7

Quote:
Originally Posted by Tigerbeast11
Quote:
Originally Posted by Compton's Eazy E
Whats on line "298"?
I dont know... Im a newbie

Its right in front of u
And by the way, i have defined the PlayerKills...
Just tell us the line "298" .. Just write(copy paste) the code so that we know te line of error
Reply
#8

Here is the link for paste bin

http://pastebin.com/m1d5070e8
Reply
#9

Change the line no "298" to this
pawn Код:
if(!killerid == INVALID_PLAYER_ID);
Reply
#10

Quote:
Originally Posted by Peter Corneile [hugu-hosting.co.uk
]
Change the line no "298" to this
pawn Код:
if(!killerid == INVALID_PLAYER_ID);
Now 5 errors
Код:
\DEATHM~1.PWN(298) : warning 217: loose indentation
\DEATHM~1.PWN(298) : warning 213: tag mismatch
\DEATHM~1.PWN(298) : error 036: empty statement
\DEATHM~1.PWN(300) : error 012: invalid function call, not a valid address
\DEATHM~1.PWN(300) : warning 215: expression has no effect
\DEATHM~1.PWN(300) : error 001: expected token: ";", but found ")"
\DEATHM~1.PWN(300) : error 029: invalid expression, assumed zero
\DEATHM~1.PWN(300) : fatal error 107: too many error messages on one line
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)