SA-MP Forums Archive
Help with some Errors Please - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Help with some Errors Please (/showthread.php?tid=323564)



Help with some Errors Please - NoZ - 06.03.2012

Hey Guys

this is the layout.
bassically, if their police & they go onto the pickup give 99.9 armour & set their p_Armour var to 1.
give some text sayying 'found body armour' and start an animation for 4 seconds.

now here's the issues.
this is the first time tryna code one of these things probbably done it wronge but can someone help me fix it/ the errors

Код:
public OnPlayerPickUpPickup(playerid, pickupid)
{
	if(gTeam[playerid] = t_Police && pickupid == p_Armour && GetPVarInt[playerid]"p_Armour" == 0)//LINE ALL THE ERRORS ARE ON
	{
		SetPVarInt(playerid, "p_Armour", 1);
	    SetPlayerArmour(playerid,99.9);
     	GameTextForPlayer(playerid,"~w~FOUND BODY ARMOUR",5000,4);
		ApplyAnimation(playerid,"BSKTBALL","BBALL_pickup",4.0,0,0,0,0,0);
		return 1;
	}
	return 1;
}
ERRORS

Код:
error 028: invalid subscript (not an array or too many subscripts): "GetPVarInt"
error 001: expected token: ";", but found "]"
error 029: invalid expression, assumed zero
fatal error 107: too many error messages on one line



Re: Help with some Errors Please - Chrillzen - 06.03.2012

Код:
public OnPlayerPickUpPickup(playerid, pickupid)
{
	if(gTeam[playerid] = t_Police && pickupid == p_Armour && GetPVarInt[playerid]"p_Armour" == 0)//LINE ALL THE ERRORS ARE ON
	{
	    SetPVarInt(playerid, "p_Armour", 1);
	    SetPlayerArmour(playerid,99.9);
     	    GameTextForPlayer(playerid,"~w~FOUND BODY ARMOUR",5000,4);
	    ApplyAnimation(playerid,"BSKTBALL","BBALL_pickup",4.0,0,0,0,0,0);
                     }
	    return 1;
}



Re: Help with some Errors Please - NoZ - 06.03.2012

What Did you change?


Re: Help with some Errors Please - Ricey - 06.03.2012

Chrillzen, I'd Belive you Diden't Change a Thing from the Posted Code & The Code you Posted.

So Mr. Troll, If You'd Skip to ANOTHER Forum.


Cheers,
Ricey.


Re: Help with some Errors Please - [ABK]Antonio - 06.03.2012

Quote:
Originally Posted by NoZ
Посмотреть сообщение
Код:
public OnPlayerPickUpPickup(playerid, pickupid)
{
	if(gTeam[playerid] = t_Police && pickupid == p_Armour && GetPVarInt[playerid]"p_Armour") == 0)//LINE ALL THE ERRORS ARE ON
	{
		SetPVarInt(playerid, "p_Armour", 1);
	    SetPlayerArmour(playerid,99.9);
     	GameTextForPlayer(playerid,"~w~FOUND BODY ARMOUR",5000,4);
		ApplyAnimation(playerid,"BSKTBALL","BBALL_pickup",4.0,0,0,0,0,0);
		return 1;
	}
	return 1;
}
GetPVarInt(playerid, "p_Armour") == 0


Re: Help with some Errors Please - MP2 - 06.03.2012

pawn Код:
public OnPlayerPickUpPickup(playerid, pickupid)
{
    if(gTeam[playerid] == t_Police && pickupid == p_Armour && GetPVarInt(playerid, "p_Armour") == 0)
    {
        SetPVarInt(playerid, "p_Armour", 1);
        SetPlayerArmour(playerid, 99.9);
        GameTextForPlayer(playerid, "~w~FOUND BODY ARMOUR", 5000, 4);
        ApplyAnimation(playerid, "BSKTBALL", "BBALL_pickup", 4.0, 0, 0, 0, 0, 0);
        return 1;
    }
    return 1;
}
You should also put spaces after commas, it makes readability a hell of a lot better.