Zaiat Errors When Compiling
#1

Hey guys, recently, I've started creating my own gamemode. The thing is, this Zaiat thing has an error, when, I think, it shouldn't. Here is my script of the Zaiat.

Код:
stock RemoveZaiatWeapon(playerid, weaponid)
{
    GunsBeingRemoved[playerid] = 1;
    ResetPlayerWeapons(playerid);
    GunsBeingRemoved[playerid] = 1;
    PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
	for(new w = 0; w < 13; w++)
	{
	    GetPlayerWeaponData(playerid, w, TempGuns[w], TempGunsAmmo[w]);
	    if(PlayerInfo[playerid][pWeapon][w] == weaponid)
		{
			PlayerInfo[playerid][pWeapon][w] = 0;
			TempGuns[w] = 0;
			TempGunsAmmo[w] = 0;
		}
	    PlayerInfo[playerid][pWeapon][w] = 0;
	}
	for(new w = 0; w < 13; w++)
	{
	    GiveZaiatWeapon(playerid, TempGuns[w], TempGunsAmmo[w]);
	}
	return 1;
}

stock SaveZaiatAmmo(playerid)
{
	for(new i = 0; i < 13; i++)
	{
	    new Guns[2][13];
	    GetPlayerWeaponData(playerid, i, Guns[0][i], Guns[1][i]);
		if(PlayerInfo[playerid][pWeapon][i] == Guns[0][i])
		{
		    PlayerInfo[playerid][pWeaponAmmo][i] = Guns[1][i];
		}
	}
	return 1;
}

stock ResetZaiatWeapons(playerid)
{
    GunsBeingRemoved[playerid] = 1;
    ResetPlayerWeapons(playerid);
    GunsBeingRemoved[playerid] = 1;
    PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
	for(new i = 0; i < 13; i++)
	{
	    GunsBeingRemoved[playerid] = 1;
	    PlayerInfo[playerid][pWeapon][i] = 0;
	    GunsBeingRemoved[playerid] = 1;
	    PlayerInfo[playerid][pWeaponAmmo][i] = 0;
	    GunsBeingRemoved[playerid] = 1;
	}
	GunsBeingRemoved[playerid] = 1;
	return 1;
}

stock GiveZaiatWeapon(playerid, weaponid, ammo)
{
	GunsBeingRemoved[playerid] = 1;
	PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
	if(weaponid == 0 || weaponid == 1)
	{ // Slot 0
	    GunsBeingRemoved[playerid] = 1;
	    PlayerInfo[playerid][pWeapon][0] = weaponid;
	    GunsBeingRemoved[playerid] = 1;
	}
	else if(weaponid == 2 || weaponid == 3 || weaponid == 4 || weaponid == 5 || weaponid == 6 || weaponid == 7 || weaponid == 8 || weaponid == 9)
	{ // Slot 1
		GunsBeingRemoved[playerid] = 1;
	    PlayerInfo[playerid][pWeapon][1] = weaponid;
	    GunsBeingRemoved[playerid] = 1;
	}
	else if(weaponid == 22 || weaponid == 23 || weaponid == 24)
	{ // Slot 2
	    GunsBeingRemoved[playerid] = 1;
	    PlayerInfo[playerid][pWeapon][2] = weaponid;
	    GunsBeingRemoved[playerid] = 1;
	}
	else if(weaponid == 25 || weaponid == 26 || weaponid == 27)
	{ // Slot 3
	    GunsBeingRemoved[playerid] = 1;
	    PlayerInfo[playerid][pWeapon][3] = weaponid;
	    GunsBeingRemoved[playerid] = 1;
	}
	else if(weaponid == 28 || weaponid == 29 || weaponid == 32)
	{ // Slot 4
	    GunsBeingRemoved[playerid] = 1;
	    PlayerInfo[playerid][pWeapon][4] = weaponid;
	    GunsBeingRemoved[playerid] = 1;
	}
	else if(weaponid == 30 || weaponid == 31)
	{ // Slot 5
	    GunsBeingRemoved[playerid] = 1;
	    PlayerInfo[playerid][pWeapon][5] = weaponid;
	    GunsBeingRemoved[playerid] = 1;
	}
	else if(weaponid == 33 || weaponid == 34)
	{ // Slot 6
	    GunsBeingRemoved[playerid] = 1;
	    PlayerInfo[playerid][pWeapon][6] = weaponid;
	    GunsBeingRemoved[playerid] = 1;
	}
	else if(weaponid == 35 || weaponid == 36 || weaponid == 37 || weaponid == 38)
	{ // Slot 7
	    GunsBeingRemoved[playerid] = 1;
	    PlayerInfo[playerid][pWeapon][7] = weaponid;
	    GunsBeingRemoved[playerid] = 1;
	}
	else if(weaponid == 16 || weaponid == 17 || weaponid == 18 || weaponid == 39)
	{ // Slot 8
	    GunsBeingRemoved[playerid] = 1;
	    PlayerInfo[playerid][pWeapon][8] = weaponid;
	    GunsBeingRemoved[playerid] = 1;
	}
	else if(weaponid == 41 || weaponid == 42 || weaponid == 43)
	{ // Slot 9
	    GunsBeingRemoved[playerid] = 1;
	    PlayerInfo[playerid][pWeapon][9] = weaponid;
	    GunsBeingRemoved[playerid] = 1;
	}
	else if(weaponid == 10 || weaponid == 11 || weaponid == 12 || weaponid == 13 || weaponid == 14 || weaponid == 15)
	{ // Slot 10
	    GunsBeingRemoved[playerid] = 1;
	    PlayerInfo[playerid][pWeapon][10] = weaponid;
	    GunsBeingRemoved[playerid] = 1;
	}
	else if(weaponid == 44 || weaponid == 45 || weaponid == 46)
	{ // Slot 11
	    GunsBeingRemoved[playerid] = 1;
	    PlayerInfo[playerid][pWeapon][11] = weaponid;
	    GunsBeingRemoved[playerid] = 1;
	}
	else if(weaponid == 40)
	{ // Slot 12
	    GunsBeingRemoved[playerid] = 1;
	    PlayerInfo[playerid][pWeapon][12] = weaponid;
	    GunsBeingRemoved[playerid] = 1;
	}
	GivePlayerWeapon(playerid, weaponid, ammo);
	return 1;
}
Here are the errors. They are all on this one little line.

Код:
	    PlayerInfo[playerid][pWeapon][i] = 0;
Here are the errors.

Код:
C:\Users\Justin\Desktop\My RP Gamemode\gamemodes\My RP Gamemode.pwn(139) : warning 215: expression has no effect
C:\Users\Justin\Desktop\My RP Gamemode\gamemodes\My RP Gamemode.pwn(139) : error 001: expected token: ";", but found "["
C:\Users\Justin\Desktop\My RP Gamemode\gamemodes\My RP Gamemode.pwn(139) : error 029: invalid expression, assumed zero
C:\Users\Justin\Desktop\My RP Gamemode\gamemodes\My RP Gamemode.pwn(139) : warning 215: expression has no effect
C:\Users\Justin\Desktop\My RP Gamemode\gamemodes\My RP Gamemode.pwn(139) : error 001: expected token: ";", but found "]"
C:\Users\Justin\Desktop\My RP Gamemode\gamemodes\My RP Gamemode.pwn(139) : fatal error 107: too many error messages on one line
If you could help, that would be amazing. Thanks.
Reply
#2

Do you have a PlayerInfo Enum? if yes, show it, (it should be at the top of the gamemode)
Reply
#3

Cancel this.
Reply
#4

Quote:

PlayerInfo[playerid][pWeapon][i] = 0;

You already defined [playerid] then why u defining again? [i] ?
Reply
#5

Quote:
Originally Posted by SimpalK
Посмотреть сообщение
You already defined [playerid] then why u defining again? [i] ?
^^Agreed

It can be done but you need to have array in the enum.Please show your enum.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)