I have problems with this
#1

Код:
if(PlayerPBing[killerid] == true)
	{
		new string[128], string2[128], pName[MAX_PLAYER_NAME];       Line 329
		GetPlayerName(killerid, pName, sizeof(pName));    Line 330
		PlayerPBKills[killerid]++;
		format(string2, sizeof(string2), "Ucideriile tale curente sunt "COLOR_RED" %d", PlayerPBKills[killerid]); Line 332
		SendClientMessage(killerid, COLOR_WHITE, string2);
		if(PlayerPBKills[killerid] > PBLeaderKills)
		{
			PBLeaderKills = PlayerPBKills[killerid];
			PBLeaderid = killerid;
			format(string,sizeof(string),"Player "COLOR_RED"%s(%d) "COLOR_WHITE"este liderul cu "COLOR_RED"%d "COLOR_WHITE"kill's", pName, killerid, PlayerPBKills[killerid]);
			for(new i = 0; i < MAX_PLAYERS; i++)
			{
				if(PlayerPBing[i] == true)
				{
					SendClientMessage(i, COLOR_WHITE, string);
				}
			}
		}
	}
	return 1;
}
Error's

Код:
(329) : warning 219: local variable "pName" shadows a variable at a preceding level
(330) : error 035: argument type mismatch (argument 2)
(330) : error 035: argument type mismatch (argument 2)
(332) : error 001: expected token: "-string end-", but found "-identifier-"
(332) : warning 215: expression has no effect
(332) : error 001: expected token: ";", but found "-string-"
(332) : warning 215: expression has no effect
(332) : warning 215: expression has no effect
(332) : error 001: expected token: ";", but found ")"
(332) : fatal error 107: too many error messages on one line
Reply
#2

You have defined pName twice ,so try to rename

Код:
if(PlayerPBing[killerid] == true)
	{
		new string[128], string2[128], pName2[MAX_PLAYER_NAME];       
		GetPlayerName(killerid, pName2, sizeof(pName2));    
		PlayerPBKills[killerid]++;
		format(string2, sizeof(string2), "Ucideriile tale curente sunt "COLOR_RED" %d", PlayerPBKills[killerid]); Line 332
		SendClientMessage(killerid, COLOR_WHITE, string2);
		if(PlayerPBKills[killerid] > PBLeaderKills)
		{
			PBLeaderKills = PlayerPBKills[killerid];
			PBLeaderid = killerid;
			format(string,sizeof(string),"Player "COLOR_RED"%s(%d) "COLOR_WHITE"este liderul cu "COLOR_RED"%d "COLOR_WHITE"kill's", pName2, killerid, PlayerPBKills[killerid]);
			for(new i = 0; i < MAX_PLAYERS; i++)
			{
				if(PlayerPBing[i] == true)
				{
					SendClientMessage(i, COLOR_WHITE, string);
				}
			}
		}
	}
	return 1;
}
Reply
#3

Try this:
PHP код:
if(PlayerPBing[killerid] == true)
{
    new 
string[128], string2[128], pName[MAX_PLAYER_NAME];
    
GetPlayerName(killeridpNamesizeof(pName));
    
PlayerPBKills[killerid]++;
    
format(string2sizeof(string2), "Ucideriile tale curente sunt "COLOR_RED" %d"PlayerPBKills[killerid]); Line 332
    SendClientMessage
(killeridCOLOR_WHITEstring2);
    if(
PlayerPBKills[killerid] > PBLeaderKills)
    {
        
PBLeaderKills PlayerPBKills[killerid];
        
PBLeaderid killerid;
        
format(string,sizeof(string),"Player "COLOR_RED"%s(%d) "COLOR_WHITE"este liderul cu "COLOR_RED"%d "COLOR_WHITE"kill's"pNamekilleridPlayerPBKills[killerid]);
        for(new 
0MAX_PLAYERSi++)
        {
            if(
PlayerPBing[i] == true)
            {
                
SendClientMessage(iCOLOR_WHITEstring);
            }
        }
    }
    return 
1;

You have a realy small problem with the closed brackets!
Reply
#4

Quote:
Originally Posted by GospodinX
Посмотреть сообщение
You have defined pName twice ,so try to rename

Код:
if(PlayerPBing[killerid] == true)
	{
		new string[128], string2[128], pName2[MAX_PLAYER_NAME];       
		GetPlayerName(killerid, pName2, sizeof(pName2));    
		PlayerPBKills[killerid]++;
		format(string2, sizeof(string2), "Ucideriile tale curente sunt "COLOR_RED" %d", PlayerPBKills[killerid]); Line 332
		SendClientMessage(killerid, COLOR_WHITE, string2);
		if(PlayerPBKills[killerid] > PBLeaderKills)
		{
			PBLeaderKills = PlayerPBKills[killerid];
			PBLeaderid = killerid;
			format(string,sizeof(string),"Player "COLOR_RED"%s(%d) "COLOR_WHITE"este liderul cu "COLOR_RED"%d "COLOR_WHITE"kill's", pName2, killerid, PlayerPBKills[killerid]);
			for(new i = 0; i < MAX_PLAYERS; i++)
			{
				if(PlayerPBing[i] == true)
				{
					SendClientMessage(i, COLOR_WHITE, string);
				}
			}
		}
	}
	return 1;
}
Now its good and now I have problems with another line.
Код:
format(string2, sizeof(string2), "Ucideriile tale curente sunt "COLOR_RED" %d", PlayerPBKills[killerid]);
Код:
 error 001: expected token: "-string end-", but found "-identifier-"
warning 215: expression has no effect
error 001: expected token: ";", but found "-string-"
warning 215: expression has no effect
warning 215: expression has no effect
error 001: expected token: ";", but found ")"
fatal error 107: too many error messages on one line
Reply
#5

Quote:

You have a realy small problem with the closed brackets!

I think that he is give just part of code,this is not full code.So may he have don't have problem's with brackets(but he need give us full code to see it)




EDIT:
PHP код:
format(string2sizeof(string2), "Ucideriile tale curente sunt "COLOR_RED" %d"PlayerPBKills[killerid]); 
Above this line is
PHP код:
        PlayerPBKills[killerid]++; 
right?You are not made changes?

If no,can you give us define of COLOR_RED ?
Reply
#6

https://pastebin.com/LBeyca9V
Reply
#7

here
PHP код:
"Ucideriile tale curente sunt "COLOR_RED" %d" 
how did you define
Код:
COLOR_RED
? ,because you have to use the embed version
Reply
#8

Use this:

PHP код:
format(string2sizeof(string2), "Ucideriile tale curente sunt "COL_RED" %d"PlayerPBKills[killerid]); 
Or this

PHP код:
format(string2sizeof(string2), "Ucideriile tale curente sunt {AA3333} %d"PlayerPBKills[killerid]); 
Reply
#9

I have a include with all colors I need. In my gamemode I have #include <colors> this is a paintball system on this site.
https://sampforum.blast.hk/showthread.php?tid=586845
Reply
#10

Quote:
Originally Posted by MariusAdv
Посмотреть сообщение
I have a include with all colors I need. In my gamemode I have #include <colors> this is a paintball system on this site.
https://sampforum.blast.hk/showthread.php?tid=586845
Are you try to change code like I'm post you above?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)