[Tutorial] How to use SetPlayerAttachedObject [Beginners]
#7

Quote:
Originally Posted by Basicz
Посмотреть сообщение
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.
Quote:

Model, and Bone

....
Reply


Messages In This Thread
How to use SetPlayerAttachedObject [Beginners] - by =WoR=G4M3Ov3r - 06.09.2011, 00:41
Re: How to use SetPlayerAttachedObject [Beginners] - by Kitten - 06.09.2011, 01:24
Re: How to use SetPlayerAttachedObject [Beginners] - by =WoR=G4M3Ov3r - 06.09.2011, 01:27
Re: How to use SetPlayerAttachedObject [Beginners] - by =WoR=Bruno - 06.09.2011, 01:31
Re: How to use SetPlayerAttachedObject [Beginners] - by =WoR=G4M3Ov3r - 06.09.2011, 01:34
Re: How to use SetPlayerAttachedObject [Beginners] - by Kush - 06.09.2011, 01:52
Re: How to use SetPlayerAttachedObject [Beginners] - by Jack_Leslie - 06.09.2011, 05:28
Re: How to use SetPlayerAttachedObject [Beginners] - by FireCat - 06.09.2011, 07:41
Re: How to use SetPlayerAttachedObject [Beginners] - by =WoR=G4M3Ov3r - 06.09.2011, 11:43
Re: How to use SetPlayerAttachedObject [Beginners] - by Jafet_Macario - 06.09.2011, 11:47
Re: How to use SetPlayerAttachedObject [Beginners] - by =WoR=G4M3Ov3r - 06.09.2011, 11:59
Re: How to use SetPlayerAttachedObject [Beginners] - by =WoR=G4M3Ov3r - 06.09.2011, 12:50
Re: How to use SetPlayerAttachedObject [Beginners] - by [NoV]LaZ - 06.09.2011, 12:55
Re: How to use SetPlayerAttachedObject [Beginners] - by =WoR=G4M3Ov3r - 06.09.2011, 13:21
Re: How to use SetPlayerAttachedObject [Beginners] - by PhoenixB - 06.09.2011, 21:12
Re: How to use SetPlayerAttachedObject [Beginners] - by =WoR=G4M3Ov3r - 06.09.2011, 21:13
Re: How to use SetPlayerAttachedObject [Beginners] - by Gogon - 07.09.2011, 02:21
Re: How to use SetPlayerAttachedObject [Beginners] - by =WoR=G4M3Ov3r - 07.09.2011, 02:23
Re: How to use SetPlayerAttachedObject [Beginners] - by =WoR=Varth - 07.09.2011, 02:24
Re: How to use SetPlayerAttachedObject [Beginners] - by =WoR=G4M3Ov3r - 07.09.2011, 02:25
Re: How to use SetPlayerAttachedObject [Beginners] - by Shockey HD - 07.09.2011, 02:32
Re: How to use SetPlayerAttachedObject [Beginners] - by =WoR=G4M3Ov3r - 07.09.2011, 03:01
Re: How to use SetPlayerAttachedObject [Beginners] - by Davz*|*Criss - 09.09.2011, 08:52
Re: How to use SetPlayerAttachedObject [Beginners] - by =WoR=G4M3Ov3r - 09.09.2011, 13:37
Re : How to use SetPlayerAttachedObject [Beginners] - by Naruto_Emilio - 11.09.2011, 14:52
Re: How to use SetPlayerAttachedObject [Beginners] - by [NoV]LaZ - 11.09.2011, 15:42
Re: How to use SetPlayerAttachedObject [Beginners] - by =WoR=G4M3Ov3r - 12.09.2011, 12:24
Re: How to use SetPlayerAttachedObject [Beginners] - by IstuntmanI - 12.09.2011, 15:10
Re: How to use SetPlayerAttachedObject [Beginners] - by [NoV]LaZ - 12.09.2011, 15:34
Re: How to use SetPlayerAttachedObject [Beginners] - by =WoR=G4M3Ov3r - 13.09.2011, 02:29
Re : Re: How to use SetPlayerAttachedObject [Beginners] - by Alvin007 - 13.09.2011, 13:22
Re: How to use SetPlayerAttachedObject [Beginners] - by HotPlayer - 13.09.2011, 13:25
Re : Re: How to use SetPlayerAttachedObject [Beginners] - by Alvin007 - 13.09.2011, 13:28
Re: Re : Re: How to use SetPlayerAttachedObject [Beginners] - by =WoR=G4M3Ov3r - 13.09.2011, 13:38
Re : How to use SetPlayerAttachedObject [Beginners] - by timaoux - 14.09.2011, 14:02
Re : How to use SetPlayerAttachedObject [Beginners] - by timaoux - 14.09.2011, 14:10
Re: How to use SetPlayerAttachedObject [Beginners] - by HotPlayer - 14.09.2011, 14:28
Re: How to use SetPlayerAttachedObject [Beginners] - by =WoR=G4M3Ov3r - 14.09.2011, 22:52
Re : How to use SetPlayerAttachedObject [Beginners] - by Naruto_Emilio - 16.09.2011, 14:37
Re: How to use SetPlayerAttachedObject [Beginners] - by Issam - 16.09.2011, 16:35
Re: How to use SetPlayerAttachedObject [Beginners] - by =WoR=G4M3Ov3r - 16.09.2011, 16:57
Re: How to use SetPlayerAttachedObject [Beginners] - by -CaRRoT - 24.11.2011, 16:08
Re: How to use SetPlayerAttachedObject [Beginners] - by =WoR=G4M3Ov3r - 24.11.2011, 16:35

Forum Jump:


Users browsing this thread: 3 Guest(s)