Help with some Errors Please
#1

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
Reply
#2

Код:
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;
}
Reply
#3

What Did you change?
Reply
#4

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.
Reply
#5

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
Reply
#6

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.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)