Script help
#1

Can someone help me with this script?: http://pastebin.com/J0QMAatd
I'm not a good scripter so I'm getting these errors:
Код:
(17) error 001: expected token: ")", but found "}"
(17) error 029: invalid expression, assumed zero
(17 -- 18) warning 215: expression has no effect
(18) error 001: expected token: ";", but found "else"
(18) fatal error 107: too many error messages on one line
Can someone fix the errors for me please? It is supposed to play anim FALL_collapse when player gets shot in his right or left leg and is not in a vehicle so if I did something wrong then fix this aswell please. :P
Reply
#2

Код:
public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid, bodypart)
{
    if(issuerid != INVALID_PLAYER_ID && weaponid == 34 && bodypart == 9)
    {
        SetPlayerHealth(playerid, 0.0);
    }
	if(bodypart == 7)
	{
		if(IsPlayerInAnyVehicle(playerid))
		{
			// CODE ?
		}
		else
		{
			ApplyAnimation(playerid, "ped", "FALL_collapse", 4.1, 0, 0, 0, 0, 0, 1);
		
		}
    }
	if(bodypart == 8)
	{
		if(IsPlayerInAnyVehicle(playerid))
		{
			// CODE ?
		}
		else
		{
			ApplyAnimation(playerid, "ped", "FALL_collapse", 4.1, 0, 0, 0, 0, 0, 1);
		}
    }
    return 1;
}
Reply
#3

You opened one bracket for "playerid" but you haven't closed it. It should be:
Код:
if(IsPlayerInAnyVehicle(playerid))
Reply
#4

Quote:
Originally Posted by F1N4L
Посмотреть сообщение
Код:
public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid, bodypart)
{
    if(issuerid != INVALID_PLAYER_ID && weaponid == 34 && bodypart == 9)
    {
        SetPlayerHealth(playerid, 0.0);
    }
	if(bodypart == 7)
	{
		if(IsPlayerInAnyVehicle(playerid))
		{
			// CODE ?
		}
		else
		{
			ApplyAnimation(playerid, "ped", "FALL_collapse", 4.1, 0, 0, 0, 0, 0, 1);
		
		}
    }
	if(bodypart == 8)
	{
		if(IsPlayerInAnyVehicle(playerid))
		{
			// CODE ?
		}
		else
		{
			ApplyAnimation(playerid, "ped", "FALL_collapse", 4.1, 0, 0, 0, 0, 0, 1);
		}
    }
    return 1;
}
Thank you.
Reply
#5

Hey!
If you want more informations about warnings or error codes, check this : https://forums.alliedmods.net/showthread.php?t=201044!
Have a good day bro'.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)