SUGGESTION : Use a loop to remove all attached objects, so it's code will be cleaner
So newbies will not copy paste it's code multiple times.
pawn Код:
public OnPlayerDeath( playerid, killerid, reason )
{
// Comment below was taken from a_players.inc, we will use 0-4 this time.
// 5 = 0-4
for ( new i; i < 5; i ++ ) // Creates the variable 'i' and checks if it's value is lower than 5, if so, increase the value of ' i '
{
if ( IsPlayerAttachedObjectSlotUsed( playerid, i ) ) // If the attached slot ( it depends on the value of the 'i' variable ) of the player is used.
RemovePlayerAttachedObject( playerid, i ); // Remove the attached object the player have, the slot is the value of the 'i' variable.
}
return 1;
}
SUGGESTION2 : Add the bones list. So beginners wouldn't have confused what is the bones ID
Код:
-- This is from the SA-MP wikia.
0 - Not usable (will crash the client)
1 - Spine
2 - Head
3 - Left upper arm
4 - Right upper arm
5 - Left hand
6 - Right hand
7 - Left thigh
8 - Right thigh
9 - Left foot
10 - Right foot
11 - Right calf
12 - Left calf
13 - Left forearm
14 - Right forearm
15 - Left clavicle
16 - Right clavicle
17 - Neck
18 - Jaw
Nice tutorial though, good for beginners.