SaveZaiatAmmo Help
#1

Hey guys, recently I've started creating a game mode. The thing is, one thing is stopping me... These errors:

Код:
C:\Users\Justin\Desktop\My RP Gamemode\gamemodes\My RP Gamemode.pwn(137) : error 001: expected token: ")", but found "["
C:\Users\Justin\Desktop\My RP Gamemode\gamemodes\My RP Gamemode.pwn(137) : error 029: invalid expression, assumed zero
C:\Users\Justin\Desktop\My RP Gamemode\gamemodes\My RP Gamemode.pwn(137) : warning 215: expression has no effect
C:\Users\Justin\Desktop\My RP Gamemode\gamemodes\My RP Gamemode.pwn(137) : error 001: expected token: ";", but found "]"
C:\Users\Justin\Desktop\My RP Gamemode\gamemodes\My RP Gamemode.pwn(137) : fatal error 107: too many error messages on one line
Here is my script lines:

Код:
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;
}
I personally don't see anything wrong with it.
Reply
#2

show me the exact line.
Reply
#3

Quote:
Originally Posted by Parka
Посмотреть сообщение
show me the exact line.
Код:
		if(PlayerInfo[playerid][pWeapon][i] == Guns[0][i])
Reply
#4

pawn Код:
new GunsBeingRemoved[MAX_PLAYERS];
new TempGuns[13];
new TempGunsAmmo[13];

enum pInfo
{
pWeapon[13],
pWeaponAmmo[13]
}
new PlayerInfo[MAX_PLAYERS][pInfo];

forward RemoveZaiatWeapon(playerid, weaponid);
public 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;
}

forward SaveZaiatAmmo(playerid);
public 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;
}
note: I do not know what is GiveZaiatWeapon, but that's the only thing that gives me error that you should not give errors.
Reply
#5

Quote:
Originally Posted by Parka
Посмотреть сообщение
pawn Код:
new GunsBeingRemoved[MAX_PLAYERS];
new TempGuns[13];
new TempGunsAmmo[13];

enum pInfo
{
pWeapon[13],
pWeaponAmmo[13]
}
new PlayerInfo[MAX_PLAYERS][pInfo];

forward RemoveZaiatWeapon(playerid, weaponid);
public 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;
}

forward SaveZaiatAmmo(playerid);
public 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;
}
note: I do not know what is GiveZaiatWeapon, but that's the only thing that gives me error that you should not give errors.
Yeah... I know, it looked alright to me. Thats why I posted it here
Reply
#6

If I could get anymore help, that would be amazing. This one Zaiat thing is making my OnPlayerConnect work, and without it, my OnPlayerConnect wont work... Leading to more problems. Thanks!
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)