error 047: array sizes do not match, or destination array is too small
#1

Getting this error in a part where there aren't even any arrays.



Код:
stock SetPlayerLevelName(playerid)
{
	if(PlayerInfo[playerid][pLevel] == 1) PlayerInfo[playerid][pLevelName] = "Private I";
	if(PlayerInfo[playerid][pLevel] == 2) PlayerInfo[playerid][pLevelName] = "Private II";
	if(PlayerInfo[playerid][pLevel] == 3) PlayerInfo[playerid][pLevelName] = "Private III";
	if(PlayerInfo[playerid][pLevel] == 4) PlayerInfo[playerid][pLevelName] = "Private First Class";
	if(PlayerInfo[playerid][pLevel] == 5) PlayerInfo[playerid][pLevelName] = "Specialist";
	if(PlayerInfo[playerid][pLevel] == 6) PlayerInfo[playerid][pLevelName] = "Corporal";
	if(PlayerInfo[playerid][pLevel] == 7) PlayerInfo[playerid][pLevelName] = "Sergeant";
	if(PlayerInfo[playerid][pLevel] == 8) PlayerInfo[playerid][pLevelName] = "Staff Sergeant";
	if(PlayerInfo[playerid][pLevel] == 9) PlayerInfo[playerid][pLevelName] = "Sergeant First Class";
	if(PlayerInfo[playerid][pLevel] == 10) PlayerInfo[playerid][pLevelName] = "Master Sergeant";
	if(PlayerInfo[playerid][pLevel] == 11) PlayerInfo[playerid][pLevelName] = "First Sergeant";
	if(PlayerInfo[playerid][pLevel] == 12) PlayerInfo[playerid][pLevelName] = "Sergeant Major";
	if(PlayerInfo[playerid][pLevel] == 13) PlayerInfo[playerid][pLevelName] = "Command Sergeant Major";
	if(PlayerInfo[playerid][pLevel] == 14) PlayerInfo[playerid][pLevelName] = "Sergeant Major of the Army";
	if(PlayerInfo[playerid][pLevel] == 15) PlayerInfo[playerid][pLevelName] = "Warrant Officer";
	if(PlayerInfo[playerid][pLevel] == 16) PlayerInfo[playerid][pLevelName] = "Chief Warrant Officer II";
	if(PlayerInfo[playerid][pLevel] == 17) PlayerInfo[playerid][pLevelName] = "Chief Warrant Officer III";
	if(PlayerInfo[playerid][pLevel] == 18) PlayerInfo[playerid][pLevelName] = "Chief Warrant Officer IV";
	if(PlayerInfo[playerid][pLevel] == 19) PlayerInfo[playerid][pLevelName] = "Chief Warrant Officer V";
	if(PlayerInfo[playerid][pLevel] == 20) PlayerInfo[playerid][pLevelName] = "Second Lieutenant";
	if(PlayerInfo[playerid][pLevel] == 21) PlayerInfo[playerid][pLevelName] = "First Lieutenant";
	if(PlayerInfo[playerid][pLevel] == 22) PlayerInfo[playerid][pLevelName] = "Captain";
	if(PlayerInfo[playerid][pLevel] == 23) PlayerInfo[playerid][pLevelName] = "Major";
	if(PlayerInfo[playerid][pLevel] == 24) PlayerInfo[playerid][pLevelName] = "Lieutenant Colonel";
	if(PlayerInfo[playerid][pLevel] == 25) PlayerInfo[playerid][pLevelName] = "Colonel";
	if(PlayerInfo[playerid][pLevel] == 26) PlayerInfo[playerid][pLevelName] = "Brigadier General";
	if(PlayerInfo[playerid][pLevel] == 27) PlayerInfo[playerid][pLevelName] = "Major General";
	if(PlayerInfo[playerid][pLevel] == 28) PlayerInfo[playerid][pLevelName] = "Lieutenant General";
	if(PlayerInfo[playerid][pLevel] == 29) PlayerInfo[playerid][pLevelName] = "General";
	if(PlayerInfo[playerid][pLevel] == 30) PlayerInfo[playerid][pLevelName] = "General of the Army";
}
Here's the enum
Код:
enum pInfo
{
    pPass,
    pCash,
    pAdmin,
    pKills,
    pDeaths,
    pVIP,
    pXP,
    pLevel,
    pLevelName[64],
    pTeam
}
Reply
#2

Use switch, is more fast.

PHP код:
SetPlayerLevelName(playerid)
{
    switch(
PlayerInfo[playerid][pLevel])
    {
        case 
1PlayerInfo[playerid][pLevelName] = "Private I";
        case 
2PlayerInfo[playerid][pLevelName] = "Private II";
        case 
3PlayerInfo[playerid][pLevelName] = "Private III";
        case 
4PlayerInfo[playerid][pLevelName] = "Private First Class";
        case 
5PlayerInfo[playerid][pLevelName] = "Specialist";
        case 
6PlayerInfo[playerid][pLevelName] = "Corporal";
        case 
7PlayerInfo[playerid][pLevelName] = "Sergeant";
        case 
8PlayerInfo[playerid][pLevelName] = "Staff Sergeant";
        case 
9PlayerInfo[playerid][pLevelName] = "Sergeant First Class";
        case 
10PlayerInfo[playerid][pLevelName] = "Master Sergeant";
        case 
11PlayerInfo[playerid][pLevelName] = "First Sergeant";
        case 
12PlayerInfo[playerid][pLevelName] = "Sergeant Major";
        case 
13PlayerInfo[playerid][pLevelName] = "Command Sergeant Major";
        case 
14PlayerInfo[playerid][pLevelName] = "Sergeant Major of the Army";
        case 
15PlayerInfo[playerid][pLevelName] = "Warrant Officer";
        case 
16PlayerInfo[playerid][pLevelName] = "Chief Warrant Officer II";
        case 
17PlayerInfo[playerid][pLevelName] = "Chief Warrant Officer III";
        case 
18PlayerInfo[playerid][pLevelName] = "Chief Warrant Officer IV";
        case 
19PlayerInfo[playerid][pLevelName] = "Chief Warrant Officer V";
        case 
20PlayerInfo[playerid][pLevelName] = "Second Lieutenant";
        case 
21PlayerInfo[playerid][pLevelName] = "First Lieutenant";
        case 
22PlayerInfo[playerid][pLevelName] = "Captain";
        case 
23PlayerInfo[playerid][pLevelName] = "Major";
        case 
24PlayerInfo[playerid][pLevelName] = "Lieutenant Colonel";
        case 
25PlayerInfo[playerid][pLevelName] = "Colonel";
        case 
26PlayerInfo[playerid][pLevelName] = "Brigadier General";
        case 
27PlayerInfo[playerid][pLevelName] = "Major General";
        case 
28PlayerInfo[playerid][pLevelName] = "Lieutenant General";
        case 
29PlayerInfo[playerid][pLevelName] = "General";
        case 
30PlayerInfo[playerid][pLevelName] = "General of the Army";
    }
    return 
1;

Try increasing the value of the PlayerInfo[playerid][pLevelName]

PHP код:
enum pInfo
{
    
pPass,
    
pCash,
    
pAdmin,
    
pKills,
    
pDeaths,
    
pVIP,
    
pXP,
    
pLevel,
    
pLevelName[128],
    
pTeam

Reply
#3

Quote:
Originally Posted by Unrea1
Посмотреть сообщение
Use switch, is more fast.

PHP код:
SetPlayerLevelName(playerid)
{
    switch(
PlayerInfo[playerid][pLevel])
    {
        case 
1PlayerInfo[playerid][pLevelName] = "Private I";
        case 
2PlayerInfo[playerid][pLevelName] = "Private II";
        case 
3PlayerInfo[playerid][pLevelName] = "Private III";
        case 
4PlayerInfo[playerid][pLevelName] = "Private First Class";
        case 
5PlayerInfo[playerid][pLevelName] = "Specialist";
        case 
6PlayerInfo[playerid][pLevelName] = "Corporal";
        case 
7PlayerInfo[playerid][pLevelName] = "Sergeant";
        case 
8PlayerInfo[playerid][pLevelName] = "Staff Sergeant";
        case 
9PlayerInfo[playerid][pLevelName] = "Sergeant First Class";
        case 
10PlayerInfo[playerid][pLevelName] = "Master Sergeant";
        case 
11PlayerInfo[playerid][pLevelName] = "First Sergeant";
        case 
12PlayerInfo[playerid][pLevelName] = "Sergeant Major";
        case 
13PlayerInfo[playerid][pLevelName] = "Command Sergeant Major";
        case 
14PlayerInfo[playerid][pLevelName] = "Sergeant Major of the Army";
        case 
15PlayerInfo[playerid][pLevelName] = "Warrant Officer";
        case 
16PlayerInfo[playerid][pLevelName] = "Chief Warrant Officer II";
        case 
17PlayerInfo[playerid][pLevelName] = "Chief Warrant Officer III";
        case 
18PlayerInfo[playerid][pLevelName] = "Chief Warrant Officer IV";
        case 
19PlayerInfo[playerid][pLevelName] = "Chief Warrant Officer V";
        case 
20PlayerInfo[playerid][pLevelName] = "Second Lieutenant";
        case 
21PlayerInfo[playerid][pLevelName] = "First Lieutenant";
        case 
22PlayerInfo[playerid][pLevelName] = "Captain";
        case 
23PlayerInfo[playerid][pLevelName] = "Major";
        case 
24PlayerInfo[playerid][pLevelName] = "Lieutenant Colonel";
        case 
25PlayerInfo[playerid][pLevelName] = "Colonel";
        case 
26PlayerInfo[playerid][pLevelName] = "Brigadier General";
        case 
27PlayerInfo[playerid][pLevelName] = "Major General";
        case 
28PlayerInfo[playerid][pLevelName] = "Lieutenant General";
        case 
29PlayerInfo[playerid][pLevelName] = "General";
        case 
30PlayerInfo[playerid][pLevelName] = "General of the Army";
    }
    return 
1;

Try increasing the value of the PlayerInfo[playerid][pLevelName]

PHP код:
enum pInfo
{
    
pPass,
    
pCash,
    
pAdmin,
    
pKills,
    
pDeaths,
    
pVIP,
    
pXP,
    
pLevel,
    
pLevelName[128],
    
pTeam

I've already tried increasing the size of pLevelName. Oddly enough this issue only appeared after I made this command:
Код:
CMD:stats(playerid, params[])
{
	new name[24], string1[128], string2[128], string3[128], year, month, day;
	GetPlayerName(playerid, name, sizeof(name));
	getdate(year,month,day);
	SendClientMessage(playerid, COLOR_YELLOW, "-| Stats |-");
	format(string1, sizeof(string1), "Name: %s | Joined on %d/%d/%d | Team: %s", name, month, day, year, GetPlayerTeamName(playerid));
	format(string2, sizeof(string2), "Level: %d (%s) | XP: %d | Cash: $%s | Kills: %d | Deaths: %d", PlayerInfo[playerid][pLevel], GetPlayerLevelName(playerid), PlayerInfo[playerid][pXP], GetPlayerMoney(playerid), PlayerInfo[playerid][pKills], PlayerInfo[playerid][pDeaths]);
	format(string3, sizeof(string3), "VIP Level: %d | Admin Level: %d", PlayerInfo[playerid][pVIP], PlayerInfo[playerid][pAdmin]);
	SendClientMessage(playerid, COLOR_YELLOW, string1);
	SendClientMessage(playerid, COLOR_YELLOW, string2);
	SendClientMessage(playerid, COLOR_YELLOW, string3);
	return 1;
}
which I don't understand why they'd be related
Reply
#4

Show the function GetPlayerLevelName, apparently the problem is there.

Or just delete that function and add PlayerInfo[playerid][pLevelName]
Reply
#5

Код:
stock GetPlayerLevelName(playerid)
{
	SetPlayerLevelName(playerid);
	return PlayerInfo[playerid][pLevelName];
}
Reply
#6

PHP код:
SetPlayerLevelName(playerid

    
strdel(PlayerInfo[playerid][pLevelName],0,128);
    switch(
PlayerInfo[playerid][pLevel]) 
    { 
        case 
1strins(PlayerInfo[playerid][pLevelName],"Private I",0,128); 
        case 
2strins(PlayerInfo[playerid][pLevelName],"Private II",0,128); 
        case 
3strins(PlayerInfo[playerid][pLevelName],"Private III",0,128); 
        case 
4strins(PlayerInfo[playerid][pLevelName],"Private First Class",0,128); 
        case 
5strins(PlayerInfo[playerid][pLevelName],"Specialist",0,128); 
        case 
6strins(PlayerInfo[playerid][pLevelName],"Corporal",0,128); 
        case 
7strins(PlayerInfo[playerid][pLevelName],"Sergeant",0,128); 
        case 
8strins(PlayerInfo[playerid][pLevelName],"Staff Sergeant",0,128); 
        case 
9strins(PlayerInfo[playerid][pLevelName],"Sergeant First Class",0,128); 
        case 
10strins(PlayerInfo[playerid][pLevelName],"Master Sergeant",0,128); 
        case 
11strins(PlayerInfo[playerid][pLevelName],"First Sergeant",0,128); 
        case 
12strins(PlayerInfo[playerid][pLevelName],"Sergeant Major",0,128); 
        case 
13strins(PlayerInfo[playerid][pLevelName],"Command Sergeant Major",0,128); 
        case 
14strins(PlayerInfo[playerid][pLevelName],"Sergeant Major of the Army",0,128); 
        case 
15strins(PlayerInfo[playerid][pLevelName],"Warrant Officer",0,128); 
        case 
16strins(PlayerInfo[playerid][pLevelName],"Chief Warrant Officer II",0,128); 
        case 
17strins(PlayerInfo[playerid][pLevelName],"Chief Warrant Officer III",0,128); 
        case 
18strins(PlayerInfo[playerid][pLevelName],"Chief Warrant Officer IV",0,128); 
        case 
19strins(PlayerInfo[playerid][pLevelName],"Chief Warrant Officer V",0,128); 
        case 
20strins(PlayerInfo[playerid][pLevelName],"Second Lieutenant",0,128); 
        case 
21strins(PlayerInfo[playerid][pLevelName],"First Lieutenant",0,128); 
        case 
22strins(PlayerInfo[playerid][pLevelName],"Captain",0,128); 
        case 
23strins(PlayerInfo[playerid][pLevelName],"Major",0,128); 
        case 
24strins(PlayerInfo[playerid][pLevelName],"Lieutenant Colonel",0,128); 
        case 
25strins(PlayerInfo[playerid][pLevelName],"Colonel",0,128); 
        case 
26strins(PlayerInfo[playerid][pLevelName],"Brigadier General",0,128); 
        case 
27strins(PlayerInfo[playerid][pLevelName],"Major General",0,128); 
        case 
28strins(PlayerInfo[playerid][pLevelName],"Lieutenant General",0,128); 
        case 
29strins(PlayerInfo[playerid][pLevelName],"General",0,128); 
        case 
30strins(PlayerInfo[playerid][pLevelName],"General of the Army",0,128); 
    } 
    return 
1

It's not oddly after, as before adding this command you didn't use this function it was not called so those errors didn't pop up.
Reply
#7

Use it:

PHP код:
SetPlayerLevelName(playerid)  
{  
    
PlayerInfo[playerid][pLevelName] = EOS;
    switch(
PlayerInfo[playerid][pLevel])  
    {  
        case 
1PlayerInfo[playerid][pLevelName] = "Private I";
        case 
2PlayerInfo[playerid][pLevelName] = "Private II";
        case 
3PlayerInfo[playerid][pLevelName] = "Private III";
        case 
4PlayerInfo[playerid][pLevelName] = "Private First Class";
        case 
5PlayerInfo[playerid][pLevelName] = "Specialist";
        case 
6PlayerInfo[playerid][pLevelName] = "Corporal";
        case 
7PlayerInfo[playerid][pLevelName] = "Sergeant";
        case 
8PlayerInfo[playerid][pLevelName] = "Staff Sergeant";
        case 
9PlayerInfo[playerid][pLevelName] = "Sergeant First Class";
        case 
10PlayerInfo[playerid][pLevelName] = "Master Sergeant";
        case 
11PlayerInfo[playerid][pLevelName] = "First Sergeant";
        case 
12PlayerInfo[playerid][pLevelName] = "Sergeant Major";
        case 
13PlayerInfo[playerid][pLevelName] = "Command Sergeant Major";
        case 
14PlayerInfo[playerid][pLevelName] = "Sergeant Major of the Army";
        case 
15PlayerInfo[playerid][pLevelName] = "Warrant Officer";
        case 
16PlayerInfo[playerid][pLevelName] = "Chief Warrant Officer II";
        case 
17PlayerInfo[playerid][pLevelName] = "Chief Warrant Officer III";
        case 
18PlayerInfo[playerid][pLevelName] = "Chief Warrant Officer IV";
        case 
19PlayerInfo[playerid][pLevelName] = "Chief Warrant Officer V";
        case 
20PlayerInfo[playerid][pLevelName] = "Second Lieutenant";
        case 
21PlayerInfo[playerid][pLevelName] = "First Lieutenant";
        case 
22PlayerInfo[playerid][pLevelName] = "Captain";
        case 
23PlayerInfo[playerid][pLevelName] = "Major";
        case 
24PlayerInfo[playerid][pLevelName] = "Lieutenant Colonel";
        case 
25PlayerInfo[playerid][pLevelName] = "Colonel";
        case 
26PlayerInfo[playerid][pLevelName] = "Brigadier General";
        case 
27PlayerInfo[playerid][pLevelName] = "Major General";
        case 
28PlayerInfo[playerid][pLevelName] = "Lieutenant General";
        case 
29PlayerInfo[playerid][pLevelName] = "General";
        case 
30PlayerInfo[playerid][pLevelName] = "General of the Army";
    }  
    return 
1;  

I'm not seeing any error, put the error line.
Reply
#8

Quote:
Originally Posted by AroseKhanNiazi
Посмотреть сообщение
PHP код:
SetPlayerLevelName(playerid

    
strdel(PlayerInfo[playerid][pLevelName],0,128);
    switch(
PlayerInfo[playerid][pLevel]) 
    { 
        case 
1strins(PlayerInfo[playerid][pLevelName],"Private I",0,128); 
        case 
2strins(PlayerInfo[playerid][pLevelName],"Private II",0,128); 
        case 
3strins(PlayerInfo[playerid][pLevelName],"Private III",0,128); 
        case 
4strins(PlayerInfo[playerid][pLevelName],"Private First Class",0,128); 
        case 
5strins(PlayerInfo[playerid][pLevelName],"Specialist",0,128); 
        case 
6strins(PlayerInfo[playerid][pLevelName],"Corporal",0,128); 
        case 
7strins(PlayerInfo[playerid][pLevelName],"Sergeant",0,128); 
        case 
8strins(PlayerInfo[playerid][pLevelName],"Staff Sergeant",0,128); 
        case 
9strins(PlayerInfo[playerid][pLevelName],"Sergeant First Class",0,128); 
        case 
10strins(PlayerInfo[playerid][pLevelName],"Master Sergeant",0,128); 
        case 
11strins(PlayerInfo[playerid][pLevelName],"First Sergeant",0,128); 
        case 
12strins(PlayerInfo[playerid][pLevelName],"Sergeant Major",0,128); 
        case 
13strins(PlayerInfo[playerid][pLevelName],"Command Sergeant Major",0,128); 
        case 
14strins(PlayerInfo[playerid][pLevelName],"Sergeant Major of the Army",0,128); 
        case 
15strins(PlayerInfo[playerid][pLevelName],"Warrant Officer",0,128); 
        case 
16strins(PlayerInfo[playerid][pLevelName],"Chief Warrant Officer II",0,128); 
        case 
17strins(PlayerInfo[playerid][pLevelName],"Chief Warrant Officer III",0,128); 
        case 
18strins(PlayerInfo[playerid][pLevelName],"Chief Warrant Officer IV",0,128); 
        case 
19strins(PlayerInfo[playerid][pLevelName],"Chief Warrant Officer V",0,128); 
        case 
20strins(PlayerInfo[playerid][pLevelName],"Second Lieutenant",0,128); 
        case 
21strins(PlayerInfo[playerid][pLevelName],"First Lieutenant",0,128); 
        case 
22strins(PlayerInfo[playerid][pLevelName],"Captain",0,128); 
        case 
23strins(PlayerInfo[playerid][pLevelName],"Major",0,128); 
        case 
24strins(PlayerInfo[playerid][pLevelName],"Lieutenant Colonel",0,128); 
        case 
25strins(PlayerInfo[playerid][pLevelName],"Colonel",0,128); 
        case 
26strins(PlayerInfo[playerid][pLevelName],"Brigadier General",0,128); 
        case 
27strins(PlayerInfo[playerid][pLevelName],"Major General",0,128); 
        case 
28strins(PlayerInfo[playerid][pLevelName],"Lieutenant General",0,128); 
        case 
29strins(PlayerInfo[playerid][pLevelName],"General",0,128); 
        case 
30strins(PlayerInfo[playerid][pLevelName],"General of the Army",0,128); 
    } 
    return 
1

It's not oddly after, as before adding this command you didn't use this function it was not called so those errors didn't pop up.
Thanks, that worked. Now I'm getting a bunch of errors with this:
Код:
stock GetPlayerTeamName(playerid);
{
	new team;
	team = GetPlayerTeam(playerid);
	if(team == TEAM_USA) return "United States";
	if(team == TEAM_CANADA) return "Canada";
	if(team == TEAM_BRITAIN) return "Britain";
	if(team == TEAM_AUSTRALIA) return "Australia";
	if(team == TEAM_RUSSIA) return "Russia";
	if(team == TEAM_GERMANY) return "Germany";
	if(team == TEAM_ITALY) return "Italy";
	if(team == TEAM_FRANCE) return "France";
	if(team == TEAM_CHINA) return "China";
	if(team == TEAM_INDIA) return "India";
}
(I see the semi-colon in the callback, if i remove it right now it crashes the PAWN compiler)

Код:
C:\Users\keega\OneDrive\Desktop\SAMP server\pawno\include\YSI\..\YSI_Storage\..\YSI_Core\y_utils.inc(430) : warning 201: redefinition of constant/macro (symbol "isnull(%1)")
C:\Users\keega\OneDrive\Desktop\SAMP server\pawno\include\mGates.inc(346) : warning 213: tag mismatch
C:\Users\keega\OneDrive\Desktop\SAMP server\pawno\include\mGates.inc(378) : warning 213: tag mismatch
C:\Users\keega\OneDrive\Desktop\SAMP server\gamemodes\maude1.pwn(103) : warning 213: tag mismatch
C:\Users\keega\OneDrive\Desktop\SAMP server\gamemodes\maude1.pwn(104) : warning 213: tag mismatch
C:\Users\keega\OneDrive\Desktop\SAMP server\gamemodes\maude1.pwn(567) : error 004: function "GetPlayerTeamName" is not implemented
C:\Users\keega\OneDrive\Desktop\SAMP server\gamemodes\maude1.pwn(746) : warning 219: local variable "team" shadows a variable at a preceding level
C:\Users\keega\OneDrive\Desktop\SAMP server\gamemodes\maude1.pwn(843) : error 055: start of function body without function header
C:\Users\keega\OneDrive\Desktop\SAMP server\gamemodes\maude1.pwn(845) : error 010: invalid function or declaration
C:\Users\keega\OneDrive\Desktop\SAMP server\gamemodes\maude1.pwn(846) : error 010: invalid function or declaration
C:\Users\keega\OneDrive\Desktop\SAMP server\gamemodes\maude1.pwn(847) : error 010: invalid function or declaration
C:\Users\keega\OneDrive\Desktop\SAMP server\gamemodes\maude1.pwn(848) : error 010: invalid function or declaration
C:\Users\keega\OneDrive\Desktop\SAMP server\gamemodes\maude1.pwn(849) : error 010: invalid function or declaration
C:\Users\keega\OneDrive\Desktop\SAMP server\gamemodes\maude1.pwn(850) : error 010: invalid function or declaration
C:\Users\keega\OneDrive\Desktop\SAMP server\gamemodes\maude1.pwn(851) : error 010: invalid function or declaration
C:\Users\keega\OneDrive\Desktop\SAMP server\gamemodes\maude1.pwn(852) : error 010: invalid function or declaration
C:\Users\keega\OneDrive\Desktop\SAMP server\gamemodes\maude1.pwn(853) : error 010: invalid function or declaration
C:\Users\keega\OneDrive\Desktop\SAMP server\gamemodes\maude1.pwn(854) : error 010: invalid function or declaration
C:\Users\keega\OneDrive\Desktop\SAMP server\gamemodes\maude1.pwn(855) : error 010: invalid function or declaration
C:\Users\keega\OneDrive\Desktop\SAMP server\gamemodes\maude1.pwn(857) : warning 203: symbol is never used: "team"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


13 Errors.
Reply
#9

Please, don't abuse of the 'stocks', read more of this in: https://sampforum.blast.hk/showthread.php?tid=570635

Replace old function with this.

PHP код:
GetPlayerTeamName(playerid)
{
    new 
szString[24];
    switch(
GetPlayerTeam(playerid))
    {
        case 
TEAM_USAszString "United States";
        case 
TEAM_CANADAszString "Canada";
        case 
TEAM_BRITAINszString "Britain";
        case 
TEAM_AUSTRALIAszString "Australia";
        case 
TEAM_RUSSIAszString "Russia";
        case 
TEAM_GERMANYszString "Germany";
        case 
TEAM_ITALYszString "Italy";
        case 
TEAM_FRANCEszString "France";
        case 
TEAM_CHINAszString "China";
        case 
TEAM_INDIAszString "India";
    }
    return 
szString;

I recommend analyzing the functions so that you can learn, search the forum for tutorials on the use of the switch, it is really useful and fast compared to if
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)